Select signals from the table on the left to view them in the Simulation Data Inspector. By default, the legend is located outside of the subplot at the top-left.
Use the Simulink.sdi.setLegendPosition function to move the legend inside the subplot and to the right.
Simulink.sdi.setLegendPosition("InsideRight")
You can confirm the location of the legend programmatically using the Simulink.sdi.getLegendPosition function.
Simulink.sdi.getLegendPosition
ans =
'InsideRight'
You can also use the Simulink.sdi.setLegendPosition function to remove the legend.
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.
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.