Save image with specific x and y limits

조회 수: 1 (최근 30일)
Bleron Preniqi
Bleron Preniqi 2019년 5월 20일
댓글: Bleron Preniqi 2019년 5월 20일
How can I save an image with fixed x and y limits?
In the specific I want to save an image with x limits -0.4 - 0.4 and y limits -0.4 - 0.4.
But when I save the image the limits are bigger.
plot(camera.Points(:,1),camera.Points(:,2),'rx','marker','o','color','white','MarkerSize',size,'MarkerFaceColor','k');
axis([-.4 .4 -.4 .4]);
set(gca,'Color','black','XTickLabel',[],'YTickLabel',[]);
set(gca,'visible','off');
daspect([1 1 1]);
hfig = figure;
hax_new = copyobj(hax, hfig);
set(hax_new, 'Position', get(0, 'DefaultAxesPosition'));
saveas(gcf,fullfile('../Data/img',sprintf('/Image%04d.jpg', i)));
  댓글 수: 2
Walter Roberson
Walter Roberson 2019년 5월 20일
What is hax? If it is a known axes then why are you using gca?
Bleron Preniqi
Bleron Preniqi 2019년 5월 20일
sorry, hax is
hax = subplot(1,2,2);
.. the subplot that I want to save. Now I corrected gca with hax but it doesn't work.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by