-
Notifications
You must be signed in to change notification settings - Fork 89
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
clearer error message for default MacOS matplotlib #103
Comments
Works fine for me in both Julia 0.3 and Julia 0.4 on MacOS. Can you try |
I've just tried re-compiling julia on the
|
My suggestion was to check out the |
So I re-installed Julia (using the latest stable pre-compiled binary for OS X), installed the PyCall and PyPlot packages then checked out the master versions using ERROR: pltm not defined I should also add that when I importing the PyPlot module with |
Ok so I managed to get rid of the errors by installing qt with |
What happens if you do
? |
(BTW, I tend to recommend Anaconda Python rather than Homebrew; I've found Homebrew to be rather fragile for Python packages.) |
I got it working like this:
|
Thanks a lot, just a quick question. Is there a way to select the plot window after it's been generated? If I focus on another application then I cannot cmd-tab to the plot window unless I click and drag other windows out of the way. Sometime I lose the window and have to restart julia. |
@trbedwards, You'd ideally like to get PyPlot working in order to get interactive plots (so that you don't need Unfortunately, the Matplotlib that ships with MacOS doesn't have a working Qt or Tk backend as far as I can tell, so you need to install a different Matplotlib to use the PyPlot module. I recommend installing Anaconda Python (which will give you Matplotlib, SciPy, etc.). |
Actually, I looked into this further, and it seems that the Tk backend does work with the built-in Matplotlib in MacOS, but it requires that you install XQuartz. So, just install XQuartz and PyPlot should work. Re-opening since we should really have a clearer error message for this. |
I should mention that I have XQuartz installed and still encounter the error if I use the Tk backend via
rather than
|
What is the exact, full error output that you get with the Tk backend in this case? |
After typing this:
I get
Then when I try to plot something:
I get this:
|
What is the output if you do: using PyCall
matplotlib = pyimport("matplotlib")
matplotlib[:use]("tkagg")
pltm = pyimport("matplotlib.pyplot") and what is the output of |
Note also that if you upgraded MacOS since you installed XQuartz, you may need to re-install XQuartz. (I've noticed that many MacOS upgrades tend to blow away part of the XQuartz installation.) |
The output after the last command of
is
The output of
|
I've imported the PyPlot module like so:
using PyCall
pygui(:tk)
using PyPlot
I then try to use the plot function:
x=1:10; y=sin(x);
plot(x,y)
But I get this error:
pltm not defined
while loading In[14], in expression starting on line 1
in abstract_eval_global at ./inference.jl:1027
in abstract_eval_symbol at ./inference.jl:1066
in abstract_eval at ./inference.jl:919
in abstract_eval_arg at ./inference.jl:866
in abstract_eval_call at ./inference.jl:878
in abstract_eval at ./inference.jl:935
in abstract_eval_arg at ./inference.jl:866
in abstract_eval_call at ./inference.jl:878
in abstract_eval at ./inference.jl:935
in abstract_interpret at ./inference.jl:1107
in typeinf at ./inference.jl:1409
in typeinf at /Users/tre11/git/julia/usr/lib/julia/sys.dylib
in typeinf_ext at ./inference.jl:1216
This is in the latest stable version of Julia 0.3.4-pre+8, and latest stable versions of python, ipython, matpplotlib, etc.
The text was updated successfully, but these errors were encountered: