JuliaPy / PyPlot.jl

Plotting for Julia based on matplotlib.pyplot
https://github.com/JuliaPy/PyPlot.jl
MIT License
475 stars 87 forks source link

PyPlot crashing #440

Closed harshangrjn closed 4 years ago

harshangrjn commented 5 years ago

In Julia v1.1 and Python 2.7.13:

Julia crashes when I try to get a simple plot given below.

    using PyPlot
    x = range(0,stop=2*pi,length=100); y = sin.(3*x + 4*cos.(2*x))
    plot(x, y, color="red", linewidth=2.0)

Any fix suggestions?

stevengj commented 5 years ago

Works for me.

If you are using an MKL build of Julia with an MKL Numpy, it will crash because of JuliaPy/PyCall.jl#443 … you have to use the OpenBLAS Julia build.

stevengj commented 5 years ago

(Did you get a warning message both Julia and NumPy are linked with MKL, which may cause conflicts and crashes?)

harshangrjn commented 4 years ago

Sorry for the delay! No -I get this error message now in Julia 1.3.1. Any suggestions for this issue?

2020-01-24 13:27:29.485 julia[3811:183044] -[NSApplication _setup:]: unrecognized selector sent to instance 0x7ff2f9525d60
2020-01-24 13:27:29.486 julia[3811:183044] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSApplication _setup:]: unrecognized selector sent to instance 0x7ff2f9525d60'
*** First throw call stack:
(
)
libc++abi.dylib: terminating with uncaught exception of type NSException

signal (6): Abort trap: 6
in expression starting at /Users/harsha/Dropbox/LANL_research/Julia_codes/Test_files/test_pyplot.jl:3
__pthread_kill at /usr/lib/system/libsystem_kernel.dylib (unknown line)
Allocations: 21472727 (Pool: 21467607; Big: 5120); GC: 21
[1]    3811 abort      /Applications/Julia-1.3.app/Contents/Resources/julia/bin/julia
stevengj commented 4 years ago

Duplicate of #410: probably you have a .matplotlibrc or something that is setting the backend to tkagg, and unfortunately Matplotlib's tkagg backend is buggy on MacOS.