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 clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window.
Web browsers do not support MATLAB commands.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.