フィルターのクリア

Change direction of the Y-axis for a single figure

5 ビュー (過去 30 日間)
Alberto Acri
Alberto Acri 2022 年 11 月 1 日
I have the following code:
figure();
% BLACK CURVE plot
open_jpg = imread('fig_01_JPG.jpg');
image(open_jpg);
axis equal
xlim([90 190]);
ylim([210 320]);
set(gca, 'YDir','normal')
hold on
% BLUE CURVE plot
Im = imread('fig_01_JPG.jpg');
CoordinateMatrix = pic2points(Im);
scatter(CoordinateMatrix (:,1), CoordinateMatrix (:,2),'.');
% ax = gca;
% ax.YDir = 'reverse'
% set(gca, 'YDir','normal')
hold off
I would like to change ONLY the direction of the Y axis of the figure with the black curve so that it overlaps exactly with the blue curve of the other figure.
I tried using the "reverse" or "normal" command but it only applies it to the global figure.
% ax = gca;
% ax.YDir = 'reverse'
% set(gca, 'YDir','normal')

回答 (1 件)

Constantino Carlos Reyes-Aldasoro
Constantino Carlos Reyes-Aldasoro 2022 年 11 月 1 日
  2 件のコメント
Alberto Acri
Alberto Acri 2022 年 11 月 1 日
I actually have to invert the image with the black curve (in this case flip along the x-axis) so that the image with the black curve is equal to the blue curve. By rotating the image with the black curve I do not get the desired result :)
Constantino Carlos Reyes-Aldasoro
Constantino Carlos Reyes-Aldasoro 2022 年 11 月 1 日
Have you tried
maxV = max(CoordinateMatrix (:,2));
scatter(CoordinateMatrix (:,1), maxV - CoordinateMatrix (:,2),'.');
This may work.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLighting, Transparency, and Shading についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by