Gnuplot 5.4 ylabel collapse [duplicate] - gnuplot

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

Related

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.

Gnuplot epslatex text missing [duplicate]

I am using the following script to generate a simple eps image:
set terminal epslatex 8
set output 'sample1.tex'
set size 0.75,0.75
set xrange [-pi:pi]
set yrange [0:1.2]
set xlabel "$x$"
set ylabel "$y$"
plot sin(x)*sin(x) title "$\\sin^2(x)$"
However, when I run it in gnuplot
gnuplot> load "sample.gpi"
I got a blank image, just the grids without numbers are shown.
Any suggestion what I'm doing wrong?
You are probably viewing the sample1-inc.eps file. But you must compile the output LaTeX-file first. For this it is very convenient to use the standalone option and compile from within the script itself:
set terminal epslatex 8 standalone
set output 'sample1.tex'
set size 0.75,0.75
set xrange [-pi:pi]
set yrange [0:1.2]
set xlabel "$x$"
set ylabel "$y$"
plot sin(x)*sin(x) title "$\\sin^2(x)$"
set output # finish the current output file
system('latex sample1.tex && dvips sample1.dvi && ps2pdf sample1.ps')
Now you can load 'sample1.gpi' and view the complete output as sample1.ps or sample1.pdf. If you are on Windows you may need to compile with three separate system calls (just guessing):
system('latex sample1.tex')
system('dvips sample1.dvi')
system('ps2pdf sample1.ps')

gnuplot multiplot images in column

I'm trying to use multiplot to stack two image plots on top of one another, in a column. When I try to test this with x11 terminal, the images are produced separately, only one visible at a time. When I use the epslatex terminal, which is what I want, then the text is drawn correctly within the LaTeX document, but the EPS portion of the plot is produced as two separate pages, resulting in a figure that is missing a lower half.
Here's the multiplot section of my script:
set multiplot 2,1
set cbrange [-0.4:0.4]
set cbtics -0.4,0.2,0.4
unset xlabel
set tmargin at screen 0.95
set bmargin at screen 0.60
plot data u 1:2:3 with image notitle
set cbrange [-0.1:0.1]
set cbtics -0.1,0.05,0.1
set xlabel "$x$"
set tmargin at screen 0.50
set bmargin at screen 0.15
plot data u 1:2:3 with image notitle
unset multiplot
unset output
What results in the document is this:
I have tried enlarging the vertical size of the plotting area(per this question), but what this does is increase size of each page in the EPS file. To be clear, the product of plotting with epslatex is an EPS file containing two pages, the first with the first plot at the position that I want (near the top), and the second with the second plot at the position that I want (near the bottom).
This normally happens when you are not in multiplot mode. For me, set multiplot 2,1 gives an error message "only valid in the context of an auto-layout command". The command set multiplot layout 2,1 works with Gnuplot 5.0 and 4.6.
As a side note: This behavior can be used to produce animated gifs with set terminal gif animate, each plot command creates a new frame.

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

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?)

Gnuplot 4.6.5 ylabel not visible

im running gnuplot 4.6.5 on top of ubuntu 12.04 and use the x11 terminal. I use the script as follows but the ylabel is not visible (xlabel is fine). What i have to do to fix it? offset?
thanks for help
plot "512bytesCBR3000client4server1numofnodes.txt" using 1:2 title 'NativeOF' with linespoints lw 2 ps 3 pt 6 lt 3
set grid
set ylabel "End to end delay"
set xlabel "number of nodes"
Normally, you have to do all the settings (set xlabel, set ylabel, set grid) before you call plot if you want them them to show up in the plot. I am not sure why set xlabel is working for you unless you set it in a previous plot or while trying commands from the gnuplot command line.
Try moving the plot command to the end of the file.
Sometimes, this might be related to the margins of the canvas. Therefore, might be wise to play with the margin settings, for example:
# other grid settings
set lmargin 10
set rmargin 10
set tmargin 5
set bmargin 5
# plot command

Resources