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

2 次查看(过去 30 天)
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]);

采纳的回答

Star Strider
Star Strider 2022-12-19
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))
.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Object Programming 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by