Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question

closed as too localized by percusse, lockstep, topskip, Jake, Paulo Cereda Jun 10 '12 at 13:27

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
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. –  Peter Grill Feb 24 '12 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. –  polar Feb 26 '12 at 22:17