Global settings

Global settings

GPlot has a number of global parameters that you can change and that will affect all actions in the current session; those are contained in the GPlot.GP_ENV dictionary.

The most important ones are PALETTE and CONT_PREVIEW.

Palette

The palette is a vector of colours that are used by default if no colours are specified in a plot; the default one is inspired by Tableau's 10-2 palette:

To specify a palette, use set_palette with your specified Vector{<:Color}. For instance:

using Colors
set_palette([c"#ca624b", c"#f7dba7", c"#daddd8", c"#61d095", c"#c7d59f"])
for i in 1:5
    plot!(randn(10), lw=0.05)
end

Continuous preview

This parameter is useful if you are using GPlot with Juno. By default, GPlot will try to display things in the plot pane whenever you execute a line such as plot(...). In some cases, you may want to avoid this and, instead, only show things when you want it.

For this, just use continuous_preview to toggle it on or off; for instance:

continuous_preview(false)

subsequently, no plots will be displayed automatically, you will have to explicitly use preview(fig) or preview() to preview a specified figure or the current figure.