Log scaling error on rev8753

Hello,

I can't log scale my axes on rev8753. It was working on a previous
check-out (possibly a month old). Using WXagg, but same as with
Qt4Agg.

Any ideas what could be wrong in the trunk? It seems to me that some
recent changes on LogLocator [
http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/matplotlib/ticker.py?view=log
]class causing this.

I[5]: d_um_pcasp_midpoint
O[5]:
array([ 0.124 , 0.1485, 0.179 , 0.2145, 0.2585, 0.333 , 0.5195,
        0.7955, 1.15 , 1.7805, 2.437 , 2.7865, 3.187 , 3.991 ,
        4.957 ])

I[6]: pcasp_spectral_density09d
O[6]:
array([ 523.31751809, 200.73229115, 179.82563138, 183.13125583,
        160.62733458, 48.77147359, 22.23106603, 7.56501192,
         10.94637257, 8.47475684, 21.53335341, 32.950845 ,
         30.502102 , 28.90555459, 21.38636076])

I[7]: plt.plot(d_um_pcasp_midpoint, pcasp_spectral_density09d)
O[7]: [<matplotlib.lines.Line2D object at 0x14b2474c>]

I[8]: ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (554, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (555, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (555, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (555, 0))

···

---------------------------------------------------------------------------
ValueError Traceback (most recent call last)

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backends/backend_wx.pyc
in _onKeyDown(self, evt)
   1254 key = self._get_key(evt)
   1255 evt.Skip()
-> 1256 FigureCanvasBase.key_press_event(self, key, guiEvent=evt)
   1257
   1258 def _onKeyUp(self, evt):

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backend_bases.pyc
in key_press_event(self, key, guiEvent)
   1525 s = 'key_press_event'
   1526 event = KeyEvent(s, self, key, self._lastx,
self._lasty, guiEvent=guiEvent)
-> 1527 self.callbacks.process(s, event)
   1528
   1529 def key_release_event(self, key, guiEvent=None):

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/cbook.pyc
in process(self, s, *args, **kwargs)
    260 del self.callbacks[s][cid]
    261 else:
--> 262 proxy(*args, **kwargs)
    263
    264

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/cbook.pyc
in __call__(self, *args, **kwargs)
    186 mtd = self.func
    187 # invoke the callable and return the result

--> 188 return mtd(*args, **kwargs)
    189
    190 def __eq__(self, other):

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backend_bases.pyc
in key_press(self, event)
   2254 elif scalex == 'linear':
   2255 ax.set_xscale('log')
-> 2256 ax.figure.canvas.draw()
   2257
   2258 elif (event.key.isdigit() and event.key!='0') or
event.key in all:

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backends/backend_wxagg.pyc
in draw(self, drawDC)
     57 """
     58 DEBUG_MSG("draw()", 1, self)
---> 59 FigureCanvasAgg.draw(self)
     60
     61 self.bitmap =
_convert_agg_to_wx_bitmap(self.get_renderer(), None)

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backends/backend_agg.pyc
in draw(self)
    392
    393 self.renderer = self.get_renderer()
--> 394 self.figure.draw(self.renderer)
    395
    396 def get_renderer(self):

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/artist.pyc
in draw_wrapper(artist, renderer, *args, **kwargs)
     53 def draw_wrapper(artist, renderer, *args, **kwargs):
     54 before(artist, renderer)
---> 55 draw(artist, renderer, *args, **kwargs)
     56 after(artist, renderer)
     57

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/figure.pyc
in draw(self, renderer)
    872 dsu.sort(key=itemgetter(0))
    873 for zorder, func, args in dsu:
--> 874 func(*args)
    875
    876 renderer.close_group('figure')

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/artist.pyc
in draw_wrapper(artist, renderer, *args, **kwargs)
     53 def draw_wrapper(artist, renderer, *args, **kwargs):
     54 before(artist, renderer)
---> 55 draw(artist, renderer, *args, **kwargs)
     56 after(artist, renderer)
     57

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/axes.pyc in
draw(self, renderer, inframe)
   1952
   1953 for zorder, a in dsu:
-> 1954 a.draw(renderer)
   1955
   1956 renderer.close_group('axes')

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/artist.pyc
in draw_wrapper(artist, renderer, *args, **kwargs)
     53 def draw_wrapper(artist, renderer, *args, **kwargs):
     54 before(artist, renderer)
---> 55 draw(artist, renderer, *args, **kwargs)
     56 after(artist, renderer)
     57

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/axis.pyc in
draw(self, renderer, *args, **kwargs)
    938 renderer.open_group(__name__)
    939 interval = self.get_view_interval()
--> 940 tick_tups = [ t for t in self.iter_ticks()]
    941 if self._smart_bounds:
    942 # handle inverted limits

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/axis.pyc in
iter_ticks(self)
    874 majorTicks = self.get_major_ticks(len(majorLocs))
    875 self.major.formatter.set_locs(majorLocs)
--> 876 majorLabels = [self.major.formatter(val, i) for i, val
in enumerate(majorLocs)]
    877
    878 minorLocs = self.minor.locator()

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/ticker.pyc
in __call__(self, x, pos)
    635 sign = np.sign(x)
    636 fx = math.log(abs(x))/math.log(b)
--> 637 isDecade = is_decade(fx)
    638
    639 usetex = rcParams['text.usetex']

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/ticker.pyc
in is_decade(x, base)
   1190 return True
   1191 lx = np.log(x)/np.log(base)
-> 1192 return abs(lx - nearest_long(lx)) < 1e-10
   1193
   1194 class LogLocator(Locator):

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/ticker.pyc
in nearest_long(x)
   1184 if x == 0: return 0L
   1185 elif x > 0: return long(x+0.5)
-> 1186 else: return long(x-0.5)
   1187
   1188 def is_decade(x, base=10):

ValueError: cannot convert float NaN to integer

--
Gökhan

I can't reproduce this here with trunk, though I get a different crash in the 1.x branch (which has an easy fix). Are there any additional steps required to reproduce?

Mike

···

On 10/18/2010 09:50 PM, Gökhan Sever wrote:

Hello,

I can't log scale my axes on rev8753. It was working on a previous
check-out (possibly a month old). Using WXagg, but same as with
Qt4Agg.

Any ideas what could be wrong in the trunk? It seems to me that some
recent changes on LogLocator [
http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/matplotlib/ticker.py?view=log
]class causing this.

I[5]: d_um_pcasp_midpoint
O[5]:
array([ 0.124 , 0.1485, 0.179 , 0.2145, 0.2585, 0.333 , 0.5195,
         0.7955, 1.15 , 1.7805, 2.437 , 2.7865, 3.187 , 3.991 ,
         4.957 ])

I[6]: pcasp_spectral_density09d
O[6]:
array([ 523.31751809, 200.73229115, 179.82563138, 183.13125583,
         160.62733458, 48.77147359, 22.23106603, 7.56501192,
          10.94637257, 8.47475684, 21.53335341, 32.950845 ,
          30.502102 , 28.90555459, 21.38636076])

I[7]: plt.plot(d_um_pcasp_midpoint, pcasp_spectral_density09d)
O[7]: [<matplotlib.lines.Line2D object at 0x14b2474c>]

I[8]: ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (554, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (555, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (555, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (555, 0))

---------------------------------------------------------------------------
ValueError Traceback (most recent call last)

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backends/backend_wx.pyc
in _onKeyDown(self, evt)
    1254 key = self._get_key(evt)
    1255 evt.Skip()
-> 1256 FigureCanvasBase.key_press_event(self, key, guiEvent=evt)
    1257
    1258 def _onKeyUp(self, evt):

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backend_bases.pyc
in key_press_event(self, key, guiEvent)
    1525 s = 'key_press_event'
    1526 event = KeyEvent(s, self, key, self._lastx,
self._lasty, guiEvent=guiEvent)
-> 1527 self.callbacks.process(s, event)
    1528
    1529 def key_release_event(self, key, guiEvent=None):

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/cbook.pyc
in process(self, s, *args, **kwargs)
     260 del self.callbacks[s][cid]
     261 else:
--> 262 proxy(*args, **kwargs)
     263
     264

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/cbook.pyc
in __call__(self, *args, **kwargs)
     186 mtd = self.func
     187 # invoke the callable and return the result

--> 188 return mtd(*args, **kwargs)
     189
     190 def __eq__(self, other):

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backend_bases.pyc
in key_press(self, event)
    2254 elif scalex == 'linear':
    2255 ax.set_xscale('log')
-> 2256 ax.figure.canvas.draw()
    2257
    2258 elif (event.key.isdigit() and event.key!='0') or
event.key in all:

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backends/backend_wxagg.pyc
in draw(self, drawDC)
      57 """
      58 DEBUG_MSG("draw()", 1, self)
---> 59 FigureCanvasAgg.draw(self)
      60
      61 self.bitmap =
_convert_agg_to_wx_bitmap(self.get_renderer(), None)

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backends/backend_agg.pyc
in draw(self)
     392
     393 self.renderer = self.get_renderer()
--> 394 self.figure.draw(self.renderer)
     395
     396 def get_renderer(self):

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/artist.pyc
in draw_wrapper(artist, renderer, *args, **kwargs)
      53 def draw_wrapper(artist, renderer, *args, **kwargs):
      54 before(artist, renderer)
---> 55 draw(artist, renderer, *args, **kwargs)
      56 after(artist, renderer)
      57

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/figure.pyc
in draw(self, renderer)
     872 dsu.sort(key=itemgetter(0))
     873 for zorder, func, args in dsu:
--> 874 func(*args)
     875
     876 renderer.close_group('figure')

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/artist.pyc
in draw_wrapper(artist, renderer, *args, **kwargs)
      53 def draw_wrapper(artist, renderer, *args, **kwargs):
      54 before(artist, renderer)
---> 55 draw(artist, renderer, *args, **kwargs)
      56 after(artist, renderer)
      57

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/axes.pyc in
draw(self, renderer, inframe)
    1952
    1953 for zorder, a in dsu:
-> 1954 a.draw(renderer)
    1955
    1956 renderer.close_group('axes')

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/artist.pyc
in draw_wrapper(artist, renderer, *args, **kwargs)
      53 def draw_wrapper(artist, renderer, *args, **kwargs):
      54 before(artist, renderer)
---> 55 draw(artist, renderer, *args, **kwargs)
      56 after(artist, renderer)
      57

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/axis.pyc in
draw(self, renderer, *args, **kwargs)
     938 renderer.open_group(__name__)
     939 interval = self.get_view_interval()
--> 940 tick_tups = [ t for t in self.iter_ticks()]
     941 if self._smart_bounds:
     942 # handle inverted limits

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/axis.pyc in
iter_ticks(self)
     874 majorTicks = self.get_major_ticks(len(majorLocs))
     875 self.major.formatter.set_locs(majorLocs)
--> 876 majorLabels = [self.major.formatter(val, i) for i, val
in enumerate(majorLocs)]
     877
     878 minorLocs = self.minor.locator()

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/ticker.pyc
in __call__(self, x, pos)
     635 sign = np.sign(x)
     636 fx = math.log(abs(x))/math.log(b)
--> 637 isDecade = is_decade(fx)
     638
     639 usetex = rcParams['text.usetex']

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/ticker.pyc
in is_decade(x, base)
    1190 return True
    1191 lx = np.log(x)/np.log(base)
-> 1192 return abs(lx - nearest_long(lx))< 1e-10
    1193
    1194 class LogLocator(Locator):

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/ticker.pyc
in nearest_long(x)
    1184 if x == 0: return 0L
    1185 elif x> 0: return long(x+0.5)
-> 1186 else: return long(x-0.5)
    1187
    1188 def is_decade(x, base=10):

ValueError: cannot convert float NaN to integer

--
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA

Sorry I have forgotten to add that you should issue a "k" key on the
plot to scale the x-axis logarithmically.

···

On Tue, Oct 19, 2010 at 7:42 AM, Michael Droettboom <mdroe@...86...> wrote:

I can't reproduce this here with trunk, though I get a different crash
in the 1.x branch (which has an easy fix). Are there any additional
steps required to reproduce?

Mike

On 10/18/2010 09:50 PM, Gökhan Sever wrote:

Hello,

I can't log scale my axes on rev8753. It was working on a previous
check-out (possibly a month old). Using WXagg, but same as with
Qt4Agg.

Any ideas what could be wrong in the trunk? It seems to me that some
recent changes on LogLocator [
http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/matplotlib/ticker.py?view=log
]class causing this.

I[5]: d_um_pcasp_midpoint
O[5]:
array([ 0.124 , 0.1485, 0.179 , 0.2145, 0.2585, 0.333 , 0.5195,
0.7955, 1.15 , 1.7805, 2.437 , 2.7865, 3.187 , 3.991 ,
4.957 ])

I[6]: pcasp_spectral_density09d
O[6]:
array([ 523.31751809, 200.73229115, 179.82563138, 183.13125583,
160.62733458, 48.77147359, 22.23106603, 7.56501192,
10.94637257, 8.47475684, 21.53335341, 32.950845 ,
30.502102 , 28.90555459, 21.38636076])

I[7]: plt.plot(d_um_pcasp_midpoint, pcasp_spectral_density09d)
O[7]: [<matplotlib.lines.Line2D object at 0x14b2474c>]

I[8]: ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (554, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (555, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (555, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (555, 0))

---------------------------------------------------------------------------
ValueError Traceback (most recent call last)

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backends/backend_wx.pyc
in _onKeyDown(self, evt)
1254 key = self._get_key(evt)
1255 evt.Skip()
-> 1256 FigureCanvasBase.key_press_event(self, key, guiEvent=evt)
1257
1258 def _onKeyUp(self, evt):

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backend_bases.pyc
in key_press_event(self, key, guiEvent)
1525 s = 'key_press_event'
1526 event = KeyEvent(s, self, key, self._lastx,
self._lasty, guiEvent=guiEvent)
-> 1527 self.callbacks.process(s, event)
1528
1529 def key_release_event(self, key, guiEvent=None):

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/cbook.pyc
in process(self, s, *args, **kwargs)
260 del self.callbacks[s][cid]
261 else:
--> 262 proxy(*args, **kwargs)
263
264

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/cbook.pyc
in __call__(self, *args, **kwargs)
186 mtd = self.func
187 # invoke the callable and return the result

--> 188 return mtd(*args, **kwargs)
189
190 def __eq__(self, other):

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backend_bases.pyc
in key_press(self, event)
2254 elif scalex == 'linear':
2255 ax.set_xscale('log')
-> 2256 ax.figure.canvas.draw()
2257
2258 elif (event.key.isdigit() and event.key!='0') or
event.key in all:

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backends/backend_wxagg.pyc
in draw(self, drawDC)
57 """
58 DEBUG_MSG("draw()", 1, self)
---> 59 FigureCanvasAgg.draw(self)
60
61 self.bitmap =
_convert_agg_to_wx_bitmap(self.get_renderer(), None)

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backends/backend_agg.pyc
in draw(self)
392
393 self.renderer = self.get_renderer()
--> 394 self.figure.draw(self.renderer)
395
396 def get_renderer(self):

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/artist.pyc
in draw_wrapper(artist, renderer, *args, **kwargs)
53 def draw_wrapper(artist, renderer, *args, **kwargs):
54 before(artist, renderer)
---> 55 draw(artist, renderer, *args, **kwargs)
56 after(artist, renderer)
57

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/figure.pyc
in draw(self, renderer)
872 dsu.sort(key=itemgetter(0))
873 for zorder, func, args in dsu:
--> 874 func(*args)
875
876 renderer.close_group('figure')

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/artist.pyc
in draw_wrapper(artist, renderer, *args, **kwargs)
53 def draw_wrapper(artist, renderer, *args, **kwargs):
54 before(artist, renderer)
---> 55 draw(artist, renderer, *args, **kwargs)
56 after(artist, renderer)
57

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/axes.pyc in
draw(self, renderer, inframe)
1952
1953 for zorder, a in dsu:
-> 1954 a.draw(renderer)
1955
1956 renderer.close_group('axes')

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/artist.pyc
in draw_wrapper(artist, renderer, *args, **kwargs)
53 def draw_wrapper(artist, renderer, *args, **kwargs):
54 before(artist, renderer)
---> 55 draw(artist, renderer, *args, **kwargs)
56 after(artist, renderer)
57

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/axis.pyc in
draw(self, renderer, *args, **kwargs)
938 renderer.open_group(__name__)
939 interval = self.get_view_interval()
--> 940 tick_tups = [ t for t in self.iter_ticks()]
941 if self._smart_bounds:
942 # handle inverted limits

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/axis.pyc in
iter_ticks(self)
874 majorTicks = self.get_major_ticks(len(majorLocs))
875 self.major.formatter.set_locs(majorLocs)
--> 876 majorLabels = [self.major.formatter(val, i) for i, val
in enumerate(majorLocs)]
877
878 minorLocs = self.minor.locator()

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/ticker.pyc
in __call__(self, x, pos)
635 sign = np.sign(x)
636 fx = math.log(abs(x))/math.log(b)
--> 637 isDecade = is_decade(fx)
638
639 usetex = rcParams['text.usetex']

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/ticker.pyc
in is_decade(x, base)
1190 return True
1191 lx = np.log(x)/np.log(base)
-> 1192 return abs(lx - nearest_long(lx))< 1e-10
1193
1194 class LogLocator(Locator):

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/ticker.pyc
in nearest_long(x)
1184 if x == 0: return 0L
1185 elif x> 0: return long(x+0.5)
-> 1186 else: return long(x-0.5)
1187
1188 def is_decade(x, base=10):

ValueError: cannot convert float NaN to integer

--
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Gökhan

OK, I have just done an "svn up" and seen that this is fixed in
http://matplotlib.svn.sourceforge.net/viewvc/matplotlib?revision=8756&view=revision

Thanks for the fix.

···

On Tue, Oct 19, 2010 at 10:06 AM, Gökhan Sever <gokhansever@...287...> wrote:

Sorry I have forgotten to add that you should issue a "k" key on the
plot to scale the x-axis logarithmically.

On Tue, Oct 19, 2010 at 7:42 AM, Michael Droettboom <mdroe@...86...> wrote:

I can't reproduce this here with trunk, though I get a different crash
in the 1.x branch (which has an easy fix). Are there any additional
steps required to reproduce?

Mike

On 10/18/2010 09:50 PM, Gökhan Sever wrote:

Hello,

I can't log scale my axes on rev8753. It was working on a previous
check-out (possibly a month old). Using WXagg, but same as with
Qt4Agg.

Any ideas what could be wrong in the trunk? It seems to me that some
recent changes on LogLocator [
http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/matplotlib/ticker.py?view=log
]class causing this.

I[5]: d_um_pcasp_midpoint
O[5]:
array([ 0.124 , 0.1485, 0.179 , 0.2145, 0.2585, 0.333 , 0.5195,
0.7955, 1.15 , 1.7805, 2.437 , 2.7865, 3.187 , 3.991 ,
4.957 ])

I[6]: pcasp_spectral_density09d
O[6]:
array([ 523.31751809, 200.73229115, 179.82563138, 183.13125583,
160.62733458, 48.77147359, 22.23106603, 7.56501192,
10.94637257, 8.47475684, 21.53335341, 32.950845 ,
30.502102 , 28.90555459, 21.38636076])

I[7]: plt.plot(d_um_pcasp_midpoint, pcasp_spectral_density09d)
O[7]: [<matplotlib.lines.Line2D object at 0x14b2474c>]

I[8]: ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (554, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (555, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (555, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (555, 0))

---------------------------------------------------------------------------
ValueError Traceback (most recent call last)

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backends/backend_wx.pyc
in _onKeyDown(self, evt)
1254 key = self._get_key(evt)
1255 evt.Skip()
-> 1256 FigureCanvasBase.key_press_event(self, key, guiEvent=evt)
1257
1258 def _onKeyUp(self, evt):

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backend_bases.pyc
in key_press_event(self, key, guiEvent)
1525 s = 'key_press_event'
1526 event = KeyEvent(s, self, key, self._lastx,
self._lasty, guiEvent=guiEvent)
-> 1527 self.callbacks.process(s, event)
1528
1529 def key_release_event(self, key, guiEvent=None):

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/cbook.pyc
in process(self, s, *args, **kwargs)
260 del self.callbacks[s][cid]
261 else:
--> 262 proxy(*args, **kwargs)
263
264

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/cbook.pyc
in __call__(self, *args, **kwargs)
186 mtd = self.func
187 # invoke the callable and return the result

--> 188 return mtd(*args, **kwargs)
189
190 def __eq__(self, other):

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backend_bases.pyc
in key_press(self, event)
2254 elif scalex == 'linear':
2255 ax.set_xscale('log')
-> 2256 ax.figure.canvas.draw()
2257
2258 elif (event.key.isdigit() and event.key!='0') or
event.key in all:

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backends/backend_wxagg.pyc
in draw(self, drawDC)
57 """
58 DEBUG_MSG("draw()", 1, self)
---> 59 FigureCanvasAgg.draw(self)
60
61 self.bitmap =
_convert_agg_to_wx_bitmap(self.get_renderer(), None)

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/backends/backend_agg.pyc
in draw(self)
392
393 self.renderer = self.get_renderer()
--> 394 self.figure.draw(self.renderer)
395
396 def get_renderer(self):

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/artist.pyc
in draw_wrapper(artist, renderer, *args, **kwargs)
53 def draw_wrapper(artist, renderer, *args, **kwargs):
54 before(artist, renderer)
---> 55 draw(artist, renderer, *args, **kwargs)
56 after(artist, renderer)
57

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/figure.pyc
in draw(self, renderer)
872 dsu.sort(key=itemgetter(0))
873 for zorder, func, args in dsu:
--> 874 func(*args)
875
876 renderer.close_group('figure')

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/artist.pyc
in draw_wrapper(artist, renderer, *args, **kwargs)
53 def draw_wrapper(artist, renderer, *args, **kwargs):
54 before(artist, renderer)
---> 55 draw(artist, renderer, *args, **kwargs)
56 after(artist, renderer)
57

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/axes.pyc in
draw(self, renderer, inframe)
1952
1953 for zorder, a in dsu:
-> 1954 a.draw(renderer)
1955
1956 renderer.close_group('axes')

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/artist.pyc
in draw_wrapper(artist, renderer, *args, **kwargs)
53 def draw_wrapper(artist, renderer, *args, **kwargs):
54 before(artist, renderer)
---> 55 draw(artist, renderer, *args, **kwargs)
56 after(artist, renderer)
57

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/axis.pyc in
draw(self, renderer, *args, **kwargs)
938 renderer.open_group(__name__)
939 interval = self.get_view_interval()
--> 940 tick_tups = [ t for t in self.iter_ticks()]
941 if self._smart_bounds:
942 # handle inverted limits

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/axis.pyc in
iter_ticks(self)
874 majorTicks = self.get_major_ticks(len(majorLocs))
875 self.major.formatter.set_locs(majorLocs)
--> 876 majorLabels = [self.major.formatter(val, i) for i, val
in enumerate(majorLocs)]
877
878 minorLocs = self.minor.locator()

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/ticker.pyc
in __call__(self, x, pos)
635 sign = np.sign(x)
636 fx = math.log(abs(x))/math.log(b)
--> 637 isDecade = is_decade(fx)
638
639 usetex = rcParams['text.usetex']

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/ticker.pyc
in is_decade(x, base)
1190 return True
1191 lx = np.log(x)/np.log(base)
-> 1192 return abs(lx - nearest_long(lx))< 1e-10
1193
1194 class LogLocator(Locator):

/home/gsever/Desktop/python-repo/matplotlib/lib/matplotlib/ticker.pyc
in nearest_long(x)
1184 if x == 0: return 0L
1185 elif x> 0: return long(x+0.5)
-> 1186 else: return long(x-0.5)
1187
1188 def is_decade(x, base=10):

ValueError: cannot convert float NaN to integer

--
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Gökhan

--
Gökhan