mpl hates my guts today.

I'm developing an application for work and need to plot some spectra on a 
logscale. I can recreate my problem with embedding_in_qt4, by replacing 
MyDynamicMplCanvas.compute_initial_figure with this:

    def compute_initial_figure(self):
         self.axes.plot([0, 1, 2, 3], [1, 2, 0, 4], 'r')
         self.axes.set_yscale('log')

[...] 
File 
"/usr/lib64/python2.5/site-packages/matplotlib-0.90.1_r3709-py2.5-linux-x86_64.egg/matplotlib/axes.py",
 
line 1664, in set_ylim
    raise ValueError('Cannot set nonpositive limits with log transform')
ValueError: Cannot set nonpositive limits with log transform

I get that error even if I modify the update figure function so there is no 
possibility of zeros occuring in the data:

    def update_figure(self):
        # Build a list of 4 random integers between 0 and 10 (both inclusive)
        l = [ random.randint(0, 10) for i in xrange(4) ]

        l[l<=0]=1 # I love numpy
        self.axes.plot([1, 1, 2, 3], l, 'r')
        self.draw()

Anyone have any ideas? I think I have a bad case of gremlins.

Darren

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to