简体   繁体   English

Octave字体和大小更改的问题

[英]Problems with Octave font and size changes

I would like help with a problem that I am having in Octave 3.6.4 on Ubuntu 13.04. 我想在Ubuntu 13.04的Octave 3.6.4中遇到的问题寻求帮助。

I have looked up a number of ways to change the font size and/or the font of the legend, the title, or the axes of a plot; 我已经找到了多种方法来更改字体大小和/或图例,标题或绘图轴的字体; and I have found that the code that I find does not work. 并且我发现我找到的代码不起作用。 I have tried copying in a number of snippets of code meant to change the size of text or font, and I haven't been able to change them. 我尝试复制一些代码段来更改文本或字体的大小,但是我无法更改它们。

The font that Octave shows when outputting a graph is a normal fixed-width font. Octave输出图形时显示的字体是常规的固定宽度字体。

Can anyone help me? 谁能帮我? I have tried things such as... 我已经尝试过诸如...

xlabel('x-title', 'FontSize', 20)

or 要么

xlabel('x-title', 'FontName', 'Vera')

or 要么

foo = xlabel('x-title')
set(foo, 'FontSize', 20)

or 要么

foo = xlabel('x-title)
set(foo, 'FontName', 'Vera')

And none change the font. 而且没有改变字体。

I have the same problem with Octave 3.6.4 and Ubuntu 12.04. 我对Octave 3.6.4和Ubuntu 12.04有相同的问题。 If you don't care how the figure looks in Octave but just how it looks when outputted to file, then this should work: 如果您不在乎图形在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");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM