JuliaPy / PyPlot.jl

Plotting for Julia based on matplotlib.pyplot
https://github.com/JuliaPy/PyPlot.jl
MIT License
475 stars 87 forks source link

use styles in a module #462

Open SimonEnsemble opened 4 years ago

SimonEnsemble commented 4 years ago

I'm imposing a style inside a module, but it doesn't take effect when I call PyPlot.jl functions from this module. see here.

module Controlz

using PyPlot

# hipster plot theme
PyPlot.matplotlib.style.use(joinpath(
    replace(pathof(Controlz), "src/Controlz.jl" => "src"), "hipster.mplstyle"))
#  ...

function my_plot()
   plot([1], [2])
end

then the style is not used in my_plot(). is there a way to enforce my .mplstyle file to be used in these plots? thanks.