bolding x axis label in a subplot figure

5 次查看(过去 30 天)
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