On 2013/06/06 2:08 AM, Julien Cornebise wrote:
> Dear all
>
> I am puzzled: in the following code, when I call clim() *after* having
> created 3 subplots, only the last subplot takes the new limits into
> account. All other subplots ignore it. Xlim(), on the countrary, works
> as intended. Everything works fine when I set the clim()  at creation time.
>
> Am I doing something wrong, or is this a bug, please ? Any help much
> appreciated !

It's a bug.  Would you report it as an issue on github, please?  (You 
could wait 24 hours; if I come up with a PR for fix before then there 
will be no need for the issue report.)

Eric


> The offending code is below.  I use python 2.7.5
> andmatplotlib-1.3.x-py2.7-macosx-10.8-intel.egg
>
> Thanks for any help!
>
> __BEGIN_SOURCE___
>
> import matplotlib.pyplot as plt
> import numpy as np
>
> x = np.asarray([[1, 100, 20], [50, 1, 20], [20, 10, 5]])
>
> # Problem when setting clim *after* having created the two subplots:
> # only the last subplot honors the request
>
> # 1. Create the pcolormeshes in subplots
> h = plt.figure()
> for i in range(131, 134):
>      plt.subplot(i)
>      plt.pcolormesh(x)
>      plt.colorbar()
> print(h.number)
>
> # 2. Now set the clim()
> plt.figure(h.number)
> for i in range(131, 134):
>      plt.subplot(i)
>      plt.clim((5,10))
>      plt.xlim((2,3))
>
> plt.savefig('after_creation.png')
> plt.show()
>
> # No problem when setting clim *while* creating each subplot
> h = plt.figure()
> for i in range(131, 134):
>      plt.subplot(i)
>      plt.pcolormesh(x)
>      plt.colorbar()
>      plt.clim((5,10))
>      plt.xlim((2,3))
>
> plt.savefig('while_creating.png')
> plt.show()
>
> __END_SOURCE___
>
>
> ------------------------------------------------------------------------------
> How ServiceNow helps IT people transform IT departments:
> 1. A cloud service to automate IT design, transition and operations
> 2. Dashboards that offer high-level views of enterprise services
> 3. A single system of record for all IT processes
> http://p.sf.net/sfu/servicenow-d2d-j
>
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>


------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to