MATLAB Answers

Legend problem in 2018b version

17 views (last 30 days)
Abdulaziz Abutunis
Abdulaziz Abutunis on 21 Aug 2019
Commented: Devineni Aslesha on 26 Aug 2019
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 Comments

Show 2 older comments
Walter Roberson
Walter Roberson on 21 Aug 2019
You now need 'FontSize', 12 instead of just 12
Abdulaziz Abutunis
Abdulaziz Abutunis on 21 Aug 2019
Walter Roberson you are right. though it was working in older version donno how.
BIG thank you
Devineni Aslesha
Devineni Aslesha on 26 Aug 2019
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?

Sign in to comment.

Answers (0)

Sign in to answer this question.