New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undesired plot outputs in Notebook inline mode #2488
Comments
This is precisely the behavior I have always experienced in the notebook, so let's try to narrow down what it is about your environment that is causing this:
|
Note that your plot function must be sympys plotting command from the sympy.plotting module. This is the only one accepting a sympy function and also the only one taking a ylim kwarg. Doing what @MinKR suggests using the mpl plot command I only see one figure. I guess what happens is that calling grid from matplotlib creates a figure when called as the first command, after that the sympy plot command also creates a new figure. Running the same code in the qtconsole with% pylab qt I also see to figures. In addition running the code in Interchanging the two commands I also get two plots in both the qtconsole and the notebook. |
Thanks for the clarification @jenshnielsen, closing as 'not an IPython issue'. |
OK, so this is a namespace clobber that is not immediately apparent to the On Sun, Oct 14, 2012 at 8:05 AM, Min RK notifications@github.com wrote:
|
There might still be some kind of bug since the following works in the qtconsole but produces two plots in the notebook x = symbols("x")
plt.clf()
f = ln(1 + x)
y1 = f(x)
y2 = f.series().removeO()(x)
plot(y1,y2,ylim=(-5.0,5.0))
plt.gca().grid(True) |
I think the namespace issue is really a sympy issue. Perhaps the sympy profile should rather do A related bug is #2035 where importing sympy is importing matplotlib.pyplot and thus choses the default backend for mpl |
I raised the namespace issue with the sympy devs: http://code.google.com/p/sympy/issues/detail?id=3439 |
Is it expected behavior that |
Configuration:
Example Code:
Output:
Issue:
In fact, if I call
plot(...)
more than once, as in the normal usage paradigm, it should manipulate the same plot, but it outputs more than one plot at a time.The text was updated successfully, but these errors were encountered: