[ACCEPTED]-Mark points with a value in a MATLAB plot-plot
Accepted answer
You can display text on your plot by using 5 the functions NUM2STR, CELLSTR, and STRTRIM to format the coordinate 4 values into a cell array of strings and 3 using the function TEXT to display them:
strValues = strtrim(cellstr(num2str([X(:) Y(:)],'(%d,%d)')));
text(X,Y,strValues,'VerticalAlignment','bottom');
And 2 your plot will look like this for the sample 1 data above:
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.