-
Notifications
You must be signed in to change notification settings - Fork 79
Expand file tree
/
Copy pathorbtop.gplt
More file actions
42 lines (34 loc) · 1.48 KB
/
orbtop.gplt
File metadata and controls
42 lines (34 loc) · 1.48 KB
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
set terminal pdf noenhanced
if (!exists("filename")) filename='default.dat'
set zrange[0:3]
set datafile separator ','
stats filename u 2 every ::0::-1 noout prefix "A"
angle(x)=x*360/A_sum
percentage(x)=x
# circumference dimensions for pie-chart
centerX=0
centerY=0
radius=1
# label positions
yposmin = 0.0
yposmax = 0.95*radius
xpos = 1.15*radius
ypos(i) = yposmax - i*(yposmax-yposmin)/(1.0*A_records)
#-------------------------------------------------------------------
# now we can configure the canvas
set style fill solid 1 # filled pie-chart
unset key # no automatic labels
unset tics # remove tics
unset border # remove borders; if some label is missing, comment to see what is happening
set size ratio -1 # equal scale length
set xrange [-radius:2.5*radius] # [-1:2] leaves space for labels
set yrange [-radius:radius] # [-1:1]
#-------------------------------------------------------------------
pos = 0 # init angle
colour = 0 # init colour
# 1st line: plot pie-chart
# 2nd line: draw colored boxes at (xpos):(ypos)
# 3rd line: place labels at (xpos+offset):(ypos)
plot filename u (centerX):(centerY):(radius):(pos):(pos=pos+angle($2)):(colour=colour+1) every ::0::-1 w circle lc var,\
for [i=0:A_records-1] '+' u (xpos):(ypos(i)) w p pt 5 ps 4 lc i+1,\
for [i=0:A_records-1] filename u (xpos):(ypos(i)):(sprintf('%05.2f%% %s', percentage($2), stringcolumn(1))) every ::i::i w labels left offset 3,0