Closed marius311 closed 4 years ago
Actually, looks like just flipping the order solves it:
from julia.PyPlot import plot
%matplotlib inline
plot([1,2,3])
Given this is totally satisfactory for me and this is otherwise probably such an edge case, I'm just going to close this issue, unless anyone else feels strongly it needs to be fixed.
I wasn't sure whether to file here or in pyjulia, please feel free to transfer if this was the wrong choice.
Basically, from a fresh Python Jupyter kernel if I execute the following (each line in a separate cell):
then no inline plot is shown. I have to execute
%matplotlib inline
one more time before inline plots start showing. This does not happen if I replacefrom julia.PyPlot import plot
withfrom matplotlib.pyplot import plot
, not does it happen when plotting from a Julia kernel.I have Julia 1.4, pyjulia 0.5.0, matplotlib 3.1.1, IJulia v1.21.1, PyPlot v2.8.2.
I found these Issues which seem could be related:
https://github.com/jupyter/notebook/issues/3691 https://github.com/ipython/ipython/pull/11916
If you're wondering why I'm not calling Python
plot
directly, its because Julia's version ofplot
can be (and is, in my case) specialized on the argument types. Interactively its no big deal to run it twice, but this is happening in some automatic documentation generation, where its slightly ugly to have the%matplotlib
magic in there twice to make this work.