简体   繁体   中英

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.

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.

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. If you don't care how the figure looks in Octave but just how it looks when outputted to file, then this should work:

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");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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