Added support for inline graphics (IJulia)

This commit is contained in:
Josef Heinen 2016-01-07 11:37:04 +01:00
parent ca866183f1
commit 003d39c8cd

View File

@ -166,6 +166,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")
d = Dict(kw) d = Dict(kw)
Plot(nothing, pkg, 0, d, Dict[]) Plot(nothing, pkg, 0, d, Dict[])
end end
@ -236,9 +237,10 @@ end
# ---------------------------------------------------------------- # ----------------------------------------------------------------
function Base.writemime(io::IO, ::MIME"image/png", plt::PlottingObject{GRPackage}) function Base.writemime(io::IO, m::MIME"image/png", plt::PlottingObject{GRPackage})
isijulia() && return gr_display(plt)
println("TODO: write a png to io") GR.emergencyclosegks()
write(io, readall("gks.png"))
end end
function Base.display(::PlotsDisplay, plt::Plot{GRPackage}) function Base.display(::PlotsDisplay, plt::Plot{GRPackage})