Placed
WLJS
Execution environment
A special symbol used across formatting, plotting functions in Wolfram Language
Placed[feature_, position_]
where position
can be
Before | After | {x, y} | {Left, Top} | ...
where x,y
are scaled coordinates.
Use cases
Legended
Legended[Disk[]//Graphics, Placed[SwatchLegend[{Red}, {"Mark"}], Before]]
Legended[Disk[]//Graphics, Placed[SwatchLegend[{Red}, {"Mark"}], After]]
Or using scaled coordinates
Legended[Disk[]//Graphics, Placed[SwatchLegend[{Red}, {"Mark"}], {0.5,0.5}]]
Plot
In the most plotting function you can use this wrapper to place your generated legend
Plot[
{x,x^2}, {x,0,1},
PlotLegends->Placed[SwatchLegend[Automatic], {0.2,0.2}]
]