網(wǎng)上的介紹真是良莠不齊,終于自己摸索出來?。?!
1,如果要把圖例標(biāo)注的文字加粗,則在legend1參數(shù)里面
%這句參數(shù)可修改圖例標(biāo)注的位置,和字體,耶,'Location','SouthEast'
legend1=legend('FontName','Times New Roman',tmpName,'Interpreter', 'none','fontsize',fontSizeLegend,'Location','SouthEast');
title(titleName,'fontsize',fontSize,'FontName','Times New Roman');
xlabel(xLabelName,'fontsize',fontSize,'FontName','Times New Roman');
ylabel(yLabelName,'fontsize',fontSize,'FontName','Times New Roman');
set(gca,'fontweight','bold');%添加這句可以增加橫縱坐標(biāo)軸粗細(xì)
2,如果只要把x軸刻度加粗,那就更改xlabel里面的參數(shù)'fontweight','bold'
3,如果只要把y軸刻度加粗,那就更改ylabel里面的參數(shù)'fontweight','bold'文章來源:http://www.zghlxwxcb.cn/news/detail-507875.html
可能代碼不夠完整,這個是我數(shù)據(jù)集benchmark的源代碼,也是在這個基礎(chǔ)上加粗字體文章來源地址http://www.zghlxwxcb.cn/news/detail-507875.html
function plotDrawSave(numTrk,plotDrawStyle,aveSuccessRatePlot,idxSeqSet,rankNum,rankingType,rankIdx,nameTrkAll,thresholdSet,titleName,xLabelName,yLabelName,figName,metricType)
aveSuccessRate11=[];
scrsz = get(0,'ScreenSize');
for idxTrk=1:numTrk
%each row is the sr plot of one sequence
tmp=aveSuccessRatePlot(idxTrk, idxSeqSet,:);
aa=reshape(tmp,[length(idxSeqSet),size(aveSuccessRatePlot,3)]);
aa=aa(sum(aa,2)>eps,:);
bb=mean(aa);
switch rankingType
case 'AUC'
perf(idxTrk) = mean(bb);
case 'threshold'
perf(idxTrk) = bb(rankIdx);
end
end
[tmp,indexSort]=sort(perf,'descend');
i=1;
AUC=[];
fontSize = 16;
fontSizeLegend = 10;
figure1 = figure;
axes1 = axes('Parent',figure1,'FontSize',14);
set(gca,'fontweight','bold'); %可以加粗圖例的字體
for idxTrk=indexSort(1:rankNum)
tmp=aveSuccessRatePlot(idxTrk,idxSeqSet,:);
aa=reshape(tmp,[length(idxSeqSet),size(aveSuccessRatePlot,3)]);
aa=aa(sum(aa,2)>eps,:);
bb=mean(aa);
switch rankingType
case 'AUC'
score = mean(bb);
tmp=sprintf('%.3f', score);
case 'threshold'
score = bb(rankIdx);
tmp=sprintf('%.3f', score);
end
tmpName{i} = [nameTrkAll{idxTrk} ' [' tmp ']'];
h(i) = plot(thresholdSet,bb,'color',plotDrawStyle{i}.color, 'lineStyle', plotDrawStyle{i}.lineStyle,'lineWidth', 2,'Parent',axes1);
set(gca,'fontweight','bold');%添加的增加橫縱坐標(biāo)軸粗細(xì)
hold on
i=i+1;
end
%可修改圖例標(biāo)注的位置(右下角),和字體,耶,SouthEast
legend1=legend('FontName','Times New Roman',tmpName,'Interpreter', 'none','fontsize',fontSizeLegend,'Location','SouthWest');
%可以加粗圖例的字體
title(titleName,'fontsize',fontSize,'FontName','Times New Roman','fontweight','bold');
xlabel(xLabelName,'fontsize',fontSize,'FontName','Times New Roman');
ylabel(yLabelName,'fontsize',fontSize,'FontName','Times New Roman');
到了這里,關(guān)于matlab如何設(shè)置橫縱坐標(biāo)軸的字體粗細(xì)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!