MATLAB: How to comment on ploting data in graph

mathematicsMATLABmatricessolar radiation

Hi all;
i want to plot these two series of data and just nominate or comment two valuse from below series of data in ploting graph.
for example i want to give comment or name to 789 as required value in graph or 500 name as critical value.
solar radiation=[456 789 999 334 556 778 456 234 545 343 300 400 500 600 345]
heat gain=[456 789 765 345 234 654 768 979 567 456 678 453 867 989 234 ]
i will be very thankful .
thanks

Best Answer

You can do something like this
solar_radiation=[456 789 999 334 556 778 456 234 545 343 300 400 500 600 345];
heat_gain=[456 789 765 345 234 654 768 979 567 456 678 453 867 989 234];
ax = axes();
hold on
p1 = plot(solar_radiation, heat_gain);
p2 = plot(500, heat_gain(solar_radiation==500), '.', 'MarkerSize', 50, 'DisplayName', 'Required Value');
p3 = plot(789, heat_gain(solar_radiation==789), '.', 'MarkerSize', 50, 'DisplayName', 'Critical Value');
legend([p2 p3])