How to make the location of legend do not interfere the axes?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Khanh
el 28 de Dic. de 2014
Comentada: Image Analyst
el 28 de Dic. de 2014
Hi,
Could someone know how to make the location of legend with 'NorthEastOutSide' do not interfere the axes? I mean when I use this option the width of the axes will be changed. So I can't use multiple x axes. Is it possible to make the NorthEastOutSide option doesn't affect the width of the axes?
The below pictures show the axes before and after using the legend.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/146614/image.png)
Before
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/146615/image.png)
After
Thank you.
0 comentarios
Respuesta aceptada
Image Analyst
el 28 de Dic. de 2014
There is an input argument of legend() that lets you specify where you want the legend to appear.
2 comentarios
Image Analyst
el 28 de Dic. de 2014
Your next task is to fix the colors in the legend so that they're not all blue. You might want to plot the things separately with a unique color for each one. Or if they're all in a 2D array, try transposing it before you call plot().
Más respuestas (0)
Ver también
Categorías
Más información sobre Legend en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!