Borrar filtros
Borrar filtros

Unable to change font image and latex interpreter

9 visualizaciones (últimos 30 días)
Lieke
Lieke el 8 de En. de 2024
Comentada: Lieke el 11 de En. de 2024
I'm new at learing matlab and I can't seem to change the font of an image.
I'm usig the following code:
C = [0 2 4 6; 8 10 12 14; 16 18 20 22];
imagesc(C);
ylabel('Scan Number', 'Interpreter', 'latex', 'FontName', 'Times New Roman');
xlabel('Q ($\rm{\AA}^{-1}$)', 'Interpreter', 'latex', 'FontName', 'Times New Roman');
set(gca, 'Fontsize', 12, 'FontName', 'Times New Roman');
get(gca, 'fontname')
ans = 'Times New Roman'
The get gca give me the correct font however it doesn't seem to change in the figure. The font also does not seem to change when I change it in the latex interpreter. However I am able to chage the fontsize I want to plot the symbol angstrom ^-1 in the xlabel that is why I'm using the late interpreter. I don't really mind what font it is in but now the fonts are differerent in labels and the ticks numbers and legend. I would like it to be the same font. I would appreciate any insights for either of these issues!
  2 comentarios
Dyuman Joshi
Dyuman Joshi el 8 de En. de 2024
I don't think fonts are supported in Latex Interpreter in MATLAB. If you want to implement that, you will have to write code for that, which will be a daunting task.
As for the matching of axis labels and tick labels, you can change the Tick label interpreter to latex as well -
C = [0 2 4 6; 8 10 12 14; 16 18 20 22];
imagesc(C);
ylabel('Scan Number', 'Interpreter', 'latex')
xlabel('Q ($\rm{\AA}^{-1}$)', 'Interpreter', 'latex')
set(gca, 'Fontsize', 15, 'TickLabelInterpreter', 'latex');
Lieke
Lieke el 11 de En. de 2024
Thank you for you answer. That works!

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Data Import and Export en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by