필터 지우기
필터 지우기

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

조회 수: 6 (최근 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 CenterFile Exchange에서 Discrete Data Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by