added closeall for gr/pyplot

This commit is contained in:
Thomas Breloff 2016-10-12 11:28:43 -04:00
parent f002f66890
commit 7fb995094e
4 changed files with 7 additions and 0 deletions

View File

@ -67,6 +67,7 @@ export
savefig, savefig,
png, png,
gui, gui,
closeall,
backend, backend,
backends, backends,

View File

@ -1079,3 +1079,5 @@ function _display(plt::Plot{GRBackend})
gr_display(plt) gr_display(plt)
end end
end end
closeall(::GRBackend) = GR.emergencyclosegks()

View File

@ -1224,3 +1224,5 @@ for (mime, fmt) in _pyplot_mimeformats
) )
end end
end end
closeall(::PyPlotBackend) = PyPlot.plt[:close]("all")

View File

@ -172,6 +172,8 @@ for mime in keys(_mimeformats)
end end
end end
closeall() = closeall(backend())
# --------------------------------------------------------- # ---------------------------------------------------------
# A backup, if no PNG generation is defined, is to try to make a PDF and use FileIO to convert # A backup, if no PNG generation is defined, is to try to make a PDF and use FileIO to convert