Use SVG output for inline graphics (IJulia)
This commit is contained in:
parent
14b856b0cf
commit
11e5c0aa9d
@ -351,7 +351,7 @@ function gr_display(plt::Plot{GRPackage})
|
|||||||
end
|
end
|
||||||
|
|
||||||
function _create_plot(pkg::GRPackage; kw...)
|
function _create_plot(pkg::GRPackage; kw...)
|
||||||
isijulia() && GR.inline("png")
|
isijulia() && GR.inline("svg")
|
||||||
d = Dict(kw)
|
d = Dict(kw)
|
||||||
Plot(nothing, pkg, 0, d, Dict[])
|
Plot(nothing, pkg, 0, d, Dict[])
|
||||||
end
|
end
|
||||||
@ -422,12 +422,20 @@ end
|
|||||||
# ----------------------------------------------------------------
|
# ----------------------------------------------------------------
|
||||||
|
|
||||||
function Base.writemime(io::IO, m::MIME"image/png", plt::PlottingObject{GRPackage})
|
function Base.writemime(io::IO, m::MIME"image/png", plt::PlottingObject{GRPackage})
|
||||||
isijulia() || return
|
ENV["GKS_WSTYPE"] = "png"
|
||||||
gr_display(plt)
|
gr_display(plt)
|
||||||
GR.emergencyclosegks()
|
GR.emergencyclosegks()
|
||||||
write(io, readall("gks.png"))
|
write(io, readall("gks.png"))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Base.writemime(io::IO, m::MIME"image/svg+xml", plt::PlottingObject{GRPackage})
|
||||||
|
isijulia() || return
|
||||||
|
ENV["GKS_WSTYPE"] = "svg"
|
||||||
|
gr_display(plt)
|
||||||
|
GR.emergencyclosegks()
|
||||||
|
write(io, readall("gks.svg"))
|
||||||
|
end
|
||||||
|
|
||||||
function Base.display(::PlotsDisplay, plt::Plot{GRPackage})
|
function Base.display(::PlotsDisplay, plt::Plot{GRPackage})
|
||||||
gr_display(plt)
|
gr_display(plt)
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user