how can I change the size and font to Times New Roman of the xtickslabel that appear in the graphic? Thank you in advan
97 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Juan David Parra Quintero
am 2 Aug. 2023
Beantwortet: Voss
am 2 Aug. 2023
Hello everyone, I hope you are well, I have a question: how can I change the size and font to Times New Roman of the xtickslabel that appear in the graphic? Thank you in advance for your suggestions.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1448597/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1448597/image.png)
clc;
clear all
close all;
FONTSIZE=6.5;
Tamanioetiquetas=8;
fig=figure(1);
clf;
x1=categorical(["Estados Unidos"; "Australia"; "España"; "Alemania"; "Canadá"; "Italia"; "Reino Unido"; "China"; "India"; "Taiwán"]);
y1 = [50; 25; 23; 16; 15; 15; 14; 12; 10; 8];
b1=bar(x1,y1, 'FaceColor','flat');
ylim([0 55])
cm = gray(5); % Define 'colormap'
for k = 1:numel(b1)
b1(k).CData = cm(k+1,:); % Loop To Set Colours
end
% set(b1,{'CData'},mat2cell(cm(2:4,:),ones(size(b3))))
hTxt=arrayfun(@(h)text(h.XEndPoints,h.YEndPoints,string(h.YData), ...
'Horizontal','center','Vertical','bottom','FontSize',FONTSIZE),b1,'UniformOutput',false);
xlabel("Países","FontName","Times New Roman","FontSize",Tamanioetiquetas);
ylabel("Número de documentos","FontName","Times New Roman","FontSize",Tamanioetiquetas);
ax = gca;
ax.FontSize = Tamanioetiquetas;
0 Kommentare
Akzeptierte Antwort
Voss
am 2 Aug. 2023
ax.XAxis.FontSize = 16; % or whatever
ax.XAxis.FontName = 'Times New Roman';
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Graphics Performance finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!