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 !
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_