Mirror image/plot flip

60 visualizzazioni (ultimi 30 giorni)
Grace
Grace il 4 Set 2022
Commentato: Grace il 4 Set 2022
I want to plot the mirror image of a cubic curve.
In other words, I intend to flip the plot, but I do not want the x- axis to change.
This is my code and the plot. Thank you
clear all;close all;clc;
x=linspace(0, 100);
y=x.^3;
plot(x,y,'LineWidth', 2);set(gca,'xdir','reverse')

Risposta accettata

Walter Roberson
Walter Roberson il 4 Set 2022
clear all;close all;clc;
x=linspace(0, 100);
y=x.^3;
plot(x,fliplr(y),'LineWidth', 2);set(gca,'xdir','reverse')
  5 Commenti
Walter Roberson
Walter Roberson il 4 Set 2022
... but that is the one you started with ??
Grace
Grace il 4 Set 2022
I meant the seond plot (without counting the 'original plot')

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Interactive Control and Callbacks in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by