Show row and column number by the side of each point in scatterplot

1 回表示 (過去 30 日間)
Damith
Damith 2014 年 6 月 12 日
回答済み: dpb 2014 年 6 月 12 日
Hi,
I have an array X of values has 741 (rows) and 1 (col). Y is also the same. I want to plot a scatterplot(X,Y) but I need to show row and col number by a side of each point (pair) in the scatterplot.
The formula to calculate row number = (741*2)/39 and col number = (741*2)/38
Can somebody help me with that please?
Thanks in advance.

回答 (1 件)

dpb
dpb 2014 年 6 月 12 日
With that many points don't think you'll have anything close to enough room to show 'em all, but it's a pretty trivial exercise--
x=[1:10].';y=randi(10,10,1); % make up some data
scatter(x,y) % scatterplot it
xlim([0 11]),ylim([0 11]) % put some space around the outside points
text(x+0.1,y,num2str([x y],'[%d,%d]')) % and label the points
I don't understand your location calculation but you should be able to figure out how to put the numbers you want where you want them from the above.

カテゴリ

Help Center および File ExchangeDiscrete Data Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by