Main Content

Simulink.sdi.setLegendPosition

R2026b

Set legend position in Simulation Data Inspector

Since R2023b

    Description

    Simulink.sdi.setLegendPosition(pos) sets the position of the legend on all Simulation Data Inspector tabs using the position pos.

    example

    Examples

    collapse all

    Set the legend position in the Simulation Data Inspector to display inside the subplot area on the right.

    Simulink.sdi.setLegendPosition("InsideRight")

    Input Arguments

    collapse all

    Legend position in the Simulation Data Inspector, specified as one of these values:

    • "OutsideTop" — Outside the subplot area on the top-left

    • "OutsideRight" — Outside the subplot area on the top-right

    • "InsideTop" — Inside the subplot area on the top-left

    • "InsideRight" — Inside the subplot area on the top-right

    • "None" — No legend

    When the legend position is "OutsideTop" or "InsideTop", the software lists legend entries horizontally. When the legend position is "OutsideRight" or "InsideRight", the software lists legend entries vertically.

    Version History

    Introduced in R2023b