Re: [Matplotlib-users] Why Is This Code Failing?

2008-03-20 Thread Rich Shepard
On Wed, 19 Mar 2008, Rich Shepard wrote:

   When it runs in the test script the first curve is plotted in a
 matplotlib window and the program pauses until I close that window by
 clicking on the upper right button on the frame. Then this traceback is
 displayed:

   Update:

   I stripped the test data file down to a single plot's worth. Tried
different tuples in the data so different plotting functions were called. I
have pylab.hold(True) as the first statement in the for loop, and now --
with the single plot data -- there is no error trace.

   However, the code still displays the first curve of the three until I
manually close the matplotlib display window. Then the code proceeds to open
a new window and draw all three curves, then close itself after the save()
command.

   I've no idea how to clean up the drawing of the first curve and the pause
until that window is manually closed. Nothing I've read in the docs or on
the web site give me any clues.

   Clue appreciated.

Rich

-- 
Richard B. Shepard, Ph.D.   |  IntegrityCredibility
Applied Ecosystem Services, Inc.|Innovation
http://www.appl-ecosys.com Voice: 503-667-4517  Fax: 503-667-8863

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Why Is This Code Failing? -- FIXED

2008-03-20 Thread Rich Shepard
On Thu, 20 Mar 2008, Rich Shepard wrote:

   Clue appreciated.

   Bingo! Found the problem.

   The plotting functions are in a separate module, and each was developed
interactively using ipython, then copied into the module. As a result, each
function retained the show() command at the end, and that was interfering
with the intent of the programmatic generation.

   Commenting out the p.show() command removes the display, but the stored
.png is there. Whew!

Rich

-- 
Richard B. Shepard, Ph.D.   |  IntegrityCredibility
Applied Ecosystem Services, Inc.|Innovation
http://www.appl-ecosys.com Voice: 503-667-4517  Fax: 503-667-8863

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Why Is This Code Failing?

2008-03-19 Thread Rich Shepard
   Here is the relevant code fragment:

for i in range(1, compList[0][16]):
   pylab.hold(True)
   if compList[0][4] == 'Decay S-Curve':
 testFunctions.zCurve(compList[0][10],compList[0][9])
   elif compList[0][4] == 'Bell Curve':
 testFunctions.gaussCurve(compList[0][14],compList[0][14])
   elif compList[0][4] == 'Growth S-Curve':
 testFunctions.sCurve(compList[0][8],compList[0][11])
   elif compList[0][4] == 'Beta':

testFunctions.betaCurve(compList[0][13],compList[0][12],compList[0][14])
   elif compList[0][4] == 'Data':
 continue
   elif compList[0][4] == 'Linear Increasing':
 testFunctions.linearIncrCurve(compList[0][8],compList[0][11])
   elif compList[0][4] == 'Linear Decreasing':
 testFunctions.linearDecrCurve(compList[0][10],compList[0][9])
   elif compList[0][4] == 'Left Shoulder':

testFunctions.leftShoulderCurve(compList[0][10],compList[0][11],compList[0][9])
   elif compList[0][4] == 'Trapezoid':

testFunctions.trapezoidCurve(compList[0][8],compList[0][10],compList[0][11],compList[0][9])
   elif compList[0][4] == 'Right Shoulder':

testFunctions.rightShoulderCurve(compList[0][8],compList[0][10],compList[0][11])
   elif compList[0][4] == 'Triangle':

testFunctions.triangleCurve(compList[0][8],compList[0][13],compList[0][9])
   elif compList[0][4] == 'Singleton':
 testFunctions.singletonCurve(compList[0][13],compList[0][14])
   elif compList[0][4] == 'Rectangle':

testFunctions.rectangleCurve(compList[0][8],compList[0][10],compList[0][11],compList[0][9])
   elif compList[0][4] == 'Outcome':
 testFunctions.outcomeCurve()
 pylab.savefig(curVar+'.png')
 pylab.hold()

   When it runs in the test script the first curve is plotted in a matplotlib
window and the program pauses until I close that window by clicking on the
upper right button on the frame. Then this traceback is displayed:

Traceback (most recent call last):
   File termset-test-data.py, line 391, in ?
 testCode()
   File termset-test-data.py, line 388, in testCode
 pylab.hold()
   File /usr/lib/python2.4/site-packages/matplotlib/pyplot.py, line 334, in
hold
 rc('axes', hold=b)
   File /usr/lib/python2.4/site-packages/matplotlib/pyplot.py, line 74, in
rc
 matplotlib.rc(*args, **kwargs)
   File /usr/lib/python2.4/site-packages/matplotlib/__init__.py, line 712,
in rc
 rcParams[key] = v
   File /usr/lib/python2.4/site-packages/matplotlib/__init__.py, line 552,
in __setitem__
 cval = self.validate[key](val)
   File /usr/lib/python2.4/site-packages/matplotlib/rcsetup.py, line 43, in
validate_bool
 raise ValueError('Could not convert %s to boolean' % b)
ValueError: Could not convert None to boolean

   What I want is to have all curves from 1 to the maximum number (in
compList[0][16]) plotted on the same set of axes, then save that figure and
go on to the next one.

   Is my problem an indentation error at the end of the IF...ELIF tests?

TIA,

Rich

-- 
Richard B. Shepard, Ph.D.   |  IntegrityCredibility
Applied Ecosystem Services, Inc.|Innovation
http://www.appl-ecosys.com Voice: 503-667-4517  Fax: 503-667-8863

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users