How to mirror a plot ?

203 Ansichten (letzte 30 Tage)
Ali nouri
Ali nouri am 24 Feb. 2020
Kommentiert: DGM am 8 Mai 2022
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 Kommentare
Ankit
Ankit am 24 Feb. 2020
try this
plot(-x(:,1), y(:,2));
Ali nouri
Ali nouri am 24 Feb. 2020
but then x axis is negativ.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Ankit
Ankit am 24 Feb. 2020
Bearbeitet: Ankit am 24 Feb. 2020
After your plot command, add the below line:
set(gca, 'XDir','reverse')
  5 Kommentare
jose daniel hoyos giraldo
did you solve it?
DGM
DGM am 8 Mai 2022
?
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:')

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by