diff --git a/Project.toml b/Project.toml index 2d7318d42..c68a01b61 100644 --- a/Project.toml +++ b/Project.toml @@ -87,7 +87,7 @@ PrecompileTools = "1" PGFPlotsX = "1" Unzip = "0.1 - 0.2" PlotlyBase = "0.7 - 0.8" -PythonPlot = "1" +PythonPlot = "1 - 1.0.2" UnitfulLatexify = "1" RecipesPipeline = "0.6.10" LaTeXStrings = "1" diff --git a/src/backends.jl b/src/backends.jl index a4ecb3948..57e6c75fe 100644 --- a/src/backends.jl +++ b/src/backends.jl @@ -1067,23 +1067,21 @@ const _pyplot_scale = [:identity, :ln, :log2, :log10] _post_imports(::PythonPlotBackend) = @eval begin const PythonPlot = Main.PythonPlot const PythonCall = Main.PythonPlot.PythonCall -end -_runtime_init(::PythonPlotBackend) = @eval begin mpl_toolkits = PythonCall.pyimport("mpl_toolkits") - mpl = PythonCall.pyimport("matplotlib") - numpy = PythonCall.pyimport("numpy") + mpl = PythonCall.pyimport("matplotlib") + numpy = PythonCall.pyimport("numpy") PythonCall.pyimport("mpl_toolkits.axes_grid1") numpy.seterr(invalid = "ignore") - PythonPlot.ioff() # we don't want every command to update the figure + PythonPlot.ioff() # we don't want every command to update the figure end +_runtime_init(::PythonPlotBackend) = nothing function _initialize_backend(pkg::PythonPlotBackend) _pre_imports(pkg) @eval Main begin import PythonPlot - export PythonPlot $(_check_compat)(PythonPlot) end _post_imports(pkg)