Closed akazachk closed 4 years ago
I can't replicate your problem on my machine.
It looks like a problem on the Python side. Does it work in Python? That is, try running MPLBACKEND=qt5agg /Users/username/.julia/conda/3/bin/python
and then
import matplotlib.pyplot as plt
plt.rc('savefig', bbox='tight')
fig = plt.figure(frameon=False)
plt.title('Test')
plt.savefig("test.png")
plt.close()
PS. This is an exception, not a crash.
You are correct, it seems to be a problem with the way Python is set up with Julia, but I am having a hard time figuring out a solution. Namely, my system-wide Python3 installation runs the code without issues. However, when using /Users/username/.julia/conda/3/bin/python
as you instructed, the exception is encountered.
Maybe something is wrong in my installation steps? I do have XQuartz 2.7.11 installed. The following is what I used to install PyPlot.
using Pkg
ENV["MPLBACKEND"]="Qt5Agg"
ENV["PYTHON"]=""
Pkg.add("PyCall")
Pkg.add("PyPlot")
using PyCall
using PyPlot
I fixed this error by removing my .julia
directory, I guess causing Julia (the next time I ran the above code) to reinstall conda/Python and whatever setting I had that caused the above exception.
I am encountering a possible bug when running the following code using Julia 1.1.1 on OSX 10.14.5. Without the line
rc("savefig", bbox="tight")
, there is no issue.The error I get is below: