Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Julia error using PyPlot - signal (11): Segmentation fault

Tags:

julia

Learning to use PyPlot with Julia programming language (Version 0.4.5), I've encountered an error while trying to produce a simple plot:

julia> using PyPlot

julia> x = linspace(0,100,1000)
linspace(0.0,100.0,1000)

julia> y = x.^2;

julia> plot(x,y)

signal (11): Segmentation fault
unknown function (ip: 0x32736)
Segmentation fault (core dumped)

Someone knows what's going on here?

like image 249
Ohm Avatar asked Jul 20 '16 08:07

Ohm


1 Answers

I can't reproduce your error when running on 0.4.6. My thoughts would be:

  1. Update to latest version.
  2. Update all your packages
  3. Quit and restart julia
  4. If none of those work, it's conceivable perhaps that the plot function doesn't like the mismatch of argument types. Thus, you could apply collect(x) so that both x and y are of type Array.
like image 121
Michael Ohlrogge Avatar answered Oct 03 '22 11:10

Michael Ohlrogge