Hi All:
I am defining a cell array of strings that is to be read by the legend command later in a loop.
Case_Name={'R1','R2','R3'};
legend(Case_Name{kk}, font);
The code was wroking on older version but now gives me an error
Error using legend (line 261)
Invalid argument. Type 'help legend' for more information.
Any help would be appreciated
Thank you

댓글 수: 5

Walter Roberson
Walter Roberson 2019년 8월 21일
What does the font variable contain?
Abdulaziz Abutunis
Abdulaziz Abutunis 2019년 8월 21일
sorry I should mention that. I defined it earlier in the code as font = 12;
Thank you for the effort
Walter Roberson
Walter Roberson 2019년 8월 21일
You now need 'FontSize', 12 instead of just 12
Abdulaziz Abutunis
Abdulaziz Abutunis 2019년 8월 21일
Walter Roberson you are right. though it was working in older version donno how.
BIG thank you
Devineni Aslesha
Devineni Aslesha 2019년 8월 26일
Hi Abdulaziz Abutunis
I would like to know the purpose of using the legend command in a loop. Is it like creating three plots in different figure windows so that cell array of strings is read by the legend command later in a loop? Or Is it like creating three plots in the same figure window?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

질문:

2019년 8월 21일

댓글:

2019년 8월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by