/usr/share/doc/libplplot12/examples/tcl/x13.tcl is in plplot-tcl-dev 5.10.0+dfsg2-0.1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 71 72 73 74 75 76 | #----------------------------------------------------------------------------
# $Id: x13.tcl 11572 2011-02-21 07:39:43Z arjenmarkus $
#----------------------------------------------------------------------------
# Does a simple pie chart.
proc x13 {{w loopback}} {
set text0 "Maurice"
set text1 "Geoffrey"
set text2 "Alan"
set text3 "Rafael"
set text4 "Vince"
# int i, j;
# PLFLT dthet, theta0, theta1, theta, just, dx, dy;
# static PLFLT x[500], y[500], per[5];
matrix x f 500
matrix y f 500
matrix per f 5 = {10., 32., 12., 30., 16.}
$w cmd pladv 0
$w cmd plvasp 1.
$w cmd plwind 0. 10. 0. 10.
# $w cmd plenv 0. 10. 0. 10. 1 -2
$w cmd plcol0 2
set theta0 0.
set factor [expr {2. * $::PLPLOT::PL_PI / 500.}]
set dthet 1.0
for {set i 0} {$i <= 4} {incr i} {
set j 0
x $j = 5.
y $j = 5.
incr j
set theta1 [expr {$theta0 + 5.0 * [per $i]}]
if {$i == 4} {
set theta1 500.0
}
for {set theta $theta0} {$theta <= $theta1} {
set theta [expr {$theta + $dthet}]} {
x $j = [expr {5. + 3. * cos($factor*$theta)} ]
y $j = [expr {5. + 3. * sin($factor*$theta)} ]
incr j
}
$w cmd plcol0 [expr {$i + 1}]
$w cmd plpsty [expr {($i + 3) % 8 + 1}]
$w cmd plfill $j x y
$w cmd plcol0 1
$w cmd plline $j x y
set just [expr {$factor * ($theta0 + $theta1) / 2.}]
set dx [expr {.25 * cos($just)}]
set dy [expr {.25 * sin($just)}]
if { ($theta0 + $theta1) < 250.0 || ($theta0 + $theta1) > 750.0 } {
set just 0.
} else {
set just 1.
}
set halfj [expr {$j/2}]
$w cmd plptex [expr {[x $halfj] + $dx}] \
[expr {[y $halfj] + $dy}] 1.0 0.0 $just [set text$i]
set theta0 [expr {$theta - $dthet}]
}
$w cmd plfont 2
$w cmd plschr 0. 1.3
$w cmd plptex 5.0 9.0 1.0 0.0 0.5 "Percentage of Sales"
# Restore defaults
# $w cmd plcol0 1
$w cmd plfont 1
}
|