我需要帮助解决我在 Ubuntu 13.04 上的 Octave 3.6.4 中遇到的问题。
我查找了多种方法来更改字体大小和/或图例、标题或绘图轴的字体;而且我发现我找到的代码不起作用。我尝试复制一些旨在更改文本或字体大小的代码片段,但无法更改它们。
Octave 输出图表时显示的字体是普通的等宽字体。
有人可以帮助我吗?我尝试过诸如...
xlabel('x-title', 'FontSize', 20)
或
xlabel('x-title', 'FontName', 'Vera')
或
foo = xlabel('x-title')
set(foo, 'FontSize', 20)
或
foo = xlabel('x-title)
set(foo, 'FontName', 'Vera')
并且没有改变字体。
最佳答案
我在 Octave 3.6.4 和 Ubuntu 12.04 上也遇到同样的问题。如果您不关心图形在 Octave 中的外观,而只关心输出到文件时的外观,那么这应该可行:
plot(1:10);
xlabel("example");ylabel("example");title("example");
fontsize=20;
set([gca; findall(gca, 'Type','text')], 'FontSize', fontsize);
set([gca; findall(gca, 'Type','line')], 'linewidth', 3);
hx=legend('example');set(hx, "fontsize", fontsize)
saveas(1, "presentation.jpg");
关于fonts - Octave 字体和大小更改的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18625570/