Effacer les filtres
Effacer les filtres

Font problems when exporting box plot with Greek letters

1 vue (au cours des 30 derniers jours)
Christian
Christian le 30 Nov 2015
Hello everyone,
I am trying to graph a box plot with tick-labels that include greek letters and with the entire text being in font 'Times New Roman'. When I execute the following example code, Matlab produces exactly what I want, however in the exported pdf document, the labels including Greek letters are not produced in Times New Roman. Below I also attach a snapshot of the PDF end-product.
Any suggestions on how I can get the same Times New Roman font and size for all labels, including the ones in Greek letters?
Thanks so much for any advice!
set(0,'defaultAxesFontName', 'Times New Roman')
set(0,'defaultTextFontName', 'Times New Roman')
set(0,'defaulttextfontsize', 12)
DataforBoxplot = rand(10000,5);
figure('units','normalized','outerposition',[0 0 1 1])
Label = {'Base Case' ['Case ' char(945)] ['Case ' char(946)] 'Case r' ['Case ' char(947)]};
boxplot(DataforBoxplot, Label)
title('Example graph')
ylabel('Model output')
xlabel('Model (1-3) and parameter set used')
iptsetpref('ImshowBorder','tight');
export_fig Testfile -pdf -transparent
Here is a close-up of the problem:

Réponses (1)

Abhinaya Kennedy
Abhinaya Kennedy le 17 Juin 2024
You can use the "export_fig" function. (https://www.mathworks.com/matlabcentral/fileexchange/23629). This saves Figure/axes and is reproduced as it appears on screen.

Catégories

En savoir plus sur Labels and Annotations dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by