I am puzzled by a strange behaviour when trying to set the line styles
and colors in the contour-plots.
I'll try to describe it through a reproducible example.
I am using gnuplot 4.2 patchlevel 6.
- SURFACE PLOT and CONTOUR PLOT
set style line 2 lc rgb "black" lw 2 lt 1
set style line 3 lc rgb "orange" lw 2 lt 4
set style increment user
set iso 30
set hidden
set contour both
f(x,y) = exp(-(x**2 + y**2))*cos(x/4)*sin(y)*cos(2*(x**2+y**2))
splot [-2:2][-2:2] f(x,y)
set terminal postscript color enhanced
set output "case_3D.ps"
replot
What do we have here?
- the 3D plot is fine (red and solid line, I did not touch it infact)
- the first color contour is solid, width = 2, but is RED, not BLACK
(despite having indicated lc rgb "black")
- the second color contour is dotted, width = 2, but is PINK, not
ORANGE!
- the key (legend) is surprisingly right, showing a black solid and an
orange dotted sample lines which do not exist in the contour plot
proper...
I am confused here... it seems that if I specify the line style, that
determines also the color, overriding my specifications.
Any suggestions?
Thank you.
Ekrenor
Is there any possibility that this will be fixed in a new version?
Or at least, could someone kindly suggest me a workaround enabling me
to specify both color and style of each contour line?
Thank you very much.
E.
> It appears that this is a bug, as confirmed also by Mr. Janert (the
> author of gnuplot in action).
>
> Is there any possibility that this will be fixed in a new version?
There is a patchset on Sourceforge that replaces
"set linestyle + set increment user" with a more general mechanism
that allows you to redefine the properties of the individual
line types.
#2004590 mechanism to redefine base linetypes
The development focus has been on getting version 4.4 released
rather than on polishing the various new-feature patches that
have been contributed. Once 4.4 is out, then new stuff like
user-defined linetypes will start being added to the development
version.
> Or at least, could someone kindly suggest me a workaround enabling me
> to specify both color and style of each contour line?
The only fix I know of at the moment is to apply the patchset
mentioned above. I've just confirmed that it works properly
with the linetypes in contour plots.
Ethan
Thank you.
E.