Does anyone know how to increase legend font-size in octave?
Asked
Active
Viewed 3.1k times
5 Answers
7
Not sure if this was a solution when the OP was submitted, but this is pretty easy now:
h = legend({"foo","bar"});
set (h, "fontsize", 16);

sg_man
- 763
- 1
- 6
- 14
4
This worked for me (kubuntu 9.04, octave 3.2.2)
print("plot.eps","-deps", "-F:30")
This forces all text elements in figure to be printed with font size 30. See also octave function: print.
-
That worked for me. Luckily, I've moved on to a better plotting and computation option since my days with octave. Python, numpy, and matplotlib rock! – cpatrick Jan 07 '10 at 14:47
4
Based on another Posting on Stackoverflow I found the following solution.
copied_legend = findobj(gcf(),"type","axes","Tag","legend");
set(copied_legend, "FontSize", FontSize);
GNU Octave, version 3.6.3
Matlab: How to obtain all the axes handles in a figure handle?
-
/EDIT2: it does work correctly for fontsize, but if you try to set fontweight to bold it will take effect only on the legend symbols, not the legend text. However this bug happens only inside the gnuplot window, if you print into a file, the legend text is correctly bolded, and the symbols are reverted to non-bold (probably another issue of Octave with gnuplot...). – gaborous Nov 07 '14 at 13:43
2
Try the following:
'{\fontsize{12} legend1-text}'
Where you have to include it for every legend text. My command, that actually worked, was:
legend('{\fontsize{10} Low }', '{\fontsize{10} Medium }', '{\fontsize{10} High }')

Jav_Rock
- 22,059
- 20
- 123
- 164

Khaled Alanezi
- 351
- 4
- 12