How to add a legend entry for labels

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

@Arif Hoq Why an answer is placed in a comment section? You have to answet his in the answer section.
Arif Hoq
Arif Hoq on 28 Feb 2022
Edited: Arif Hoq on 28 Feb 2022
as there is no data that's why i put a comment. just now edited.
Data is not required.....an example will do. What you showed is a legit answer.
noted.. thank you very much.

Sign in to comment.

Answers (1)

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');

Asked:

on 28 Feb 2022

Commented:

on 28 Feb 2022

Community Treasure Hunt

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

Start Hunting!