5

Right now I have this:

input graph
input sarith

beginfig(1)
  draw begingraph(3cm,2cm)
    gdata("data1.d", v,
      path p;
      augment p (v1,0);
      augment p (v1,v2);
      augment p (v1 Sadd "1",v2);
      augment p (v1 Sadd "1",0);
      gfill p--cycle withcolor .8white;
      gdraw p--cycle;
      );
endgraph;
endfig;

end

This builds a bar chart with grey bars with my test data set. However I need it colored, very much like the one in this question: How to create a bar chart in which the y-axis is expressed in percents?

There will be 3 different colors, representing algorithms, each of these colors will have 3 bars: best, worst and average, this will be manually put into the data set file.

How can I do this? Can I label each bar with a name? Maybe putting a string inside the bar? Like "Best" and so on? Also, can I set the x-axis as a string space? I mean, i wanted the algorithm's name as a lower label, then the three bars on top of it.

I'm really new to metapost, so forgive me my noobness.

Thanks.

Edit:

Checking on how nice the bar chart on the solution I posted, this could be done in pgfplots. However I have no knowledge on this package. If anyone knows how to do what I want using pgfplots, I'd study and use it.

Added tags.

2
  • Welcome to TeX.SE. Since you are willing to consider using pgfplots starting with the answer in the question you linked to should get you going. Feb 24, 2012 at 22:53
  • I tried to understand it, but I have no idea on where the percentage is "draw" on top of the bars. Also, it would be better if the words where written inside the bar.
    – hfingler
    Feb 26, 2012 at 22:17

0

Browse other questions tagged .