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.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.