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, 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.
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.
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.