Making xticks match yticks?

3 visualizaciones (últimos 30 días)
L'O.G.
L'O.G. el 24 de Feb. de 2022
Respondida: Voss el 25 de Feb. de 2022
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])

Respuesta aceptada

Voss
Voss el 25 de Feb. de 2022
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

Más respuestas (0)

Categorías

Más información sobre Axis Labels en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by