Effacer les filtres
Effacer les filtres

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

6 vues (au cours des 30 derniers jours)
Damith
Damith le 12 Juin 2014
Réponse apportée : dpb le 12 Juin 2014
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.

Réponses (1)

dpb
dpb le 12 Juin 2014
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.

Catégories

En savoir plus sur Discrete Data Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by