Obtain the desired orientation without reversing the direction of the two axes

3 views (last 30 days)
Hi! How can I get the right figure without reversing the direction of the two axes?
p.s. The figure on the right is created by me and there may be errors on the real (y) coordinates of the matrix.
data = importdata("data.txt");
figure
plot(data(:,2), data(:,1), 'b.', 'MarkerSize', 10);
axis equal
xlim([0 512]);
ylim([0 512]);

Accepted Answer

Star Strider
Star Strider on 19 Dec 2022
Try something like this —
data = readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1236147/data.txt');
figure
plot(data(:,2), data(:,1), 'b.', 'MarkerSize', 10);
axis equal
xlim([0 512]);
ylim([0 512]);
yt = yticks;
yticklabels(flip(yt))
.

More Answers (0)

Categories

Find more on Graphics Performance in Help Center and File Exchange

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!