Filter löschen
Filter löschen

Font problems when exporting box plot with Greek letters

1 Ansicht (letzte 30 Tage)
Christian
Christian am 30 Nov. 2015
Beantwortet: Abhinaya Kennedy am 17 Jun. 2024
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:

Antworten (1)

Abhinaya Kennedy
Abhinaya Kennedy am 17 Jun. 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.

Kategorien

Mehr zu Labels and Annotations 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!

Translated by