Thanks to Joerg I fixed my inability to call curve-generating functions in
a separate module. Now I'm getting an error when trying to use the returned
values, and I don't see in the source code how to do this correctly.

   The module with the curve plotting functions writes the results to the
application's 'config.py' module that is used to share values among
different modules. For example, this function,

def gaussCurve(midpt, width):
   center = midpt
   fwhm = width

   x = nx.arange(0, 100, 0.1)
   G = gauss1d(x, fwhm, center)

   appData.plotX = x
   appData.plotY = G

works as intended.

   In the calling function I try to use these values, but get the error
message that

   g.plot(graph.data.values(x=config.appData.plotX, y=config.appData.plotY)
AttributeError: values instance has no attribute '__getitem__'

   Just before the call to g.plot() I can print these two lists (e.g, print
appData.plotX) successfully.

   I've tried using using the lists directly

g.plot(graph.data.values(x=config.appData.plotX, y=config.appData.plotY)
          [graph.style.line([style.linewidth.Thin])])

and indirectly

x = config.appData.plotX
y = config.appData.plotY

g.plot(graph.data.values(x=x, y=y)
          [graph.style.line([style.linewidth.Thin])])

but I get the same error.

   Is it obvious what I've missed?

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