Wed 13 Oct 2010 02:16:08 PM UTC, comment #2:
Ben,
Thanks for the quick reply. Also, for those that are currently stuck with the older versions of Octave, I found this work around.
Print to a postscript file, then run ps2eps on the postscript file. This preserves the font sizes, and it also corrects the bounding box problem
|
Tue 12 Oct 2010 07:53:29 PM UTC, original submission:
Octave allows the fontsize to be changed on plots. However, when printing these plots to an eps file, the changed attributes are not saved. Experimentation found that when printing to a postscript file, the changed attributes were saved (see below for a reason why this didn't result in a good work around). Consider the following code:
fs = 18;
text(v(1,1)+2,v(2,1)+2.8,'y1','FontSize',fs)
text(v(1,2)+2.2,v(2,2)+3,'y2','FontSize',fs)
grid on
xlabel('x1','FontSize',fs);
ylabel('x2','Fontsize',fs);
set(gca,'Fontsize',fs)
print -dpsc test.ps
print -depsc2 test.eps
Viewing the test.eps file with gv showed that the fontsize was not saved as 18. However, viewing test.ps shows that the fontsize was indeed changed to 18.
Interestingly, the .ps output also gives a bounding box. So I used the following initially as a workaround:
print -dpsc test.eps
However, the problem is that the -dpsc does not give a tight bounding box (there was a lot of white space around the figure).
The attached file gives a full working example.
|