File: transparent.dem

package info (click to toggle)
gnuplot 6.0.2%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 14,940 kB
  • sloc: ansic: 95,319; cpp: 7,590; makefile: 2,470; javascript: 2,328; sh: 1,531; lisp: 664; perl: 304; pascal: 191; tcl: 88; python: 46
file content (54 lines) | stat: -rw-r--r-- 1,317 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#
# 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

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"

pause -1 "Hit return to continue"

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

pause -1 "Hit return to continue"

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

pause -1 "Hit return to continue"

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

pause -1 "Hit return to continue"
set encoding save_encoding
reset