Hi,
I am creating the vector plot with Quiver () command. I would like to perform left to right flip. I have tried with Fliplr () option .. But didn't get the desired results.
Could someone help me on how to perform flip operation in the below command??. I have attached x2, y2, u , v arrays here..
c= (quiver(x2+1.5,y2(1:skip:end),u(1:skip:end,:),v(1:skip:end,:)))';
c.Color='r';
c.AutoScaleFactor=6;

 Respuesta aceptada

Star Strider
Star Strider el 23 de Oct. de 2021

0 votos

I have absolutely no idea what the desired result actually is.
One option: negate ‘x2’
Another option:
set(gca, 'XDir','reverse')
.

3 comentarios

Yes, there is.
To illustrate with an example (not the attached file) —
x = linspace(-50, 50, 250);
y = exp(-0.1*x) .* sin(2*pi*x*25);
figure
subplot(3,1,1)
plot(x, y)
grid
title('Original')
subplot(3,1,2)
plot(x, y)
set(gca, 'XDir','reverse')
grid
title('Reversed X-Axis With Reversed X-Axis Tick Labels')
subplot(3,1,3)
plot(x, y)
set(gca, 'XDir','reverse')
xt = get(gca, 'XTick');
set(gca, 'XTickLabel',flip(xt))
grid
title('Reversed X-Axis With Ascending X-Axis Tick Labels')
The code in the last subplot can essentially be copied & pasted to the existing plot code to produce the desired result. It should work regardless of the original plot call.
.
Turbulence Analysis
Turbulence Analysis el 23 de Oct. de 2021
Thanks a lot.. Yes.. Now I am got the desired one...
Star Strider
Star Strider el 23 de Oct. de 2021
As always, my pleasure!
.

Iniciar sesión para comentar.

Más respuestas (1)

Turbulence Analysis
Turbulence Analysis el 23 de Oct. de 2021

0 votos

Thanks, with set(gca, 'XDir','reverse') I got the desired results. But on the x axis I always need to display negative values on left and positive on the right. Is there a way out to do this ??

Categorías

Más información sobre Vector Fields en Centro de ayuda y File Exchange.

Preguntada:

el 23 de Oct. de 2021

Comentada:

el 23 de Oct. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by