File: surface_explicit.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 (56 lines) | stat: -rw-r--r-- 1,163 bytes parent folder | download | duplicates (3)
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
55
56
#
# Show mixing gridded surfaces and individual lines
# by using "set surface explicit" together with plot styles
# splot A with surface, B with lines
#
# This is supposed to work with or without hidden surface removal
# but failed for hidden3d in gnuplot versions < 5.4.4
#
set view 98, 70
unset border
unset tics
set sample 21,21
set isosample 21,21

sinc(x) = (x==0) ? 1.0 : sin(x) / x
F(x,y) = 5. * sinc(sqrt(x*x + y*y))

$DATA << EOD
0 0 -3
1 0  0
2 0  3
3 0  6

0 1 -3
1 1  0
2 1  3
3 1  6

EOD

set surface explicit
set style data surface
unset hidden3d

set title "set surface explicit\nunset hidden3d"
splot '++' using 1:2:(F($1,$2)) with surface title "with surface", \
      $DATA using 1:($2+1):3 with lines lw 2 title "with lines", \
      $DATA using 1:($2-3):3 with surface lw 2 lc 4 title "with surface"

pause -1 "<cr> to continue"

set hidden3d
set title "set surface explicit\n  set hidden3d"
splot '++' using 1:2:(F($1,$2)) with surface title "with surface", \
      $DATA using 1:($2+1):3 with lines lw 2 title "with lines", \
      $DATA using 1:($2-3):3 with surface lw 2 lc 4 title "with surface"

pause -1 "<cr> to continue"

reset