|
From: Jonathan T. <jt...@as...> - 2010-03-28 17:13:28
|
I have stumbled on what looks to me like a bug in postscript dash
patterns when using parametric mode. In particular, when using
'set term postscript eps', the 'with lines linetype 2' dash pattern
seems to differ between
(a) plotting a certain horizontal line (about 3 dashes long) using a
pair of of parametric functions to specify x and y, versus
(b) plotting that same horizontal line using '-' inline data to explicitly
specify the endpoint coordinates of the line.
(b) produces the usual dash pattern, while (in my test case) (a) seems
to be broken.
In particular, consider the gnuplot script given below. (This is
abstracted from a larger "real-world" script.) Notice that this draws
two dashed lines of the same length, both 'with lines linetype 2'.
Using gnuplot 4.2.6 compiled from source ('show version long' output
also given below), this produces an eps file showing a pair of labelled
dashed lines. Viewing the eps file with gv (version 3.5.8p5, based on
ghostscript 8.63p7), the left dashed line (the one specified by a pair
of parametric functions) has a dash pattern which looks like this:
------- ------- -------
This does not match the dash pattern of other 'with lines linetype 2'
plots in my real-world script. :( In contrast, the right dashed line
(the one specified by explicit endpoint coordinates) has a dash pattern
which looks like this:
------- ------- -------
This *does* match the dash pattern of other 'with lines linetype 2' plots.
To me, this (the left dash line's wierd dash pattern) looks like a bug.
I have checked that the wierd dash pattern is unchanged when I disable
antialiasing in gv.
--- begin gnuplot script ---
set term postscript eps enhanced monochrome 18 size 8cm,8cm
set output 'par-dash.eps'
unset key
set lmargin 9.0
set rmargin 2.5
unset xtics
unset ytics
unset x2tics
unset y2tics
unset xlabel
unset ylabel
set border 0
set xrange [20:40]
set yrange [0.0:1.0]
set parametric
set dummy ell
set trange [0:1]
# map t=[0:1] --> [a:b]
map(a,b,t) = a + (b-a)*t
f6_x = 20.00
f8_x = 33.00
dash_dx = 1.00
dash_y = 0.1625
label_dx = 1.50
label_dy = 0.00
set label "f_6(ell) parametric fn" at f6_x+label_dx, dash_y+label_dy
set label "f_6(ell) data" at f8_x+label_dx, dash_y+label_dy
plot f6_x+map(0,dash_dx,ell), dash_y \
notitle \
with lines linetype 2 linewidth 3.0 linecolor -1, \
'-' \
notitle \
with lines linetype 2 linewidth 3.0 linecolor -1
# data for '-' plot above
33.00 0.1625
34.00 0.1625
eof
set output
--- end gnuplot script ---
--- begin 'show version long' output ---
gnuplot> show version long
G N U P L O T
Version 4.2 patchlevel 6
last modified Sep 2009
System: OpenBSD 4.6
Copyright (C) 1986 - 1993, 1998, 2004, 2007 - 2009
Thomas Williams, Colin Kelley and many others
Type `help` to access the on-line reference manual.
The gnuplot FAQ is available from http://www.gnuplot.info/faq/
Send bug reports and suggestions to <http://sourceforge.net/projects/gnuplot>
Compile options:
-READLINE +LIBREADLINE -HISTORY +BACKWARDS_COMPATIBILITY +BINARY_DATA
+GD_PNG +GD_JPEG +GD_TTF +GD_GIF +ANIMATION
-NOCWDRC +X11 +X11_POLYGON +MULTIBYTE +USE_MOUSE +HIDDEN3D_QUADTREE
+DATASTRINGS +HISTOGRAMS +OBJECTS +STRINGVARS +MACROS +IMAGE
DRIVER_DIR = "/usr/local/libexec/gnuplot/4.2"
GNUPLOT_PS_DIR = "/usr/local/share/gnuplot/4.2/PostScript"
HELPFILE = "/usr/local/share/gnuplot/4.2/gnuplot.gih"
gnuplot>
--- end 'show version long' output ---
ciao,
--
-- "Jonathan Thornburg [remove -animal to reply]" <jt...@as...>
Dept of Astronomy, Indiana University, Bloomington, Indiana, USA
"C++ is to programming as sex is to reproduction. Better ways might
technically exist but they're not nearly as much fun." -- Nikolai Irgens
|