首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >UndefVarError:未在朱莉娅中定义的直方图

UndefVarError:未在朱莉娅中定义的直方图
EN

Stack Overflow用户
提问于 2021-11-30 06:24:41
回答 1查看 355关注 0票数 2

我正试图绘制如下直方图:

代码语言:javascript
复制
using Plots; using PyPlot
pyplot() # Plots.PyPlotBackend()
x = 0:100;
result = rand(x,2000);
histogram(result)

但是,它返回UndefVarError:

代码语言:javascript
复制
UndefVarError: histogram not defined

Stacktrace:
 [1] top-level scope
   @ In[156]:5
 [2] eval
   @ .\boot.jl:360 [inlined]
 [3] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
   @ Base .\loading.jl:1116

我跟踪了用Julia绘制直方图,但返回了错误。

如何解决错误?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-12-04 14:27:22

我无法在朱莉娅1.6.3中重新产生这个错误。当我跑步时:

代码语言:javascript
复制
julia> using Plots; using PyPlot

julia> pyplot() # Plots.PyPlotBackend()
Plots.PyPlotBackend()

julia> x = 0:100;

julia> result = rand(x,2000);

julia> histogram(result)

我得到:

没有任何错误。对于我来说,这也可以不运行using PyPlot

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70165162

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档