## [PyX-user] Multiple Curves Per Plot, Different Modules

 [PyX-user] Multiple Curves Per Plot, Different Modules From: Rich Shepard - 2008-03-27 13:51:49 ```On Tue, 25 Mar 2008, David Barton wrote: > I'd recommend persevering with PyX. I've found it to be one of the best > plotting tools available in terms of producing print-quality figures. David, I agree that it's a powerful and useful library which is not too difficult to learn. Yesterday I experimented, re-read the manual, faq, and example/gallery code so I have a much greater appreciation and know how to do much of what I need from it. However, there are currently two remaining issues for which I have not found the solutions on my own. I would greatly appreciate help from the community here. 1.) The y-axis on the plots I need to create range from [0.0, 1.0]. By specifying my own partioner I can change the tick spacing from 0, 0.25, 0.5, 0.75, 1 to every 0.2: pary = graph.axis.parter.lin([0.2,]) However, the ends are labeled without the '.0' that the inner labels have. How do I replace 0 with 0.0 and 1 with 1.0? 2.) This actually has two components, but they are related and need to be addressed together. The actual curve drawing functions are used in several parts of the model's use, so they are in the generic 'functions.py' and imported to the specific modules where they are needed. However, each plot needs to contain multiple curves (from 2 to 7). I read that multiple calls to plot() can be made to put all the curves on a single set of axes. But, how do I implement this across modules? Perhaps the best way to explain this is how I did it with matplotlib. The calling module instructed matplotlib to freeze the plot until released. Then the required curve-generating functions in functions.py were called and the curves themselves returned to the calling module. When all were returned, matplotlib was told to generate the figure, write it to disk, and release the axes and plot for the next figure. Perhaps PyX has a different approach, but my experiments yesterday did not discover just how I can do this. The calls to graphxy() appear to immediately preceed the call to plot(), and there's no way to separate them. I suppose the curve-generating functions could return a list of tuples (appropriate x,y pairs) to the calling module for graph creation and plotting but I don't know how to do that. Nor do I know how I can assemble the the figure to plot from different curves. I can provide both calling code and curve-generating functions in my two stand-alone testing/learning modules. TIA, Rich -- Richard B. Shepard, Ph.D. | Integrity Credibility Applied Ecosystem Services, Inc. | Innovation ; Voice: 503-667-4517 Fax: 503-667-8863 ```