Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Julia Plots.jl中具有对数y轴的直方图_Julia_Plots.jl - Fatal编程技术网

Julia Plots.jl中具有对数y轴的直方图

Julia Plots.jl中具有对数y轴的直方图,julia,plots.jl,Julia,Plots.jl,我尝试了以下方法: using Plots.jl; gr() histogram(randn(1000),yaxis=(:log10)) 它会产生以下错误 Error showing value of type Plots.Plot{Plots.GRBackend}: ERROR: At least one finite value must be provided to formatter. in showoff(::Array{Float64,1}, ::Symbol) at /User

我尝试了以下方法:

using Plots.jl; gr()
histogram(randn(1000),yaxis=(:log10))
它会产生以下错误

Error showing value of type Plots.Plot{Plots.GRBackend}:
ERROR: At least one finite value must be provided to formatter.
 in showoff(::Array{Float64,1}, ::Symbol) at /Users/ianmarshall/.julia/v0.5/Showoff/src/Showoff.jl:120
 in optimal_ticks_and_labels(::Plots.Axis, ::Void) at /Users/ianmarshall/.julia/v0.5/Plots/src/axes.jl:176
 in get_ticks(::Plots.Axis) at /Users/ianmarshall/.julia/v0.5/Plots/src/axes.jl:204
 in axis_drawing_info(::Plots.Subplot{Plots.GRBackend}) at /Users/ianmarshall/.julia/v0.5/Plots/src/axes.jl:452
 in gr_display(::Plots.Subplot{Plots.GRBackend}, ::Measures.Length{:mm,Float64}, ::Measures.Length{:mm,Float64}, ::Array{Float64,1}) at /Users/ianmarshall/.julia/v0.5/Plots/src/backends/gr.jl:570
 in gr_display(::Plots.Plot{Plots.GRBackend}) at /Users/ianmarshall/.julia/v0.5/Plots/src/backends/gr.jl:457
 in _display(::Plots.Plot{Plots.GRBackend}) at /Users/ianmarshall/.julia/v0.5/Plots/src/backends/gr.jl:1004
 in display(::Base.REPL.REPLDisplay{Base.REPL.LineEditREPL}, ::MIME{Symbol("text/plain")}, ::Plots.Plot{Plots.GRBackend}) at /Users/ianmarshall/.julia/v0.5/Plots/src/output.jl:120
 in display(::Base.REPL.REPLDisplay{Base.REPL.LineEditREPL}, ::Plots.Plot{Plots.GRBackend}) at ./REPL.jl:135
 in display(::Plots.Plot{Plots.GRBackend}) at ./multimedia.jl:143
 in print_response(::Base.Terminals.TTYTerminal, ::Any, ::Void, ::Bool, ::Bool, ::Void) at ./REPL.jl:154
 in print_response(::Base.REPL.LineEditREPL, ::Any, ::Void, ::Bool, ::Bool) at ./REPL.jl:139
 in (::Base.REPL.##22#23{Bool,Base.REPL.##33#42{Base.REPL.LineEditREPL,Base.REPL.REPLHistoryProvider},Base.REPL.LineEditREPL,Base.LineEdit.Prompt})(::Base.LineEdit.MIState, ::Base.AbstractIOBuffer{Array{UInt8,1}}, ::Bool) at ./REPL.jl:652
 in run_interface(::Base.Terminals.TTYTerminal, ::Base.LineEdit.ModalInterface) at ./LineEdit.jl:1579
 in run_interface(::Base.Terminals.TTYTerminal, ::Base.LineEdit.ModalInterface) at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?
 in run_frontend(::Base.REPL.LineEditREPL, ::Base.REPL.REPLBackendRef) at ./REPL.jl:903
 in run_repl(::Base.REPL.LineEditREPL, ::Base.##930#931) at ./REPL.jl:188
 in _start() at ./client.jl:360
 in _start() at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?

如何使用Plots.jl生成具有对数轴的直方图?我在MacOS 10.11.6上使用Julia版本0.5.0-rc3+0,Plots.jl版本0.9.1。

问题是轴范围变为零,即日志空间中的-Inf。有几种方法可以解决此问题,最简单的方法可能是在轴上强制设置下限:

using Plots; gr()
histogram(randn(1000), yaxis = (:log10, (1,Inf)))

从图0.11开始,问题代码起作用

using Plots
histogram(randn(1000),yaxis=(:log10))

这在0.11图中已修复-问题中的代码将立即生效。