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() 

enter image description here 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.

github issue 4786


Comments

Popular posts from this blog

apache - setting document root in antoher partition on ubuntu -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -

php - laravel retrieving profile firstname from model returns Object of class Illuminate\Database\Eloquent\Builder could not be converted to string -