Jouni,
thanks for your reply.
I could test that
plot([1,2,3],[1,2,3])
setp(gca(), 'xlim', (3.0,1.0))
works,
but
setp(gca(), 'xlim', reversed(getp(gca(), 'xlim')))
gives me an error :
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/home/cohen/<ipython console> in <module>()
/usr/lib/python2.5/site-packages/matplotlib/pylab.py in setp(*args,
**kwargs)
1386
1387 def setp(*args, **kwargs):
-> 1388 ret = _setp(*args, **kwargs)
1389 draw_if_interactive()
1390 return ret
/usr/lib/python2.5/site-packages/matplotlib/artist.py in setp(h, *args,
**kwargs)
704 funcName = "set_%s"%s
705 func = getattr(o,funcName)
--> 706 ret.extend( [func(val)] )
707 return [x for x in flatten(ret)]
708
/usr/lib/python2.5/site-packages/matplotlib/axes.py in set_xlim(self,
xmin, xmax, emit, **kwargs)
1543 raise ValueError('Cannot set nonpositive limits with
log transform')
1544
-> 1545 xmin, xmax = mtrans.nonsingular(xmin, xmax,
increasing=False)
1546 self.viewLim.intervalx().set_bounds(xmin, xmax)
1547 if emit: self.callbacks.process('xlim_changed', self)
/usr/lib/python2.5/site-packages/matplotlib/transforms.py in
nonsingular(vmin, vmax, expander, tiny, increasing)
272 vmin, vmax = vmax, vmin
273 swapped = True
--> 274 if vmax - vmin <= max(abs(vmin), abs(vmax)) * tiny:
275 if vmin==0.0:
276 vmin = -expander
TypeError: unsupported operand type(s) for -: 'reversed' and 'float'
I guess that the issue is that reversed returns the reversed iterator on
the sequnce, not the reversed sequence itself.
Best,
Johann
-------------------------------------------------------------------------
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-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users