필터 지우기
필터 지우기

how can I change the font size in a figure that have more than 2 axis?

조회 수: 2 (최근 30일)
Mohammad
Mohammad 2014년 1월 16일
댓글: Walter Roberson 2014년 1월 16일
I have a figure that has more than 2 axis ( it has so called children). How can I change the font size for all the numbers and the texts in the figure?
the code bellow changes only the fontsize from the 2 main axis.
set(gcf,'paperunits','centimeters');
set(gcf,'paperposition',[1 1 a(1) a(1)*(1/a(2))]);
textobj=findobj('type','test');
set(textobj,'fontunits','points');
set(textobj,'fontsize',11);
set(gca,'fontsize',11);
set(findall(gca,'type','text'),'fontsize',11);
set(findall(gcf,'type','text'),'fontsize',11);

답변 (1개)

Walter Roberson
Walter Roberson 2014년 1월 16일
You have
textobj=findobj('type','test');
with 'test' instead of 'text'
  댓글 수: 2
Mohammad
Mohammad 2014년 1월 16일
hey! how did you see that :D Thank you!! but I've corrected that. the main problem is solved but still the other axis don't change!
Walter Roberson
Walter Roberson 2014년 1월 16일
You start with using findobj() but your later calls are findall(). findobj() defaults to starting with the root object, 0, but it does not find hidden objects. Depending on how you created your plots, some of the axes might be hidden objects; that happens for legend axes for example. findall() would be more robust.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by