Outer legend positions

Source code Author Update time

using Plots
pythonplot()

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]
with(scalefonts = 0.5, size = (2w, 2h)) do
    plot(leg_plots()..., leg_plots(legend_column = -1)...; layout = (6, 3))
end
2023-07-25T15:58:23.364669 image/svg+xml Matplotlib v3.7.2, https://matplotlib.org/

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

This documentation is not for the latest stable release, but for either the development version or an older release.
Click here to go to the documentation for the latest stable release.