4
我知道如何繪製grouped
條形圖和stacked
柱狀圖如下:將「分組」和「堆疊」結合到BAR圖中?
Y = round(rand(5,4)*10);
figure;
subplot(2,2,1); bar(Y,'grouped'); title('Group') % similar for 'hist'/'histc'
subplot(2,2,2); bar(Y,'stacked'); title('Stack')
這將產生類似:
我的問題是,我怎麼能結合選項grouped
和stacked
在BAR圖中能夠生成如下圖形(堆疊3,4一起)?或者有沒有其他方法可以實現這一目標?附:我手動繪製了下圖。
可能重複http://stackoverflow.com/問題/ 6012568/how-can-i-create-a-barseries-plot-using-both-grouped-and-stacked-styles-in-matla – hesar
@hesar它不是重複的。該問題涉及繪製堆積條形圖組,即以分組佈局繪製堆積條形圖。我的問題是同時顯示兩者。不管怎麼說,還是要謝謝你。我會試圖弄清楚他們的想法在這裏如何應用。 – herohuyongtao