Skip to content

Commit

Permalink
place an upper bound fo PythonPlot
Browse files Browse the repository at this point in the history
  • Loading branch information
BeastyBlacksmith committed Aug 29, 2023
1 parent 47c0aee commit b07f9cb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 1 addition & 5 deletions src/backends.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1067,23 +1067,19 @@ 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")

PythonCall.pyimport("mpl_toolkits.axes_grid1")
numpy.seterr(invalid = "ignore")

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)
Expand Down

0 comments on commit b07f9cb

Please sign in to comment.