Problems in using the function: line()
Afficher commentaires plus anciens
I am trying to connect the points of a scatter plot with a line using line(x,y) but the line simply doesn't appear. The vectors are both of the same size. The first one is a linspace vector with 96 elements and the second is a vector with 96 elements obtained from calculations carried on in the main script. How do I connect the points that I obtained from a scatter plot of these two vectors?
Réponses (1)
Ameer Hamza
le 24 Mai 2018
Modifié(e) : Ameer Hamza
le 24 Mai 2018
Use this code as a template
x = linspace(0, 100, 100);
y = rand(size(x));
scatter(x, y);
hold on;
line(x, y);
The scatter plot points will be connected.

3 commentaires
Luca Guarino
le 24 Mai 2018
Stephen23
le 24 Mai 2018
@Luca Guarino: please show us the exact code that you are using.
Luca Guarino
le 24 Mai 2018
Catégories
En savoir plus sur 2-D and 3-D Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!