[No axis labels in jpeg plot]
Dmitri A. Sergatskov
dasergatskov at gmail.com
Fri Sep 19 15:01:45 CDT 2008
On Fri, Sep 19, 2008 at 12:13 PM, Robert McDonald
<r-mcdonald at kellogg.northwestern.edu> wrote:
> Bug report for Octave 3.0.2 configured for i686-pc-cygwin
>
> Description:
> -----------
>
> Axis labels on plots are lost when printing to a file in jpeg format
>
> Repeat-By:
> ---------
>
> Run this program and compare the resulting plots:
>
> x=1:10;
> plot(x,x);
> xlabel('X axis');
> ylabel('Y axis');
> print -deps test.eps;
> print -djpg test.jpg;
>
First of all -- you should not be using jpeg for line-art.
The artifacts due to compressiom would make it look ugly.
Just try plot (x, sin(x)) to see how bad it is.
Second, gnuplot backend uses gd library to make jpeg or png
files. The gd library uses true type fonts and Helvetica is not it.
So perhaps this can be considered a bug in octave that it
set default font to Helvetica rather than to arial for the proper
terminals. As a workaround you can specify font in the [xy]label
commands, e.g.:
xlabel ("Time, seconds", "fontname", "arial", "fontsize", 18)
Note the "arial" here is a name of arial.ttf file in "standard"
directory. You can specify non-standard directory by
setting GDFONTPATH variables prior to starting octave, e.g.:
GDFONTPATH=/path/to/ttf_fonts octave
Workaround #2 is to use postscipt terminal and than convert
the postscript file to jpeg, using ghostscript or similar.
Sincerely,
Dmitri.
--
More information about the Bug-octave
mailing list