Modifying y axis division
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi,
I wrote some code and got the following graph.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/512337/image.png)
My Problem is the y axis has only 4 points i.e [0 , 5 , 10 , 15] bu the x axis has 9 values [0 : 2 : 16]. Therefore, when I say grid on I am getting rectangular grids, which is kinda not good looking.
What should I do so that the y-axis will also have 9 values and the graph has some nice looking square grids?
Thank You!
2 commentaires
Adam Danz
le 7 Fév 2021
That step is necessary but you may also have to explicitly set the yticks
ax = gca();
ax.YTick = ax.Xtick;
Réponses (0)
Voir également
Catégories
En savoir plus sur 2-D and 3-D 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!