朱莉娅中的PlotlyJS:保存图片失败

时间:2019-06-06 13:15:22

标签: julia plotly.js

当我尝试以下代码时,我希望结果以.eps的格式保存,但是会出现错误:

using DataFrames
using PlotlyJS
using ORCA

a = [1,2,3,4,5]
b = [2,1,5,4,3]
df = DataFrame(A = a,B = b)

data = scatter(df,x =:x,y=:B)
l = Layout(title="Penguins",xaxis_range=[0, 4], xaxis_title="fish",
            yaxis_title="Weight",xaxis_showgrid=false, yaxis_showgrid=false)
p = plot(data,l)
savefig(p, "1.eps")

错误内容是:

LoadError: image conversion error
in expression starting at F:\test.jl:14
error(::String) at error.jl:33
#savefig#1(::SubString{String}, ::Nothing, ::Nothing, ::Nothing, ::Function, ::IOStream, ::Plot{GenericTrace{Dict{Symbol,Any}}}) at ORCA.jl:45
(::getfield(PlotlyBase, Symbol("#kw##savefig")))(::NamedTuple{(:format, :scale, :width, :height),Tuple{SubString{String},Nothing,Nothing,Nothing}}, ::typeof(savefig), ::IOStream, ::Plot{GenericTrace{Dict{Symbol,Any}}}) at none:0
(::getfield(ORCA, Symbol("##3#4")){Nothing,Nothing,Nothing,Plot{GenericTrace{Dict{Symbol,Any}}}})(::IOStream) at ORCA.jl:71
#open#310(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::getfield(ORCA, Symbol("##3#4")){Nothing,Nothing,Nothing,Plot{GenericTrace{Dict{Symbol,Any}}}}, ::String, ::Vararg{String,N} where N) at iostream.jl:375
open at iostream.jl:373 [inlined]
#savefig#2 at ORCA.jl:70 [inlined]
savefig(::Plot{GenericTrace{Dict{Symbol,Any}}}, ::String) at ORCA.jl:65
#savefig#50(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::PlotlyJS.SyncPlot, ::String) at savefig_orca.jl:1
savefig(::PlotlyJS.SyncPlot, ::String) at savefig_orca.jl:1
top-level scope at none:0

但是它可以成功保存到pngpdf中:

savefig(p, "1.png")
or
savefig(p, "1.pdf")

请问该如何解决?

julia> versioninfo()
Julia Version 1.1.1
Commit 55e36cc308 (2019-05-16 04:10 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i5-3337U CPU @ 1.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, ivybridge)
Environment:
  JULIA_EDITOR = "C:\Users\huoze\AppData\Local\atom\app-1.38.0-beta0\atom.exe"  -a
  JULIA_NUM_THREADS = 2

0 个答案:

没有答案