Back to demo index

gnuplot demo script: transparent.dem

autogenerated by webify.pl on Thu Nov 15 12:12:42 2018
gnuplot version gnuplot 5.2 patchlevel 5
#
# Example of transparent fill areas
# Ethan A Merritt - Aug 2006
# NB:
#    Not all terminal types support transparency
#    Assumes UTF-8 support for plot titles
#
save_encoding = GPVAL_ENCODING
set encoding utf8
set style fill solid 1.0 noborder
set style function filledcurves y1=0
set clip two

Gauss(x,mu,sigma) = 1./(sigma*sqrt(2*pi)) * exp( -(x-mu)**2 / (2*sigma**2) )
d1(x) = Gauss(x, 0.5, 0.5)
d2(x) = Gauss(x,  2.,  1.)
d3(x) = Gauss(x, -1.,  2.)

set xrange [-5:5]
set yrange [0:1]

unset colorbox

set key title "Gaussian Distribution"
set key top left Left reverse samplen 1

#set obj 1 rect from graph 0,0 to graph 1,1
#set obj 1 rect back fs solid 0.25 fc lt 4

set title "Solid filled curves"
plot d1(x) fs solid 1.0 lc rgb "forest-green" title "μ =  0.5 σ = 0.5", \
     d2(x) lc rgb "gold" title "μ =  2.0 σ = 1.0", \
     d3(x) lc rgb "dark-violet" title "μ = -1.0 σ = 2.0"


Click here for minimal script to generate this plot




set style fill transparent solid 0.5 noborder
set title "Transparent filled curves"
replot


Click here for minimal script to generate this plot




set style fill pattern 4 bo
set title "Pattern-filled curves"
replot


Click here for minimal script to generate this plot




set style fill transparent pattern 4 bo
set title "Transparent pattern-filled curves"
replot


Click here for minimal script to generate this plot



set encoding save_encoding