|
From: Mike K. <mc...@gm...> - 2011-02-08 02:14:07
|
On 2/7/11 9:02 PM, Benjamin Root wrote:
> On Mon, Feb 7, 2011 at 7:20 PM, Mike Kaufman <mc...@gm...
> <mailto:mc...@gm...>> wrote:
>
>
> using a recent svn (r8900), I've noticed that after starting from a
> regular python shell:
>
> >>> import matplotlib.pyplot as plt
> >>> plt.isinteractive()
> False
> >>> plt.plot([1,2,3],[1,3,2])
> [<matplotlib.lines.Line2D object at 0x114e7a090>]
> >>> plt.plot([1,2,3],[1,2,3])
> [<matplotlib.lines.Line2D object at 0x114e7a590>]
> # plt.draw() is not required, the figure pops up
> # and both plots are shown
> >>> plt.xlim(1,2)
> (1, 2)
> # again this works immediately no draw() required
> >>> plt.xlabel('aaa')
> <matplotlib.text.Text object at 0x1033a2290>
> # ditto, no draw() required
>
> but if the axes methods are used, then interactive status is honored:
>
> >>> plt.gca().set_xlabel('bbb')
> <matplotlib.text.Text object at 0x1033a2290>
> >>> plt.gca().plot([1,2,3],[3,2,1])
> [<matplotlib.lines.Line2D object at 0x114e7cf90>]
> >>> plt.gca().set_xlim(1,3)
> (1, 3)
> # all these require a plt.draw() to show up...
>
> I think that this is a misfeature, but maybe this is desired behavior?
>
> M
>
>
> Which backend are you using and using which OS?
Good question. Snow Leopard and the MacOSX backend. If I use the Gtk
backend this bug does _not_ occur (though I have to use the plt.show()
command to bring up the window --- which hangs the shell...)
M
|