OEDrawLegendLayout

bool OEDrawLegendLayout(OELegendLayout &layout)

Draws the legend layout.

Note

Interactive legend can only be used in .svg image format.

Example

opts = oedepict.OELegendLayoutOptions(oedepict.OELegendLayoutStyle_VerticalTopRight,
                                      oedepict.OELegendColorStyle_LightGreen,
                                      oedepict.OELegendInteractiveStyle_Toggle)
opts.SetButtonWidthScale(1.5)
opts.SetButtonHeightScale(1.5)
legend = oedepict.OELegendLayout(image, "Legend", opts)

legend_area = legend.GetLegendArea()
oedepict.OEAddWatermark(legend_area, "This is the legend area")
oedepict.OEAddInteractiveIcon(image, oedepict.OEIconLocation_BottomRight, 0.75)
oedepict.OEDrawLegendLayout(legend)

oedepict.OEWriteImage("LegendLayout.svg", image)

Hint

The OEDrawLegendLayout function should be called after rendering all other information to the image.

Download code

LegendLayout.py

click on the "Legend" label

Example of using the OEDrawLegendLayout function

../../_images/LegendLayout.svg