How to change the origin axes in an image

조회 수: 8 (최근 30일)
Guillermo Arias
Guillermo Arias 2021년 5월 21일
편집: Hrishikesh Borate 2021년 5월 24일
I tried with this:
ax = gca;
ax.Visible = 'On';
set(ax, 'YTickLabel', get(ax, 'YTick')+ py1 + em1/equiv + e/2/equiv);
set(ax, 'XTickLabel', get(ax, 'XTick') + px1+((lm/2)/equiv));
I want to get the blue axes from the red, but when i execute the program it appears: Invalid or deleted object, reffering to ax.
I want to plot some data respect from the blue exes.

채택된 답변

Hrishikesh Borate
Hrishikesh Borate 2021년 5월 24일
편집: Hrishikesh Borate 2021년 5월 24일
Hi,
It’s my understanding that you are trying to change the origin axes in an image. Following is the code for the same:-
I = imread('cameraman.tif');
shiftX = -200;
shiftY = -150;
imshow(I,'Xdata',[1 size(I,1)]+shiftX,'Ydata',[1 size(I,2)]+shiftY)
ax = gca;
ax.Visible = 'On';
hold on
% Indication that the origin has shifted.
plot(0, 0, 'r+', 'MarkerSize', 30, 'LineWidth', 2)
hold off
For more information refer to imshow.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 3-D Scene Control에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by