Position of map axes in figure

조회 수: 4 (최근 30일)
Ellen
Ellen 2011년 11월 3일
댓글: Chad Greene 2014년 8월 20일
Where are the map axes? I need to their absolute position in a figure, equivalent to what is returned by get(gca,'Position') for ordinary, Cartesian axes. As shown in the example below, doing this for map axes (red) returns the default position of ordinary axes (black). Can anyone help me?
figure; hold on;
h_axm = axesm('eqdcylin','FLonLimit',[0 20],'FLatLimit',[0 20]); %Create axes
set(h_axm,'XColor',[1 0 0],'YColor',[1 0 0]); %Color map axes red
axespos = get(h_axm,'Position'); %Get position of axes
h_ax = axes('Position',axespos); %Create new axes at same position
set(h_ax,'Color','None'); %Turn off background color to show both axes

채택된 답변

Ellen
Ellen 2013년 1월 3일
This function provides the "correct" position: http://www.mathworks.com/matlabcentral/fileexchange/9615.
  댓글 수: 1
Chad Greene
Chad Greene 2014년 8월 20일
Brilliant! This solves my problem perfectly. Thanks Ellen for posting this question and answer.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Object Properties에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by