I'm running into a strange issue when generating a plot using
gnuplot
(version 6.0 patchlevel 1, on Microsoft Windows version 10.0.19045.5737). To my plot I need the colorbox
to appear inverted, i.e., the color gradient should go from high values at the bottom to low values at the top.
I noticed that when using certain terminals, the colorbox
appears completely blank or white, without the expected color gradient:
wxt
, successemf
, successpngcairo
, successsvg
, successpdfcairo
, FAILepscairo
, FAILI’ve attached sample images:
output from pngcairo
terminal
output from pdfcairo
terminal
Output using "Export plot to file" option as pdf from wxt
interactive window.
Here's a simplified version of the script I'm using:
reset session
set encoding utf8
#set terminal wxt size 800,400 font "Arial,9"
#set terminal pngcairo size 800,400 font "Arial,9"
#set output "diagram.png"
set terminal pdfcairo size 10,5 in font "Arial,14"
set output "diagram.pdf"
set tics out nomirror
unset key
set style circle radius graph 0.01
set style fill transparent solid 1 border lc ls -1
set palette viridis maxcolors 25
set xrange [400:450]
set yrange [100:600]
set xlabel "Temperature/°C"
set ylabel "Index"
set cblabel "Depth (m)"
set cbtics offset -1,0
set multiplot layout 1,2
set title "normal colorbox"
plot "data.txt" u 2:3:1 w circle lc palette
set colorbox invert
set title "inverted colorbox"
replot
unset multiplot
unset output
The data.txt
looks something like this:
Depth Temp Index
201.05 427.34 251.70
205.24 431.39 296.30
209.24 414.27 185.66
211.89 432.81 140.98
215.54 413.30 299.13
217.17 424.50 272.27
221.00 426.93 184.91
221.50 420.06 241.14
222.95 420.16 467.74
223.60 410.67 196.70
226.39 416.30 166.96
228.87 430.30 437.81
232.22 415.00 343.18
232.23 415.76 494.67
235.17 410.02 224.60
238.31 429.06 302.89
238.37 414.77 367.09
238.49 421.26 195.13
239.36 414.16 161.46
241.46 418.85 263.24
242.76 431.97 378.32
243.17 420.91 154.06
246.77 421.16 135.39
247.30 414.63 411.32
248.97 410.22 146.30
There is some wrong with my script/data or this is a bug?
I can confirm the reported problem and traced it to commit 84e724843f (applied between 6.0-rc1 and 6.0-rc2). This bug should only affect the qt and cairo terminals. The fix is straightforward, but unfortunately I don't see a work-around for it in the current 6.0 release.