how to plot x-axis only
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
zilai si
le 27 Mai 2019
Réponse apportée : Star Strider
le 27 Mai 2019
hello, everyone, i wonder how to plot a gragh like this:

with x-aixs only and two directions
0 commentaires
Réponse acceptée
Star Strider
le 27 Mai 2019
This comes close:
figure
xlim([-4.2 4.2])
plot((rand(1,20)-0.5)*3, zeros(1,20), '+r')
text(min(xlim), 0.025, '\leftarrow', 'HorizontalAlignment','left', 'VerticalAlignment','middle', 'FontSize',18)
text(max(xlim), 0.025, '\rightarrow', 'HorizontalAlignment','right', 'VerticalAlignment','middle', 'FontSize',18)
set(gca, 'XAxisLocation','origin', 'YColor','none')
Experiment to get the result you want.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!