How to rotate graph?

3 vues (au cours des 30 derniers jours)
SuzieChan
SuzieChan le 13 Avr 2020
Commenté : Adam Danz le 13 Avr 2020
Hi!
What code can I use to flip the orange portion of this graph in the vertical plane, 180 degrees?
>> figure
hold on
scatter(A{:,1}, A{:,2})
% Flip the next line in the veritcal plane
scatter(B{:,1}, B{:,2})

Réponse acceptée

Adam Danz
Adam Danz le 13 Avr 2020
Modifié(e) : Adam Danz le 13 Avr 2020
ax = gca();
ax.XDir = 'reverse';
% or
ax.YDir = 'reverse';
To flip the data vertically rather than the axes,
scatter(x, fliplr(y))
% or
scatter(x, flipud(y))
  2 commentaires
SuzieChan
SuzieChan le 13 Avr 2020
Modifié(e) : SuzieChan le 13 Avr 2020
figure
hold on
scatter(A{:,1}, A{:,2})
ax = scatter(B{:,1}, B{:,2})
ax = gca();
ax.XDir = 'reverse';
This code flips BOTH blue and orange parts (I think because they are connected to the same axis).
I think I must split the x-axis to reverse only the orange part, right?
Adam Danz
Adam Danz le 13 Avr 2020
Answer updated.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by