Specifying X,Y Pairs For Line Plots

I need to plot trapezoids as well as left- and right-shouldered straight
line plots. If I specify separate lists for the x values and their
corresponding y values, the plots are generated and displayed as needed.
However, I cannot specify the points as a list of tuples and have matplotlib
accept them.

   Example:
   x,y = [(15,0.0), (30,1.0), (70,1.0) (85,0.0)]
   p.plot (x,y)

Yields:
   Traceback (most recent call last):
     File "trapezoid.py", line 4, in ?
       x,y = [(15,0.0), (30,1.0), (70,1.0) (85,0.0)]
   TypeError: 'tuple' object is not callable

   I don't see how to do this in the User Guide, but I'm sure there must be a
way. Please pass me a pointer on how to accomplish this.

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

you need a "," after that "(70,1.0)"

···

On Sunday 25 November 2007 12:15:54 pm Rich Shepard wrote:

x,y = [(15,0.0), (30,1.0), (70,1.0) (85,0.0)]

Thanks, Darren. Not enough caffine, I guess.

   However, now I get:

Traceback (most recent call last):
   File "trapezoid.py", line 4, in ?
     x,y = [(15.0, 0.0), (30.0, 1.0), (70.0, 1.0), (85.0, 0.0)]
ValueError: too many values to unpack

which tells me something is still not correct.

Rich

···

On Sun, 25 Nov 2007, Darren Dale wrote:

you need a "," after that "(70,1.0)"

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