Main Content

Simulink.sdi.getLegendPosition

R2026b

Get legend position in Simulation Data Inspector

Since R2023b

    Description

    pos = Simulink.sdi.getLegendPosition returns the position pos of the legend on all Simulation Data Inspector tabs.

    example

    Examples

    collapse all

    Get the current legend position in the Simulation Data Inspector.

    pos = Simulink.sdi.getLegendPosition

    Output Arguments

    collapse all

    Legend position in the Simulation Data Inspector, returned 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