python - Matplotlib add_subplot & change_geometry bug? -
i building pyqt4 gui embedded matplotlib (1.4.3). lets user select list of available parameters plot & gives them control add/remove, rescale subplots etc. send data to. anyway, came across behavior of add_subplot followed change_geometry didn't expect.
make subplot in 2,1,2 position:
import numpy np import matplotlib.pyplot plt x = np.arange(0, 10, 0.1) y1 = 0.05 * x**2 y2 = -1 *y1 figure = plt.figure() ax1 = figure.add_subplot(2,1,2,label='sub2') ax1.plot(x, y1, 'g-') plt.show() that mistake lets change subplot #1 , relabel
ax1.change_geometry(2,1,1) ax1.set_label('sub1') ok, lets add subplot 2 real time...
ax2 = figure.add_subplot(2,1,2,label='sub2') ax2.plot(x, y2, 'b-') plt.draw()
wait minute plotted on subplot 1 ... , subplot 2? lets @ ax1, , ax2
ax1 <matplotlib.axes._subplots.axessubplot @ 0xcaa32b0> ax2 <matplotlib.axes._subplots.axessubplot @ 0xcaa32b0> they same axes? after digging came across this github issue 429 , says fixed ... doesn't me. missing or still issue?
i create issue on github. confirmed , added next point release milestone.
Comments
Post a Comment