Stacked Bar Graph in Excel or Matlab

I want to represent this graph either in matlab/excel . X-axis show the load on primary network with values ranging 0.0 to 0.9 At Y-axis there is a ratio of NSU/NCH that goes from 0.08 to 0.44 each step is of 0.04. There are two categories CHO and NHO like NHO is represented with blue in the figure and CHO is represented with greeen in the figure. now for ratio value of 0.08 CHO is better for all value of ld_pr(x-axis) same is for 0.4 and 0.44 NHO is better for all values of ld_pr

0.5 to 0.6 NHO(blue line) is better then from 0.6 to 0.9 again CHO is better (green line) I want to show this either in matlab or excel. if some one of you can help me

enter image description here

2

1 Answer

Because you have two separate bars for CHO in some places, you have to structure your data table with 3 series:

enter image description here

Now you can create the graph. The details of this will vary depending on your version of Excel.

Select the data (including the headings) in B1:D11, and choose "Bar > Stacked Bar" from the Charts tab. That should give you a graph similar to this:

enter image description here

Next, select "Source Data..." from the "Chart" menu. Click the first series in the list (CHO), then click in the box for "Category (X) axis labels:" and select the NSU/NCH data (A2:A11).

Under "Chart Layout", add a Vertical Axis Title. Edit the text as necessary.

Click to select the horizontal axis, and edit the Scale to have a Maximum of 0.9 and a Major Unit of 0.1.

Change the colors of the bars by clicking each series in turn, edit the Data Series, and change the Fill to the appropriate color.

Finally, select the legend to delete it, or click again on just the CHO2 label to delete that. The end result should be something like this:

enter image description here

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like