Plotting data labels within lines in Matlab -
my question similar post: matlab curve label
i have data (acquired using function long show here), gives me 2 arrays: nv4 (337x1) , t (337x1) , want plot 'a=40' on plot line. should able use contour label, need convert data matrix format first. post above gives link explain how convert our data, unfortunately link has expired , have no idea how should convert data to. example useful !
i'm posting new question because don't have enough reputation post comment
i guess there way, text. here sample:
% create sample curve x = 1:337; y = sqrt(x); plot(x,y); % define position display text = round(numel(x)/2); % local slope d = (y(i+1)-y(i))/(x(i+1)-x(i)); x = diff(get(gca, 'xlim')); y = diff(get(gca, 'ylim')); p = pbaspect; = atan(d*p(2)*x/p(1)/y)*180/pi; % display text text(x(i), y(i), 'a=40', 'backgroundcolor', 'w', 'rotation', a); and here result:

best,
Comments
Post a Comment