From: Rich S. <rsh...@ap...> - 2008-04-01 17:01:30
|
I need to assemble all curves for a single plot before calling the plot command. I've tried doing this using a list, and appending the graph.data.values() for each curve to it. But, it's not working. For example, when trying to plot both linear increasing and linear decreasing curves on the same axes, only the last one called is plotted. The calling function includes this code: elif row[4] == 'Linear Increasing': testFunctions.linearIncrCurve(row[8],row[11]) curveList.append(graph.data.values(x=appData.plotX, y=appData.plotY)) appData.plotX = None appData.plotY = None elif row[4] == 'Linear Decreasing': testFunctions.linearDecrCurve(row[10],row[9]) curveList.append(graph.data.values(x=appData.plotX, y=appData.plotY)) appData.plotX = None appData.plotY = None The two functions in the testFunctions module are: def linearIncrCurve(ll, hr): lowLeft = ll highRight = hr x, y = zip(*[(lowLeft, 0.0), (highRight, 1.0)]) appData.plotX = x appData.plotY = y def linearDecrCurve(hl, lr): highLeft = hl lowRight = lr x, y = zip(*[(highLeft, 1.0), (lowRight, 0.0)]) appData.plotX = x appData.plotY = y It appears the reason I cannot create a list of these curves is that they are pyx.graph.graph.graphxy.instances rather than string or numeric data. I'd appreciate suggestions on how to accumulate the appropriate curves for a single plot that holds them all until the plot() function is called. 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 |