Hi René.
On Fri, Sep 24, 2010 at 05:20:02PM +0200, R. Bastian wrote:
> Hello,
> 
> I use graph.data.points to create graphs from numpy arrays. But it
> seems that one gets a graph made of points.  (the eps code shows lots
> of "moveto") and not lines joining the values.
> 
> Is there another way to go draw a line joining the values of a numpy
> array ?
Yes;-)
The Idea of PyX is:
 - you use "graph.data.points" as data-source -- that has NOTHING to do
   with the question how the data are plottet (well, it gives a default
   value, but not more). See:
   http://pyx.sourceforge.net/manual/module-graph.data.html
 - in the plot-Command, you can pass an additional plot-Style (from
   graph.style) -- this defines, how the data are plotted. See:
   http://pyx.sourceforge.net/manual/module-graph.style.html

For example:

g.plot(graph.data.points(dat),[graph.style.symbol()])

plots the data contained in the list "dat" using symbols

In order to get lines, you could use:

g.plot(graph.data.points(dat),[graph.style.line()])


You can also compine the styles, and add some parameters to define the
styles more precisely. Look for example at:
http://pyx.sourceforge.net/gallery/graphs/symbolline.html

g.plot(data.function("y(x)=x*sin(x**2)"),
       [graph.style.line([style.linewidth.Thin, style.linestyle.solid]),
        graph.style.symbol(graph.style.symbol.circle, size=0.1,
                           symbolattrs=[deco.filled([color.rgb.green]),
                                        deco.stroked([color.rgb.red])])])

This plots using the the data-source "data.function", with a quite
complex style:
 - thin, solid, black line
 - circles of size 0.1, drawn with red lines and filled in green
You can for example simply replace the "data.function(..)" in this
command by your "graph.data.points(...)


HTH,

Axel

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to