MATLAB Answers

How can I add a comment on a curve ?

11 views (last 30 days)
Hello
How can I add a comment on curve like Sc Model on the attached curve ?
How can I obtain the dark green (not 'g') ?
Best regards
P31 = [1.43436165089259e-06;1.43374766282421e-05;0.000142762885117782;0.000424250225827408;0.000563002478050165;0.000700445374077970;0.000836592402772030;0.000971456893169736;0.00110505201663249;0.00136848607248207;0.00162699686730859;0.00175443735421301;0.00188068430746190;0.00200574985219740;0.00212964597195751;0.00225238451055365;0.00237397717392035;0.00249443553193791;0.00261377102022809;0.00374779137589255;0.00478117199423086;0.00572338762862873;0.00658290260475480;0.00736729179956388;0.00808334563511983;0.00873716137866576;0.00933422268977868;0.00987946906116776;0.0103773565523935;0.0108319110077304;0.0112467747740984;0.0116252477870651;0.0119703237678987;0.0122847221688105;0.0128311589059730;0.0130675032083378;0.0144598912865357;0.0147934635095272;0.0146280450178580;0.0142271493397784;0.0137214852616019;0.0137214852616019;0.0131780725811443;0.0121005290573215];
R_matrix = [0.1e3;1e3;1e4;3e4;4e4;5e4;6e4;7e4;8e4;1e5;1.2e5;1.3e5;1.4e5;1.5e5;1.6e5;1.7e5;1.8e5;1.9e5;2e5;3e5;4e5;5e5;6e5;7e5;8e5;9e5;1e6;1.1e6;1.2e6;1.3e6;1.4e6;1.5e6;1.6e6;1.7e6;1.9e6;2e6;3e6;4e6;5e6;6e6;7e6;7e6;8e6;1e7];
loglog(R_matrix, P31) % Color dark green not green 'g' ?
  1 Comment
madhan ravi
madhan ravi on 12 Mar 2019
Alex I suggest you to move your comment to answer section.

Sign in to comment.

Accepted Answer

Star Strider
Star Strider on 12 Mar 2019
You could use an annotation (link) object (that I find difficult to use because of the coordinate system they require), or you could do something like this:
P31 = [1.43436165089259e-06;1.43374766282421e-05;0.000142762885117782;0.000424250225827408;0.000563002478050165;0.000700445374077970;0.000836592402772030;0.000971456893169736;0.00110505201663249;0.00136848607248207;0.00162699686730859;0.00175443735421301;0.00188068430746190;0.00200574985219740;0.00212964597195751;0.00225238451055365;0.00237397717392035;0.00249443553193791;0.00261377102022809;0.00374779137589255;0.00478117199423086;0.00572338762862873;0.00658290260475480;0.00736729179956388;0.00808334563511983;0.00873716137866576;0.00933422268977868;0.00987946906116776;0.0103773565523935;0.0108319110077304;0.0112467747740984;0.0116252477870651;0.0119703237678987;0.0122847221688105;0.0128311589059730;0.0130675032083378;0.0144598912865357;0.0147934635095272;0.0146280450178580;0.0142271493397784;0.0137214852616019;0.0137214852616019;0.0131780725811443;0.0121005290573215];
R_matrix = [0.1e3;1e3;1e4;3e4;4e4;5e4;6e4;7e4;8e4;1e5;1.2e5;1.3e5;1.4e5;1.5e5;1.6e5;1.7e5;1.8e5;1.9e5;2e5;3e5;4e5;5e5;6e5;7e5;8e5;9e5;1e6;1.1e6;1.2e6;1.3e6;1.4e6;1.5e6;1.6e6;1.7e6;1.9e6;2e6;3e6;4e6;5e6;6e6;7e6;7e6;8e6;1e7];
loglog(R_matrix, P31, 'Color',[0.6 0.6 0.1], 'LineWidth',2)
text(5E+4, 2E-3, {'This Curve'; '\downarrow'}, 'HorizontalAlignment','center')
  3 Comments
Star Strider
Star Strider on 13 Mar 2019
Use the hold (link) function to plot different data and colours on the same axes.

Sign in to comment.

More Answers (2)

Alex Mcaulley
Alex Mcaulley on 12 Mar 2019
How can I add a comment on curve like Sc Model on the attached curve ?
How can I obtain the dark green (not 'g') ?
loglog(R_matrix, P31,'Color',[R G B])
  1 Comment
Mallouli Marwa
Mallouli Marwa on 13 Mar 2019
Thanks a lot
If I have to plot two curves and a comment on one curve, it doesn't display
plot (x,y,'y',x1,y2,'b')
text(2,5,'this curve 1')
Please help me

Sign in to comment.


Nitin Phadkule
Nitin Phadkule on 20 Aug 2021
Edited: Nitin Phadkule on 20 Aug 2021
x=0:1:100;
y=x.^2
y = 1×101
0 1 4 9 16 25 36 49 64 81 100 121 144 169 196 225 256 289 324 361 400 441 484 529 576 625 676 729 784 841
x1=-100:2:10;
y2=x1.^2
y2 = 1×56
10000 9604 9216 8836 8464 8100 7744 7396 7056 6724 6400 6084 5776 5476 5184 4900 4624 4356 4096 3844 3600 3364 3136 2916 2704 2500 2304 2116 1936 1764
plot (x,y,x1,y2)
text(20,5000,' this curve 1 \rightarrow')

Community Treasure Hunt

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

Start Hunting!