Effacer les filtres
Effacer les filtres

how to plot scatterplot for one attribute?

1 vue (au cours des 30 derniers jours)
Priyanka Gaikwad
Priyanka Gaikwad le 7 Juil 2017
Commenté : KL le 7 Juil 2017
lets say I have a data for attribute xyz is 23 12 43 21 43 21 334 65 32 12 and i want a graph where x axis will hold the location of data and y axis will hold the value for example,if i want data in form of point(xvalue,yvalue), then(1,23),(2,12),(3,43),(4,21) should get plotted on the graph and it should be scatterplot.
Please tell me the syntax for same. Thank you in advance!

Réponses (1)

José-Luis
José-Luis le 7 Juil 2017
data = rand(10,1);
figure
plot(data); %implicit
figure
plot(1:size(data,1), data); %explicit
Please read the documentation on plot();
  2 commentaires
Priyanka Gaikwad
Priyanka Gaikwad le 7 Juil 2017
Thank you. and what if I want it to be a scatterplot?
KL
KL le 7 Juil 2017
use scatter instead of plot. Please Read.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Scatter 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