Is there a configuration file like matplotlibrc in Plots.jl?

Viewed 69

I try to unify my figures formats across different files. I do not want to use PyPlot.jl. Is there a configuration file as matplotlibrc in Python? Or some other alternative way that can make me to write these format into a file without changing much about my figures code.

1 Answers

If I understand your question correctly (I haven't used matplotlib in ages, so not sure what the matplotlibrc file exactly does) you want to specify default settings for your plots in Plots.jl.

When using Plots in a running Julia session, you can use the default function:

julia> default(color = "red", linewidth = 10)

sets default arguments for subsequent plot commands.

If you want these defaults to be automatically available in every Julia session you can create a startup file at ~/.julia/config/startup.jl and set an environment variable there:

PLOTS_DEFAULTS = Dict(:color=> 10, :linewidth => 2)

will have the same effect as the call to default above, but will happen automatically once you start Julia.

This is discussed in the docs here.

Related