How to mirror a plot ?

Hi
I need a help, i want to mirror a plotaround y axis, but still have the same axis, can anybody help?
I have upload the plot as attachments.

2 Commenti

Ankit
Ankit il 24 Feb 2020
try this
plot(-x(:,1), y(:,2));
Ali nouri
Ali nouri il 24 Feb 2020
but then x axis is negativ.

Accedi per commentare.

 Risposta accettata

Ankit
Ankit il 24 Feb 2020
Modificato: Ankit il 24 Feb 2020
After your plot command, add the below line:
set(gca, 'XDir','reverse')

5 Commenti

Ali nouri
Ali nouri il 24 Feb 2020
thanks
Ankit
Ankit il 24 Feb 2020
You can accept the answer if it served your purpose!
How can i mirror a duplicate? I mean having the first curve and the mirrored one in the same plot, Can it be done with a fplot?
did you solve it?
?
x = -10:20;
y = x/10;
% the regular plot
plot(x,y,'k'); hold on
% the same series, but flipped on x
plot(-x,y,'b:')

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Fourier Analysis and Filtering in Centro assistenza e File Exchange

Richiesto:

il 24 Feb 2020

Commentato:

DGM
il 8 Mag 2022

Community Treasure Hunt

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

Start Hunting!

Translated by