![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/288151/image.png)
Adding multiple lines in plot using annotation
134 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Rafael Fehér
le 27 Avr 2020
Commenté : Rafael Fehér
le 28 Avr 2020
I want to add 3 lines to my plot using annotation, but I can't figure out one way to do it jumping line. I'm trying:
dim = [0.15 0.5 0.3 0.3];
str = ['A = ',num2str(A),'\epsilon = ',num2str(epsilon),'k = ',num2str(k)];
annotation('textbox',dim,'String',str,'FitBoxToText','on');
But what I get back is:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/288120/image.jpeg)
How can I jump line between the A = 2 and the \epsilon = 0.05?
Thank you,
Rafael Feher
0 commentaires
Réponse acceptée
Mehmed Saad
le 28 Avr 2020
figure,plot(1:10)
A = 2;
epsilon = 0.05;
k=2;
dim = [0.15 0.5 0.3 0.3];
str = {['A = ',num2str(A)],['\epsilon = ',num2str(epsilon)],['k = ',num2str(k)]};
annotation('textbox',dim,'String',str,'FitBoxToText','on');
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/288151/image.png)
Plus de réponses (1)
Olawale Ikuyajolu
le 28 Avr 2020
text(0.5, 1.5,'Your Text', 'fontsize',6,'color','k','FontWeight','bold');
r = rectangle('Position',[0.3 1.4 5 0.15]','linewidth',1.6);
0 commentaires
Voir également
Catégories
En savoir plus sur Annotations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!