我正试图绘制如下直方图:
using Plots; using PyPlot
pyplot() # Plots.PyPlotBackend()
x = 0:100;
result = rand(x,2000);
histogram(result)但是,它返回UndefVarError:
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绘制直方图,但返回了错误。
如何解决错误?
发布于 2021-12-04 14:27:22
我无法在朱莉娅1.6.3中重新产生这个错误。当我跑步时:
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。
https://stackoverflow.com/questions/70165162
复制相似问题