From: Todd, David <dtodd@ir...> - 2007-06-01 18:41:06
I'm having a hard time understanding what is actually required for the
My goal is that take information from a database query from mysql, and graph
the numbers that I am getting from it.
The data is an integer, and a text field telling us what the integer
I.e. (1,"Ponies", 4,"sheep", 9, "cows", 16, "newts")
I can arrange the data in a variety of ways, that's not a problem.
What do I need to do to get those values as a bar graph?
The expected output would be four bars, drawn to the height of the integers,
and labeled with the text strings.
Thanks in advance.
From: Alan G Isaac <aisaac@am...> - 2007-06-01 21:19:14
On Fri, 01 Jun 2007, David Todd apparently wrote:
> (1,"Ponies", 4,"sheep", 9, "cows", 16, "newts") What do
> I need to do to get those values as a bar graph?
raw = (1,"Ponies", 4,"sheep", 9, "cows", 16, "newts")
iraw = iter(raw)
d = [[name,val] for val,name in zip(*[iraw]*2)]
datalist = pyx.graph.data.list(d,xname=1,y=2)
g = pyx.graph.graphxy(width=8, x=pyx.graph.axis.bar())
g.plot(datalist,styles = [pyx.graph.style.bar(barattrs=[pyx.color.rgb.blue])])
Get latest updates about Open Source Projects, Conferences and News.