gnuplot splot with hidden3d always colored, even with monochrome postscript option - gnuplot

I'm using gnuplot 4.6 patchlevel 4. I encountered the following problem:
set terminal postscript eps monochrome
set output "test.eps"
splot x*y
produces a monochrome plot as requested, but
set terminal postscript eps monochrome
set output "test.eps"
set hidden3d
splot x*y
produces a colored plot.
I'm pretty sure that worked with earlier gnuplot versions. Is this a bug? Is there a workaround?
Thanks for your help!
(I saw that there was another problem with splot colors in an earlier version
(Issue regarding colors in splot), was the new problem possibly introduced in the bug fix?)

Related

Gnuplot 5.4 ylabel collapse [duplicate]

I use gnuplot 5.4.5 for processing the following script:
set key enhanced font "Monospaced,13"
set grid
set style line 1 \
linecolor rgb '#a82828' \
linetype 1 linewidth 3 \
pointtype 5 pointsize 1.0
set xlabel "Entropy"
set xrange [-0.05:1.05]
set ylabel "Amortized work"
set terminal png enhanced font "Monospaced,13" size 500,350
set output 'EntropyToAmortizedWork.png'
plot 'EntropyToAmortizedWork.dat' with linespoints linestyle 1 notitle
replot
exit
The file EntropyToAmortizedWork.dat lives here.
All in all, I get:
Clearly, we have a typesetting artifact. How could I deal with it?
I can reproduce this on Win10 with gnuplot 5.4.5 and terminal png, but not with gnuplot 5.4.4.
Even terminal pngcairo seems to have a problem with 5.4.5, check the missing horizontal lines on some xticlabels.
So, suggested solution would be to go back to gnuplot 5.4.4 or earlier versions.
This would be a minimal script (no need for data).
Script:
### wrong ylabel with 5.4.5 and png terminal
reset session
set ylabel "This is the y-label"
set term png size 640,384
set output "SO74179232_png.png"
plot x
set term pngcairo size 640,384
set output "SO74179232_pngcairo.png"
plot x
set output
### end of script
Results:
gnuplot 5.4.5, terminal png
gnuplot 5.4.5, terminal pngcairo
gnuplot 5.4.4, terminal png
gnuplot 5.4.4, terminal pngcairo

gnuplot, postscript: no coloring via linestyle

In the below code, the appearance of the curve plotted takes into account linetype and linewidth but it completely ignores linecolor.
set style line 1 linetype 1 linewidth 10 linecolor rgb "blue"
plot \
myfile using 1:2 with lines linestyle 1
I have tried to change the order of these items, as well as different ways of specifying color, eg. "#0000FF" instead of "blue".
How can I change this to have the curve take on the color specified via linestyle 1?
This is gnuplot 5.4 on Mac OS / Big Sur, tried with "Terminal" and "iterm2".
IMPORTANT UPDATE
I'm using set term postscript eps. When i change this to set term pngcairo everything is ok.
So my updated question is: How to make this work also with set term postscript eps?
Apparently, the default setting for the postscript terminal is monochrome and you have to explicitely set color. I remember having seen similar questions in the past. I don't know why default is monochrome, maybe historical reasons? So, it seems to be a recurring "pitfall", since users nowadays think everything is in color per default ;-).
set term postscript eps color
That's what I get (on a "fresh" console) if I type set term postscript eps. Apparently, text is in color per default (i.e. labels and arrows), but the rest seems to be monochrome.
Options are 'eps enhanced defaultplex \
leveldefault monochrome colortext \
dashlength 1.0 linewidth 1.0 pointscale 1.0 butt noclip \
nobackground \
palfuncparam 2000,0.003 \
"Helvetica" 14 fontscale 1.0 '
set term epslatex
...and it works! (since i wanted "eps", and got "eps").
Incidentially (although it produces "png" instead of "eps") set term pngcairo and possible many more "term"s also work.
Strange thing is that I didn't get any warning when plotting with set term postscript eps that gnuplot was not able to apply the linestyle coloring with that terminal mode.

Inkscape crops eps files generated with gnuplot

I have a script file to generate an eps file with gnuplot. The basics of this script are:
set terminal postcript enhanced color size 30,20 font 'Times-ew-Roman,40'
set xtics -.5,0.125
set ytics 0.1,0.1
set xrange [-0.5,.5]
set yrange [0.,1.6]
set cbrange [-0.5,.5]
set output "file.eps"
plot #whatever i plot
This script generates an eps file, which I can open in ubuntu and I can see is well printed. Now, I want to import this eps into inkscape, but when importing inkscape imports a big frame with only the top left drawn. The rest is blank. Do I have to change anyvalue in my gnuplot script or do something else with inkscape? I tried to open it in inskcape windows and ubuntu versions, and in both cases it happens the same with the same file.
The problem may be that you have not actually asked gnuplot to produce an eps image. Instead you produced a generic PostScript document with a page size that does not match the default. You need to put the keyword "eps" in your terminal command:
set term postscript eps color size 30,20 font "Times-New-Roman,40"

How to show prime symbol in gnuplot

I want to show SS' in the xtics of a graph. I don't know how I can have the prime symbol in gnuplot like it is shown on latex like this : SS$'$?
ps: This is the terminal setting I have:
set terminal postscript eps size 8.5cm, 7cm dashed
dashlength 3.0 enhanced color font 'Helvetica,10'
Use the epslatex terminal instead, and just use latex syntax:
set terminal epslatex color dashed standalone size 8.5cm,7cm
set output "out.tex"
set label "This is a prime symbol: $'$" at graph 0.5,0.5 center
plot sin(x)

Why doesn't the gnuplot grid extend over this whole plot?

Using gnuplot 4.6 patchlevel 1, with the following commands,
set grid linewidth 1 linecolor rgb"#888888"
set datafile separator ","
plot for [n=2:100] "data.csv" using 1:(column(n)) with lines linewidth 2
and the following example data in the file "data.csv",
time,S1,S2
0,0.00015,0
0.1,0.0001357256127053939,1.427438729460607e-005
0.2,0.0001228096129616973,2.719038703830272e-005
0.3,0.0001111227331022577,3.887726689774233e-005
0.4,0.0001005480069053459,4.945199309465411e-005
0.5,9.097959895689501e-005,5.902040104310499e-005
0.6,8.232174541410396e-005,6.767825458589604e-005
0.7,7.448779556871142e-005,7.551220443128858e-005
0.8,6.739934461758323e-005,8.260065538241677e-005
0.9,6.098544896108986e-005,8.901455103891014e-005
1,5.518191617571635e-005,9.481808382428365e-005
the resulting plot looks this:
Question: why does the grid only extend partway from the bottom, and not cover the whole plot? I tried a considerable amount of experimentation with the set xtics and ytics commands, arguments to grid, and more, and have not been able to get the grid to cover the whole plot. What am I missing?
Great question! In fact, the answer is that the grid does cover the whole plot. The problem is that the key is taking over. Try it again, but with an unset key in there before your plot command.
What's happening is that gnuplot is reserving space in the key for all of the columns which have no data. Nothing gets put in the space that was reserved since no reasonable data was found. Ultimately, this pushes the 2 lines that were visible out of the viewable canvas area as well.
I've reproduced this using the x11, png, postscript and pngcairo terminals.
Note that this behavior seems to be version dependent:
With gnuplot 4.4.2 (OS-X, png terminal)
With gnuplot 4.6.0 (OS-X, png terminal)
For those using gnuplot 4.4.4, perhaps there was a bug fix which made it work for gnuplot 4.4.4 and then a regression. It seems to persist into gnuplot 4.7.0 as well. I might file a bug report.

Resources