Reputation: 21
I want to draw something transparent. my script is :
set output 'rcut.png'
set term png
set style fill transparent solid 0.2 noborder
set style circle radius 1
set multiplot layout 1,3 title "Error of the model"
set xlabel 'batch id'
set logscale xy
set format x "10^{\%T}"
set format y "10^{\%T}"
set key autotitle columnheader
#
set ylabel "Energy[eV]"
p 'rcut=3' u 1:4 w circles lc rgb "navy", 'rcut=6' u 1:4 w circles lc rgb "dark-pink"
#
set ylabel "Force[eV/{\305}]"
p 'rcut=3' u 1:6 w circles lc rgb "navy", 'rcut=6' u 1:6 w circles lc rgb "dark-pink"
#
set ylabel
p 'rcut=3' u 1:8 w circles lc rgb "navy", 'rcut=6' u 1:8 w circles lc rgb "dark-pink"
#
unset multiplot
but when i set the term emf, there will be data in the image: enter image description here but it is not what i want, the points are not transparent.
I really want to figure out why,thank you
Upvotes: 0
Views: 74
Reputation: 15118
Long answer:
gnuplot can support two different png terminals, one based on the gd graphics library and selected by set term png
and a second one based on the cairo graphics library and selected by set term pngcairo
. The gd version only supports transparency if you specify set term png truecolor
, which creates an output png file with 24bits of RGB color per pixel and another 8 bits of transparency. Otherwise it generates png files that are smaller (8 bits per pixel) because they are limited to 256 colors and no transparency. The cairo version always produces files with 24bit RGB + 8bit transparency per pixel.
Short answer:
Use either set term pngcairo
or set term png truecolor
.
Upvotes: 1