Outer legend positions

Source code Author Update time

using Plots
gaston()

Horizontal or vertical legends, at different locations.

legs = (:topleft, :top, :topright, :left, nothing, :right, :bottomleft, :bottom, :bottomright)
leg_plots(; kw...) = begin
        map((leg->begin
                    plot([0:1, reverse(0:1)]; marker = :circle, ticks = :none, leg_title = leg, leg = if leg isa Symbol
                                Symbol(:outer, leg)
                            else
                                :none
                            end, kw...)
                end), legs)
    end
(w, h) = Plots._plot_defaults[:size]
Plots.with(scalefonts = 0.5, size = (2w, 2h)) do
    plot(leg_plots()..., leg_plots(legend_column = -1)...; layout = (6, 3))
end
Gnuplot Produced by GNUPLOT 5.4 patchlevel 2 0 0.2 0.4 0.6 0.8 1 1 1.2 1.4 1.6 1.8 2 y1 y2 topleft y1 y1 y2 y2 0 0.2 0.4 0.6 0.8 1 1 1.2 1.4 1.6 1.8 2 y1 y2 left y1 y1 y2 y2 0 0.2 0.4 0.6 0.8 1 1 1.2 1.4 1.6 1.8 2 y1 y2 bottomleft y1 y1 y2 y2 0 0.2 0.4 0.6 0.8 1 1 1.2 1.4 1.6 1.8 2 y1 y2 topleft y1 y1 y2 y2 0 0.2 0.4 0.6 0.8 1 1 1.2 1.4 1.6 1.8 2 y1 y2 left y1 y1 y2 y2 0 0.2 0.4 0.6 0.8 1 1 1.2 1.4 1.6 1.8 2 y1 y2 bottomleft y1 y1 y2 y2 0 0.2 0.4 0.6 0.8 1 1 1.2 1.4 1.6 1.8 2 y1 y2 top y1 y1 y2 y2 0 0.2 0.4 0.6 0.8 1 1 1.2 1.4 1.6 1.8 2 y1 y2 0 0.2 0.4 0.6 0.8 1 1 1.2 1.4 1.6 1.8 2 y1 y2 bottom y1 y1 y2 y2 0 0.2 0.4 0.6 0.8 1 1 1.2 1.4 1.6 1.8 2 y1 y2 top y1 y1 y2 y2 0 0.2 0.4 0.6 0.8 1 1 1.2 1.4 1.6 1.8 2 y1 y2 0 0.2 0.4 0.6 0.8 1 1 1.2 1.4 1.6 1.8 2 y1 y2 bottom y1 y1 y2 y2 0 0.2 0.4 0.6 0.8 1 1 1.2 1.4 1.6 1.8 2 y1 y2 topright y1 y1 y2 y2 0 0.2 0.4 0.6 0.8 1 1 1.2 1.4 1.6 1.8 2 y1 y2 right y1 y1 y2 y2 0 0.2 0.4 0.6 0.8 1 1 1.2 1.4 1.6 1.8 2 y1 y2 bottomright y1 y1 y2 y2 0 0.2 0.4 0.6 0.8 1 1 1.2 1.4 1.6 1.8 2 y1 y2 topright y1 y1 y2 y2 0 0.2 0.4 0.6 0.8 1 1 1.2 1.4 1.6 1.8 2 y1 y2 right y1 y1 y2 y2 0 0.2 0.4 0.6 0.8 1 1 1.2 1.4 1.6 1.8 2 y1 y2 bottomright y1 y1 y2 y2

This page was generated using DemoCards.jl and Literate.jl.