bolding x axis label in a subplot figure

5 visualizzazioni (ultimi 30 giorni)
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 Commento
Star Strider
Star Strider il 25 Gen 2015
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);

Accedi per commentare.

Risposta accettata

Chad Greene
Chad Greene il 25 Gen 2015
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.

Più risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by