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

1 回表示 (過去 30 日間)
Alberto Acri
Alberto Acri 2022 年 12 月 19 日
回答済み: Star Strider 2022 年 12 月 19 日
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 Center および File ExchangeGraphics Object Programming についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by