I would try something like:

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

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

   p = graph.axis.painter.regular(titlepos=0.3, titledirection=None)

   g = graph.graphxy(width=8, x2=None, y2=None,
                     x=graph.axis.linear(min=0,
                                         max=100,
                                         title='Universe of Discourse',
                                         painter=p),
                     y=graph.axis.linear(min=0.0,
                                         max=1.0,
                                         title='Membership Grade',
                                         painter=p))
   g.plot(graph.data.values(x=x, y=G))

but I haven't tried it myself ;-)

David

Rich Shepard wrote:
> On Tue, 25 Mar 2008, David Barton wrote:
> 
>> Try taking a look at this minimal example; hopefully it will show you how
>> to do the basic things you need. 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. (Matplotlib is great for previewing data
>> but I can't stand how you have to jump though hoops to get the figures all
>> the right sizes).
> 
> David,
> 
>    I originally wanted to use PSTricks as I use that for my vector graphics
> and LaTeX for my written documents, but it doesn't integrate smoothly with
> Python. So, I want to quickly become conversant with PyX so I can use it to
> generate exactly the figures I need for our model output reports.
> 
>    Despite reading the users guide and FAQ, and looking at examples on the
> web site, I'm still not sure exactly what needs to be included, and in which
> order. I know that experience will help, but today is my first attempt to
> get results with code that produces matplotlib results ... not the right
> size, not having the proper axes, no labeling, but they do print. So I know
> the data and functions are correct.
> 
>    Your example helps very much, but with understanding comes more questions.
> For example, given the functions in the testFunction.py file I attached, do
> I need to use graph.data.points() to convert the data before passing them to
> the rest of the PyX code? May I have an example of how to do that for the
> normal or logistic curves there? (Once I understand what I'm doing, and why
> I'm doing it I'll be able to adapt all the curve-generating functions
> correctly.) Would the graph.data.paramdate() function be used in my code?
> 
> Many thanks,
> 
> Rich
> 

-- 
===========================================
David Barton
Email:  [EMAIL PROTECTED]
Web:    www.cityinthesky.co.uk
===========================================

-------------------------------------------------------------------------
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