[SciPy-dev] scipy plt can only plot once?

Kevin Altis altis at semi-retired.com
Thu Oct 11 13:29:01 EDT 2001


I'm new to scipy, but I'm trying out the tutorials with PythonCard (which
uses wxPython 2.3.x) and PyCrust 0.6 as the shell. I get the following error
when I try the example as shown on the screenshots page.

>>> from scipy import plt
>>> from scipy import *
>>> from RandomArray import normal
>>> img = plt.lena()
>>> plt.image(img)
<wxPython imported>
>>> Traceback (most recent call last):
  File "<input>", line 1, in ?
  File "C:\Python21\scipy\plt\interface.py", line 427, in image
    axis('equal')
  File "C:\Python21\scipy\plt\interface.py", line 174, in axis
    x_ticks = _active.x_axis.ticks
AttributeError: axis_window instance has no attribute 'ticks'

In addition, the image isn't scaled correctly, probably because of the
exception. If I run the tutorial commands first:
            # create some data to plot
            >>> x = arange(0,5,.5)
            >>> y = special.j1(x)
            >>> plt.plot(x,y)
            <C wxFrame instance at _1e22dd8_wxFrame_p>
            [ a graphics window should appear ]

            # now add some titles
            >>> plt.title('First Order Bessel Function')
            >>> plt.xtitle('x axis')
            >>> plt.ytitle('y axis')
            # and x-axis bounds equal to that of the data
            >>> plt.xaxis('fit')

Then I don't get an error and the image is scaled correctly.

ka

> -----Original Message-----
> From: scipy-dev-admin at scipy.org [mailto:scipy-dev-admin at scipy.org]On
> Behalf Of Travis N. Vaught
> Sent: Thursday, October 11, 2001 8:22 AM
> To: scipy-dev at scipy.org
> Subject: RE: [SciPy-dev] scipy plt can only plot once?
>
>
> plt.figure() should create another wxFrame instance, allowing
> more than one
> plot.  You can see this in the screenshot image:
>
> http://www.scipy.org/site_content/screen_shots
>
> TV
>
> > -----Original Message-----
> > From: scipy-dev-admin at scipy.org [mailto:scipy-dev-admin at scipy.org]On
> > Behalf Of python at lee-morgan.net
> > Sent: Thursday, October 11, 2001 10:15 AM
> > To: scipy-dev at scipy.net
> > Subject: [SciPy-dev] scipy plt can only plot once?
> >
> >
> >
> > After investigation its due to a division error...
> >
> > Is it possible to have more than one live plot?
> >
> > *** c:/WINDOWS/TEMP/plot_objects.py	Fri Oct 12 01:09:56 2001
> > --- c:/WINDOWS/TEMP/ediff-36954966S	Fri Oct 12 01:09:56 2001
> > ***************
> > *** 459,469 ****
> >               raise ValueError,'rotate must be 0 or 90. It is %d'
> > % self.rotate
> >
> >           # translate to screen units for the ticks.
> > !         try:
> > !             scale = length / float(self.ticks[-1] - self.ticks[0])
> > !         except ZeroDivisionError:
> > !             scale = 1 #length / float(self.ticks[-1] - self.ticks[0])
> > !
> >           tick_locations = floor((self.ticks - self.ticks[0]) * scale)
> >
> >           # make array of points with tick screen units as x
> > value, 0 for y value
> > --- 459,465 ----
> >               raise ValueError,'rotate must be 0 or 90. It is %d'
> > % self.rotate
> >
> >           # translate to screen units for the ticks.
> > !         scale = length / float(self.ticks[-1] - self.ticks[0])
> >           tick_locations = floor((self.ticks - self.ticks[0]) * scale)
> >
> >           # make array of points with tick screen units as x
> > value, 0 for y value
> >
> >
> > --
> > Python
> >
> > _______________________________________________
> > Scipy-dev mailing list
> > Scipy-dev at scipy.net
> > http://www.scipy.net/mailman/listinfo/scipy-dev
>
> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-dev
>




More information about the SciPy-Dev mailing list