On Tue, 1 Apr 2008, Alan G Isaac wrote:

> PyX is awesome.

Alan,

   It really is.

   Now, one remaining issue (other than labeling curve on the plots, but
that's for later): I cannot print multiple plots successively. Apparently,
the g.plot() function doesn't clear between plots.

   Here's where the plotting is done:

   if row[5] == row[16]:
       g.plot(curveList,[graph.style.line([style.linewidth.Thin])])
       print curveList
       g.writePDFfile(curComp + '_' + curSub + '_' + curVar)
       plotting = False
       curveList = []

and I print curveList at the top of the for loop.

   Here's the output (with my explanation interspaced):

$ python testData.py
[]
## We've just entered the for loop for the first plot

[<pyx.graph.data.values instance at 0xb5b44bec>]
[<pyx.graph.data.values instance at 0xb5b44bec>, <pyx.graph.data.values
instance at 0xb5b44c8c>]

## Here are the two curves for the first plot in the data; this is written
## to disk. Then we're back at the top for the second plot in the sample
## data:

[]
[<pyx.graph.data.values instance at 0xb5b44fec>]
[<pyx.graph.data.values instance at 0xb5b44fec>, <pyx.graph.data.values
instance at 0xb5b4708c>]

## These are the three curves for the second plot. The list has been cleared
## and the proper curves accumulated. Then I see this:

/usr/lib/python2.4/site-packages/pyx/graph/graph.py:171: UserWarning: axes
ranges have already been analysed; no further adjustments will be performed
   warnings.warn("axes ranges have already been analysed; no further
adjustments will be performed")
Traceback (most recent call last):
   File "testData.py", line 123, in ?
     testCode()
   File "testData.py", line 116, in testCode
     g.plot(curveList,[graph.style.line([style.linewidth.Thin])])
   File "/usr/lib/python2.4/site-packages/pyx/graph/graph.py", line 173, in
plot
     raise RuntimeError("can't plot further data after dostyles() has been
executed")
RuntimeError: can't plot further data after dostyles() has been executed

   So, the problem is with the second call to g.plot(). How can I clear/reset
axes, styles, etc. between calls?

Thanks,

Rich

-- 
Richard B. Shepard, Ph.D.               |  Integrity            Credibility
Applied Ecosystem Services, Inc.        |            Innovation
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to