Drawing the x-axis at y=0
Afficher commentaires plus anciens
Hello. At least as the default option, MATLAB draws the x-axis at the bottom-most part of the graph. However, I would like to draw it at y=0 as is a common convention. Is it possible in MATLAB? (including the scale on the axis, and replacing the default axis drawn at the bottom)
Thanks, David
Réponse acceptée
Plus de réponses (4)
Kyle Johnson
le 30 Mar 2023
8 votes
Matlab now has support for this. You can set the property of the axes handle. No tricks of FEX required. :)
ax = gca;
ax.XAxisLocation = "origin";
ax.YAxisLocation = "origin";
1 commentaire
Christian Schröder
le 18 Jan 2024
Thanks! This is the correct way to do this in modern MATLAB, and this should be the accepted answer.
Amith Kamath
le 4 Nov 2011
0 votes
You may want to look at this example:
Jan
le 4 Nov 2011
0 votes
Meade
le 18 Jan 2017
0 votes
For posterity, this has been fixed in the HG2 Update. Linked below since this thread is currently the top search result on the topic.
2 commentaires
Bartche
le 3 Mar 2021
The page you were looking for does not exist. Use the search box or browse topics below to find the page you were looking for.
Walter Roberson
le 3 Mar 2021
Modifié(e) : Walter Roberson
le 1 Mai 2021
Catégories
En savoir plus sur Surface and Mesh 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!