bolding x axis label in a subplot figure

조회 수: 5 (최근 30일)
Jessica
Jessica 2015년 1월 25일
댓글: Star Strider 2015년 1월 25일
I am trying to make the x-axis label bold in a subplot, such as the one below. The Y axis labels are bold but the bold command doesn't seem to work for the x axis.
figure % create new figure
Axis1=1;
Axis2=5;
ChartTime2=[1 2 3 4 5];
X_Chart=[.2 .1 .4 .5 .6];
Y_Chart=[.3 .4 .5 .7 .1];
Z_Chart=[.1 .5 .4 .4 .4];
ha(1)=subplot(3,1,1); % first subplot
plot(ChartTime2,X_Chart,'k')
axis([Axis1 Axis2 -1 1])
ylabel('X', 'fontsize',14,'FontWeight','bold');
ha(2)=subplot(3,1,2); % second subplot
plot(ChartTime2,Y_Chart,'k')
axis([Axis1 Axis2 -1 1])
ylabel('Y', 'fontsize',14,'FontWeight','bold');
ha(3)=subplot(3,1,3); % third subplot
plot(ChartTime2,Z_Chart,'k')
axis([Axis1 Axis2 -1 1]); %Set axis and then use hand tool to move through graph
ylabel('Z', 'fontsize',14,'FontWeight','bold');
xlabel('Time (sec)', 'fontsize',14,'FontWeight','bold');
  댓글 수: 1
Star Strider
Star Strider 2015년 1월 25일
You don’t mention the version of MATLAB you’re using, since there may be version differences.
In 2014b (with the default options) they all appear bold, as you specified them to be. I can’t reproduce the problem you’re seeing, so I’m not submitting this an an Answer.
Another option might be to use the TeX control character:
ylabel('\bfY\rm', 'fontsize',14);

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

채택된 답변

Chad Greene
Chad Greene 2015년 1월 25일
Try changing the figure renderer ( set(gcf,'renderer','opengl') or set(gcf,'renderer','painters') ). Sometimes the fontweights are actually set the way you want them even though it does not look like it in the figure window. Sometimes you have to use export_fig to save the image, and then you'll see that the font is actually bold.

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by