使用 PyPlot 的 Julia 错误 - 信号 (11):分段错误 [英] Julia error using PyPlot - signal (11): Segmentation fault

查看:19
本文介绍了使用 PyPlot 的 Julia 错误 - 信号 (11):分段错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

学习使用 PyPlot 和 Julia 编程语言(版本 0.4.5),我在尝试生成简单绘图时遇到错误:

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?

推荐答案

0.4.6 上运行时,我无法重现您的错误.我的想法是:

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

  1. 更新到最新版本.
  2. 更新您的所有软件包
  3. 退出并重新启动 julia
  4. 如果这些都不起作用,那么可以想象 plot 函数不喜欢参数类型的不匹配.因此,您可以应用 collect(x) 以便 xy 都是 Array 类型.
  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.

这篇关于使用 PyPlot 的 Julia 错误 - 信号 (11):分段错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆