1

I have two groups of data 4ACH and 6ACH: and 4 sub-groups within:

      4ACH           6ACH
    0.04485625  0.04265625
    1.881133333 0.595466667
    1.152166667 0.613
    1.842835802 0.401030556
    0.3139072   0.170007298
    -----
    0.04485625  0.04265625
    0.002466667 0.000133333
    1.152166667 0.613
    0.003676543 0.000462346
    0.3139072   0.170007298
    ----
    0.000628571 0.00005
    0.001266667 0.0002
    1.152166667 0.613
    0.001048457 0.000462346
    0.30285028  0.159355735
    ------
    0.04485625  0.04265625
    0.001266667 0.0002
    1.152166667 0.613
    0.002796914 0.000777778
    0.30285028  0.159355735

bar([4ach 6ach]) gives me: enter image description here

How do I add distinct spacing where the red lines are? This is spot on but for r. grouped bar graph And how can I get the second row of text? I remember seeing something about the text command. This shows how to get the grouped labels but I can't quite work it out for this example : How can I adjust 3-D bar grouping and y-axis labeling in MATLAB?

Community
  • 1
  • 1
HCAI
  • 2,213
  • 8
  • 33
  • 65

1 Answers1

2

One solution is inserting in your tables zeros instead of '----' Or try this one

bar([[4ACH(1:5) 6ACH(1:5)];[0 0];[4ACH(6:10) 6ACH(6:10)];...
[0 0];[4ACH(11:15) 6ACH(11:15)]])
freude
  • 3,632
  • 3
  • 32
  • 51
  • Ah nice. And the labels where it says Patient 1,2,3 etc? – HCAI Apr 18 '13 at 15:08
  • Here is info how to manage labels http://www.mathworks.nl/help/matlab/ref/xlabel.html – freude Apr 18 '13 at 15:12
  • You can set any labels you want even in the figure window, axis properties, ticks. In your case you use two many labels, so it will be simpler to put "Patient1", "Patient2" etc just in the figure using http://www.mathworks.nl/help/matlab/creating_plots/adding-text-annotations-to-graphs.html – freude Apr 18 '13 at 15:13
  • I usually do a job with labels in CorelDraw or Inkscape saving the figure in .eps format. – freude Apr 18 '13 at 15:23
  • Hmm I eventually put all my graphs through matlab2tikz for use in latex and i'm not sure how it will work with resizing the figure. But out of interest is it possible to colour each group? and then two shades of the same colour within each group? – HCAI Apr 18 '13 at 15:45