newbie graphing recommendations ?

A

Adam

Where should a py newbie start to do some 2D graphs on screen ?

PythonGraphApi,
Gato, looks interesting
pygraphlib,
matplotlib,

is there a best native Python place to start ?
 
S

Scott David Daniels

Adam said:
Where should a py newbie start to do some 2D graphs on screen ?
PythonGraphApi,
Gato, looks interesting
pygraphlib,
matplotlib,
is there a best native Python place to start ?

Check VPython (maybe least learning effort to first usable graphs).
Also look at PyGame if you want to paint screens.

--Scott David Daniels
(e-mail address removed)
 
J

jc

Adam said:
Where should a py newbie start to do some 2D graphs on screen ?

PythonGraphApi,
Gato, looks interesting
pygraphlib,
matplotlib,

is there a best native Python place to start ?
If you are going to be in wxPython try the 'PyPlot.py' examples in the
wxDemo. You will need to read the source cos' there is no official
documentation. Matlibplot is also good but difficult because of all the
options and lack of documentation API.
 
B

bearophileHUGS

Adam said:
Where should a py newbie start to do some 2D graphs on screen ?
PythonGraphApi,
Gato, looks interesting
pygraphlib,
matplotlib,
is there a best native Python place to start ?

The only good and simple way I have found so far to do some free
graphics with Python in a Window is using PyGame. (You can also use
TKinter, but it's slower).
MatPlotLib is very good to graph functions, datasets, etc. and to save
them to an image file.
There are other good libs if/when you want 3D graphics.

Bye,
bearophile
 
B

Bryan

The only good and simple way I have found so far to do some free
graphics with Python in a Window is using PyGame. (You can also use
TKinter, but it's slower).
MatPlotLib is very good to graph functions, datasets, etc. and to save
them to an image file.
There are other good libs if/when you want 3D graphics.

Bye,
bearophile

do you think that pygame would be a good alternative to matplotlib to create
some graphs such simple bar and line graphs? i want to animate them as new data
comes comes in. i would also like to have the bars and graphs have nice shading
if possible to give it a really attractive look. also, do you know if a pygame
windows can be embedded in a wxPython app?

thanks,

bryan
 
B

bearophileHUGS

Bryan:
do you think that pygame would be a good alternative to matplotlib to create
some graphs such simple bar and line graphs?

For graphs MatPlotLib is usually better, and its antialiasing library
(Anti-Grain Geometry) is wonderful. Pygame gives a bit more freedom but
you have to do all for yourself.

i want to animate them as new data comes comes in.

I think MatPlotLib can do this too, if your computer is fast enough.

i would also like to have the bars and graphs have nice shading
if possible to give it a really attractive look.

Remember what Edward Tufte (www.edwardtufte.com) says, often too much
elaborations makes graphs them less than useless.

Bye,
bearophile
 
J

John Hunter

bearophileHUGS> I think MatPlotLib can do this too, if your
bearophileHUGS> computer is fast enough.

bearophileHUGS> Remember what Edward Tufte (www.edwardtufte.com)
bearophileHUGS> says, often too much elaborations makes graphs
bearophileHUGS> them less than useless.

I share Tufte's opinion that you should avoid chart-junk -- stuff
designed to make charts look sexier that don't add information
context. matplotlib can do it (but doesn't go out of it's way to make
it easy). Eg,

from pylab import figure, show, nx, cm

def gbar(ax, x, y, width=0.5, bottom=0):
X = [[.6, .6],[.7,.7]]
for left,top in zip(x, y):
right = left+width
ax.imshow(X, interpolation='bicubic', cmap=cm.Blues,
extent=(left, right, bottom, top), alpha=1)

fig = figure()

xmin, xmax = xlim = 0,10
ymin, ymax = ylim = 0,1
ax = fig.add_subplot(111, xlim=xlim, ylim=ylim,
autoscale_on=False)
X = [[.6, .6],[.7,.7]]

ax.imshow(X, interpolation='bicubic', cmap=cm.copper,
extent=(xmin, xmax, ymin, ymax), alpha=1)

N = 10
x = nx.arange(N)+0.25
y = nx.mlab.rand(N)
gbar(ax, x, y, width=0.7)
ax.set_aspect('normal')
show()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top