[metapost] Statsmac barchart
David Arnold
dwarnold45 at suddenlink.net
Sat Jan 2 00:09:11 CET 2010
Hi,
I'm using Anthony Phan's statsmac package.
http://www-math.univ-poitiers.fr/~phan/
mps.tar.gz
I'm trying to do a barchart with categorical data. I've tried:
input statsmac;
data(poll)
"Yes", 30,
"No", 20,
"Undecided", 50;
beginfig(0);
usedata(poll, response$, n);
setrange(0,3,5cm,0,50,3cm);
weight reponse, n;
barchart(response);
endfig;
end.
And:
input statsmac;
data(poll)
"Yes","No","Yes","No","Yes","No","Yes","No";
beginfig(0);
usedata(poll, response$);
setrange(0,3,5cm,0,50,3cm);
barchart(response);
endfig;
end.
But no luck. I'm struggling a bit with this as the manual mentions "When plotting a barchart of a non-numeric variable," but I can find no example of this in the disribution.
Has anyone tried this?
David.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/metapost/attachments/20100101/aa87ebc3/attachment.html>
More information about the metapost
mailing list