Labelling Curves on a Graph
179 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Tom
il 24 Lug 2019
Risposto: Mario Chiappelli
il 24 Lug 2019
I have the following graph as shown below:
![Lockerby2016Fig6a.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/231108/image.png)
Rather than having a legend, I would like to have the curves labelled, so for exapmple in maths font you have 'Kn=0.0' floating somewhere below the blue curve, then a black line connects that to the curve, and so on for the others. I am aware that this type of thing can be done in image editing software but was wondering if there was some way of doing it directly with MATLAB so that it still looks professional?
0 Commenti
Risposta accettata
Mario Chiappelli
il 24 Lug 2019
The general method would be using the legend function, to which you give a vector of the plot object handles and a series of corresponding strings. For example,
figure; hold on
a1 = plot(x,y1);
M1 = "Curve 1";
a2 = plot(x,y2);
M2 = "Curve 2";
legend([a1,a2], [M1, M2]);
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!