plotting same values as individual points on x-axis
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Sumera Yamin
il 9 Nov 2023
Commentato: Sumera Yamin
il 10 Nov 2023
Hello, I want to plot a data in which x coordinate has multiple point waith same values and i want to keep those values as individual points. What will be the best way to do so. for example I have data in the following format in which x-coordiate values are repeated as a series but i want to keep them as individual points and not have just five points in x-coordinate. many thanks.
x=[1,2,3,4,5,1,2,3,4,5,1,2,3,4,5]
y=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
2 Commenti
Dyuman Joshi
il 9 Nov 2023
It's not clear to me what exactly you want to obtain. What should be the output for the given data?
"but i want to keep them as individual points and not have just five points in x-coordinate."
Could you elaborate on this?
Risposta accettata
Dyuman Joshi
il 9 Nov 2023
x=[1,2,3,4,5,1,2,3,4,5,1,2,3,4,5];
y=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
vec = 1:numel(y);
scatter(vec,y)
xticks(vec)
xticklabels(string(x))
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Scatter Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!