Change legend line position

조회 수: 11 (최근 30일)
abu
abu 2021년 8월 26일
답변: Alex Alex 2021년 8월 27일
Hello,
I have the following situation with my legend:
x = 1:10;
y1 = rand(10,1);
y2 = rand(10,1);
plot(x,y1,x,y2);
l=legend(['blue1' newline 'blue2' newline 'blue3'], ...
['orange1' newline 'orange2' newline 'orange3'], ...
'Orientation','horizontal', 'Location', 'northoutside');
Now I have a legend where I see the line on the left side of my text. However, I wish to have my lines on top of the text. As a visual:
now: text text
-------- text -------- text
text text
I wish: -------- --------
text text
text text
text text
Is it possible to change the arrangement of text and line or to shift the lines to a new position?
Thanks in advance,
Andi

답변 (1개)

Alex Alex
Alex Alex 2021년 8월 27일

카테고리

Help CenterFile Exchange에서 Legend에 대해 자세히 알아보기

태그

제품


릴리스

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by