Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Can';t更改Matlab子批次中的xtick字体大小_Matlab - Fatal编程技术网

Can';t更改Matlab子批次中的xtick字体大小

Can';t更改Matlab子批次中的xtick字体大小,matlab,Matlab,我想更改x&y记号标签的字体大小,但只能更改y记号标签的大小 以下是仅更改y记号标签字体大小的代码: figure(1); for z=1:length(percentsolar) for i=1:h percentimprovement4(:,i) = percentimprovement2(1,:,i,z,1); end ax(z) = subplot(3,2,z); boxplot(percentimprovement4); set(

我想更改x&y记号标签的字体大小,但只能更改y记号标签的大小

以下是仅更改y记号标签字体大小的代码:

figure(1);
for z=1:length(percentsolar)
    for i=1:h
        percentimprovement4(:,i) = percentimprovement2(1,:,i,z,1);
    end
    ax(z) = subplot(3,2,z);
    boxplot(percentimprovement4);
    set(ax(z), 'fontsize', 6);
    ylabel('% improvement', 'fontsize',8,'fontweight', 'bold');
    xlabel('Hour of the day', 'fontsize', 8,'fontweight', 'bold');
    title(['PF improvement for ', num2str(percentsolar(z)),'% solar penetration'], 'fontsize', 10 ,'fontweight', 'bold');
    clear percentimprovement4
end
linkaxes(ax);
saveas(gcf,'Boxplotshourly.jpg');
如文所述:

boxplot()对Y轴使用默认轴标签,但对X轴使用默认轴标签 在坐标轴上,它使用text()将标签放置到位,而不使用 抓取轴的大小,当它这样做

因此,除了
set(ax(z),'fontsize',6)您还应该使用
set(findobj(ax(z),'Type','text'),'FontSize',6)。比如说,

figure(1);


percentsolar = zeros(1,6);

 z = 6;
 ax = zeros(0, length(percentsolar));

 for z = 1:length(percentsolar)
    ax(z) = subplot(3,2, z);

    x1 = normrnd(5,1,100,1);
    x2 = normrnd(6,1,100,1);


    boxplot([x1, x2]); 
    set(ax(z), 'fontsize', 6);
    set(findobj(ax(z),'Type','text'),'FontSize',  6);

    ylabel('% improvement', 'fontsize',8,'fontweight', 'bold');
    xlabel('Hour of the day', 'fontsize', 8,'fontweight', 'bold');
 end