Can users pre-determine the legend location when utiliznig the gscatter function?
4 views (last 30 days)
Show older comments
I'm putting together an M-file where I include several group scatter plots. For unknown reasons, I'm unable to pre-determine the legend location (NorthEastOutside). I can determine the location after the plot is created by manually editing the figure properties.
Is this a limitation of the function?
2 Comments
Accepted Answer
Brad
on 1 Jul 2013
1 Comment
Óscar Miranda Domínguez
on 3 Mar 2015
Edited: Óscar Miranda Domínguez
on 3 Mar 2015
It is easier to just silence the auto legend in gscatter by setting doleg as "off" Next, add the legend. Example:
gscatter(c2,c1,my_labels,my_color,'o+',[],'off');
legend(unique(char(my_labels),'rows'),'location','best')
More Answers (0)
See Also
Categories
Find more on Legend in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!