How to add a legend entry for labels
2 views (last 30 days)
Show older comments
I have 3 data points on a plot that each have a label adjacent to them displaying a percent value: an x marker with a [110%] NE of it for example.
In my legend, I would like to add an entry that looks like this: '[%] = Dp' so that readers know the percentages displayed next to points represent the dilution percentage.
How can I add this to my legend and keep it looking professional? Thanks!
4 Comments
Answers (1)
Arif Hoq
on 28 Feb 2022
you did not attach your data here. I have taken a simple plot example here. you can just rename in the legend function whatever you want.
x = linspace(0,pi);
y1 = cos(x);
plot(x,y1)
hold on
y2 = cos(2*x);
plot(x,y2)
hold off
lgd = legend('[10%] = Dp','[20%] = Dp');
0 Comments
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!