I want to change the font of pie chart in this code. However, I could not change. Thank you!
width = 6; % Width in inches
height = 3; % Height in inches
alw = 0.75; % AxesLineWidth
fsz = 14; % Fontsize
lw = 1.5; % LineWidth
msz = 8; % MarkerSize
legl1=5; % legen length size
legl2=5; % legen length sizeLOC='northwest'; % location of legend
%fig = figure; clf
close all%% Vs=340 Rl=200
figure (1)subplot(1,2,1)hold onX1 = categorical({'S_1','S_2','L_p','L_r','C_{link}','D'});X1 = reordercats(X1,{'S_1','S_2','L_p','L_r','C_{link}','D'});X= [0.16 0.093 0.25 ; 0.06 0.125 0.185; 0 2.44 2.44 ; 0 1.8 1.8 ; 0 3.5 3.5 ; 0 1.6 1.6 ];bar(X1,X);%title('Second Subplot','fontName','Times')
ylabel('Power losses (W)','fontName','times','FontSize',20);%xlabel('f_s/f_0','fontName','Time new Roman','FontSize',20);
pos = get(gcf, 'Position');leg=legend('Switching Loss' ,'Conduction Loss','Total Loss','boxoff','Location',LOC);leg.ItemTokenSize = [legl1,legl2];set(gcf, 'Position', [pos(1) pos(2) width*100, height*100]); %<- Set size
set(gca, 'FontSize', fsz, 'LineWidth', alw,'fontname','times'); %<- Set propertieslegend('Conduction Loss','Switching Loss','Total Loss','fontName','Time new Roman');
ylim([0 4])hold offb2=subplot(2,2,2);X1= [(2.1*100/7.3) (3.5*100/7.3) (3*100/7.3) ];explode = {'Inverter(28%)','Resonant tank(48%)','Rectifier (24%)'};pie(X1,explode);hold onset(gcf, 'Position', [pos(1) pos(2) width*100, height*100]); %<- Set sizeset(gca,'fontName','times', 'FontSize', fsz, 'LineWidth', alw); %<- Set properties
dx0 = -0.06;dy0 = -0.4;dwithx = 0.1;dwithy = 0.23;set(b2,'position',get(b2,'position')+[dx0,dy0,dwithx,dwithy],'fontName','times')set(gca,'LooseInset', max(get(gca,'TightInset'), 0.08),'fontName','times')hold off
Best Answer