bolding x axis label in a subplot figure

7 ビュー (過去 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 Center および File ExchangeAxis Labels についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by