How to add a legend entry for labels

6 vues (au cours des 30 derniers jours)
Joey Biever
Joey Biever le 28 Fév 2022
Commenté : Arif Hoq le 28 Fév 2022
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 commentaires
KSSV
KSSV le 28 Fév 2022
Data is not required.....an example will do. What you showed is a legit answer.
Arif Hoq
Arif Hoq le 28 Fév 2022
noted.. thank you very much.

Connectez-vous pour commenter.

Réponses (1)

Arif Hoq
Arif Hoq le 28 Fév 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');

Community Treasure Hunt

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

Start Hunting!

Translated by