Initial release of Maemo 5 port of gnuplot
[gnuplot] / demo / mgr.dem
1 #
2 # $Id: mgr.dem,v 1.8 2004/01/13 07:01:10 sfeam Exp $
3 #
4 print "Watch some  cubic splines"
5 set samples 50
6 set xlabel "Angle (deg)"
7 set ylabel "Amplitude"
8 set key box
9 set title "Bragg reflection -- Peak only"
10 plot "big_peak.dat" title "Rate" with errorbars, \
11                  "" smooth csplines t "Rate"
12 pause -1 "You would draw smaller bars? (-> return)"
13 set bars small
14 replot
15 set bars large
16 #
17 pause -1 "An approx-spline demo (-> return)"
18 set samples 300
19 set xlabel "Time (sec)"
20 set ylabel "Rate"
21 set title "Ag 108 decay data"
22 plot "silver.dat" t "experimental" w errorb, \
23                ""  smooth csplines t "cubic smooth"
24 # error is column 3; weight larger errors less
25 # start with rel error = 1/($3/$2)
26 pause -1 "Now apply a smoothing spline, weighted by 1/rel error (-> return)"
27 S=1
28 plot "silver.dat" t "experimental" w errorb,\
29                "" u 1:2:(S*$2/$3) smooth acsplines t "acspline Y/Z"
30 pause -1 "Make it smoother by changing the smoothing weights (-> return)"
31 plot "silver.dat" t "rate" w errorb,\
32                "" u 1:2:($2/($3*1.e1)) sm acs t "acspline Y/(Z*1.e1)",\
33                "" u 1:2:($2/($3*1.e3)) sm acs t "         Y/(Z*1.e3)",\
34                "" u 1:2:($2/($3*1.e5)) sm acs t "         Y/(Z*1.e5)"
35 pause -1 "Accentuate the relative changes with a log-scale (-> return)"
36 set logscale y
37 replot
38 pause -1 "Now approximate the data with a bezier curve between the endpoints (-> return)"
39 unset logscale y
40 plot "silver.dat" t "experimental" w errorb,\
41                "" smooth sbezier t "bezier"
42 pause -1 "You would rather use log-scales ? (-> return)"
43 set logscale y
44 plot "silver.dat" t "rate" w errorb, \
45                "" smooth sbezier t "bezier"
46 #
47 pause -1 "Errorbar demo (-> return)"
48 set samples 100
49 unset logscale
50 set xlabel "Resistance [Ohm]"
51 set ylabel "Power [W]"
52 set title "UM1-Cell Power"
53 n(x)=1.53**2*x/(5.67+x)**2
54 plot [0:50] "battery.dat" t "Power" with xyerrorbars, n(x) t "Theory" w lines
55 pause -1 "Would you like boxes? (-> return)"
56 plot [0:50] "battery.dat" t "Power" with boxxy, n(x) t "Theory" w lines
57 pause -1 "Only X-Bars? (-> return)"
58 plot [0:50] "battery.dat" u 1:2:3 t "Power" w xerr, n(x) t "Theory" w lines
59 pause -1 "Only Y-Bars? (-> return)"
60 plot [0:50] "battery.dat" u 1:2:4 t "Power" w yerr, n(x) t "Theory" w lines
61 pause -1 "Logscaled? (-> return)"
62 set logscale y
63 plot [0:50] "battery.dat" u 1:2:4 t "Power" w yerr, n(x) t "Theory" w lines
64 pause -1 "X as well? (-> return)"
65 set logscale xy
66 plot [1:50] "battery.dat" t "Power" w xyerr, n(x) t "Theory" w lines
67 pause -1 "If you like bars without tics (-> return)"
68 unset logscale
69 set bars small
70 plot [0:50] "battery.dat" t "Power" with xyerrorbars, n(x) t "Theory" w lines
71 pause -1 "X-Bars only (-> return)"
72 plot [0:50] "battery.dat" u 1:2:3 t "Power" w xerr, n(x) t "Theory" w lines
73 pause -1 "Y-Bars only (-> return)"
74 plot [0:50] "battery.dat" u 1:2:4 t "Power" w yerr, n(x) t "Theory" w lines
75 reset
76