Why are tick marks only on one axis when I change the tick spacing?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Raven
am 25 Jan. 2023
Kommentiert: Les Beckham
am 26 Jan. 2023
I am making a plot in MATLAB, and I want to specify the spacing of tick marks and grid lines.
By default, I get something like this:

But I want both the x and y axes to have have lines with a spacing of 1. So I changed the code to this:
axis equal;
xticks(1:1:5);
yticks(1:1:5);
grid on;
However, this causes the graph to look like this:

Notably, the horizontal grid lines and y-axis tick marks and labels are entirely gone. I have no clue why this would be. This seems like something that should be very straightforward, so not sure where the error could be coming in. Any help would be greatly appreciated. Thanks.
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Axis Labels finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!