P_p=plot(Totalpressure_given,Totalpressure_given,'*g');
hold on
P_p2=plot(Totalpressure_given,Totalpressure_obtained,'*r');
X_p=get(P_p,'XData');
Y_p=get(P_p,'YData');
X_p2=get(P_p2,'XData');
Y_p2=get(P_p2,'YData');
imax=find(max(Y_p)==Y_p);
imin=find(min(Y_p)==Y_p);
imax2=find(max(Y_p2)==Y_p2);
imin2=find(min(Y_p2)==Y_p2);
text(X_p(imin(1,1)),Y_p(imax),['Average Difference: ',num2str(Avg_Difference_P)]);
text(X_p2(imin2(1,1)),Y_p2(imax2),['Standard Deviation: ',num2str(SD_P)]);
2 Comments
Direct link to this comment
https://fr.mathworks.com/matlabcentral/answers/154275-placing-text-in-a-plot#comment_236395
Direct link to this comment
https://fr.mathworks.com/matlabcentral/answers/154275-placing-text-in-a-plot#comment_236395
Direct link to this comment
https://fr.mathworks.com/matlabcentral/answers/154275-placing-text-in-a-plot#comment_236496
Direct link to this comment
https://fr.mathworks.com/matlabcentral/answers/154275-placing-text-in-a-plot#comment_236496
Sign in to comment.