![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/595285/image.jpeg)
Text in legend is writton over each other. Legend only has one row instad of three. Also wrong default placing of axis tiltes.
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi guys,
I use MATLAB R2021a and I have a figure with a legend, using interpreter 'tex'. Often, not always which is weird, the three rows of the legend are written all over each other in one row instead of written in three separate rows. When this problem occurs, the default placing of the axis titles is written through the axis numbers. Is there a fix for this?
See the attached picture for an example.
My code to show the legend is as follows:
legend('Exit times (s)','Modelled ET (s) with FS_{EdgeofRamp} = 1041','Modelled ET (s) with FS_{EdgeofRamp} = 869','location',"southwest",'interpreter','tex')
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/595255/image.jpeg)
댓글 수: 2
Scott MacKenzie
2021년 4월 24일
편집: Scott MacKenzie
2021년 4월 26일
Please include your code, or a subset of your code that produces a chart with the problems noted.
If I use your legend command as follows:
y = randn(3,5);
plot(y);
legend('Exit times (s)','Modelled ET (s) with FS_{EdgeofRamp} = 1041','Modelled ET (s) with FS_{EdgeofRamp} = 869','location',"southwest",'interpreter','tex')
the result is fine:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/595285/image.jpeg)
BTW, no need to include the 'interpreter' property: 'tex' is the default.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Legend에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!