Merge pull request #334 from jheinen/dev

conserve user defined GR workstation type
This commit is contained in:
Tom Breloff 2016-06-14 13:31:40 -04:00 committed by GitHub
commit a7493504ed

View File

@ -895,11 +895,12 @@ const _gr_mimeformats = Dict(
for (mime, fmt) in _gr_mimeformats
@eval function _writemime(io::IO, ::MIME{Symbol($mime)}, plt::Plot{GRBackend})
GR.emergencyclosegks()
wstype = haskey(ENV, "GKS_WSTYPE") ? ENV["GKS_WSTYPE"] : "0"
ENV["GKS_WSTYPE"] = $fmt
gr_display(plt)
GR.emergencyclosegks()
write(io, readall("gks." * $fmt))
ENV["GKS_WSTYPE"] = ""
ENV["GKS_WSTYPE"] = wstype
end
end