File: vplot.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 (70 lines) | stat: -rw-r--r-- 1,654 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#
# Demo for direct plotting of voxel data
#    splot $voxelgrid with {dots|points}
#
if (!exists("VoxelDistance")) exit

set border 0
set xzeroaxis; set yzeroaxis; set zzeroaxis;
set label 1 "X" at 4.1, 0, 0
set label 2 "Y" at 0, 4.1, 0
set label 3 "Z" at 0, 0, 4.1
set tics axis nomirror
set xyplane at 0
set key opaque box
set cblabel "$v201 voxel value" offset -6
set view 203, 227, 1.75

set palette cubehelix negative
set cbrange [0:100]

set xrange [-4:4]; set yrange [-4:4]; set zrange [-4:4]

#
# Radius 1 spheres around (-1,2,2) and (0,3,2) with values decreasing 
# linearly with distance from the center
#
set vgrid $v122 size 100
set vxrange [-4:4]; set vyrange [-4:4]; set vzrange [-4:4]

vfill '-' using 1:2:3:(1.):(100. * (1. - VoxelDistance))
-1 2 2
e

set vgrid $v032 size 100
set vxrange [-4:4]; set vyrange [-4:4]; set vzrange [-4:4]

vfill '-' using 1:2:3:(1.):(100. * (1. - VoxelDistance))
0 3 2
e

#
# Radius 2 sphere around (2,0,1) with values decreasing exponentially 
# with distance from the center
# NB: vgrid range is different from the plot range
#
set vgrid $v201 size 25
set vxrange [0:5]; set vyrange [-2.5:2.5]; set vzrange [-1:4]
vfill '-' using 1:2:3:(2.):(40. * exp(1. - VoxelDistance))
2 0 1
e

show vgrid
set title "overlapping dot plots with constant color\n" \
        . "point plot colored by exponentially decreasing voxel value"
splot $v122 with dots above 0.01 lc "blue", \
      $v032 with dots lc "red", \
      $v201 with points pt 4 lc palette lw 0.33

pause -1 "<cr> to continue"

#
# Same thing with jitter
#
set jitter
set title "Same voxel plot with jitter"
replot

pause -1 "<cr> to continue"

reset