Making xticks match yticks?

How can you make the xticks match the yticks without having to manually do something like the following?
xticks([-2*pi -pi 0 pi 2*pi])
yticks([-2*pi -pi 0 pi 2*pi])

 Risposta accettata

You can do this:
set(gca(),'XTick',get(gca(),'YTick'));
For example:
plot(1:10,5:14); % plot a line
set(gca(),'XTick',get(gca(),'YTick')); % make the xticks match the yticks

Più risposte (0)

Prodotti

Release

R2021b

Richiesto:

il 24 Feb 2022

Risposto:

il 25 Feb 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by