Borrar filtros
Borrar filtros

How to make the negative sign of y axis to be up ?

33 visualizaciones (últimos 30 días)
noura
noura el 15 de Jul. de 2024 a las 21:24
Editada: dpb el 15 de Jul. de 2024 a las 22:39
How to make the negative sign of y axis to be up?

Respuestas (2)

dpb
dpb el 15 de Jul. de 2024 a las 21:34
Editada: dpb el 15 de Jul. de 2024 a las 22:39
plot([-1000:100:100]);
hAx=gca;
hAx.YDir='reverse';
See axes documentation for all the details...

VBBV
VBBV el 15 de Jul. de 2024 a las 21:36
ydata = -900:100:100
ydata = 1x11
-900 -800 -700 -600 -500 -400 -300 -200 -100 0 100
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
xdata = ydata.*ones(1,length(ydata))
xdata = 1x11
-900 -800 -700 -600 -500 -400 -300 -200 -100 0 100
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
plot(xdata,ydata)
yticks = ydata;
yticklabels(fliplr(yticks))
  1 comentario
dpb
dpb el 15 de Jul. de 2024 a las 21:41
ydata = -900:100:100;
xdata = ydata;
plot(xdata,ydata)
hAx=gca;
hAx.YDir='reverse';
The above reverses the actual relation between the x, y values; as defined, y==x so the negative x and y values should be associated visually.

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by