1# Various ways of plotting functions in polar coordinates
2#
3unset border
4set clip
5set polar
6set xtics axis nomirror
7set ytics axis nomirror
8unset rtics
9set samples 160
10set zeroaxis
11set trange [0:2*pi]
12set title "Three circles (with aspect ratio distortion)"
13plot .5,1,1.5
14pause -1 "Hit return to continue"
15set title ""
16set key box
17
18plot cos(2*t)
19pause -1 "Hit return to continue"
20
21plot 2*sqrt(cos(t)),-2*sqrt(cos(t))
22pause -1 "Hit return to continue"
23
24plot sin(4*t),cos(4*t)
25set offset 0,0,0,0
26pause -1 "Hit return to continue"
27
28set xrange [-5:5]
29set yrange [-5:5]
30plot t/cos(3*t)
31pause -1 "Hit return to continue"
32set autoscale
33
34plot 1-sin(t)
35pause -1 "Hit return to continue"
36
37set trange [0:12*pi]
38plot 2*t
39pause -1 "Hit return to continue"
40
41butterfly(x)=exp(cos(x))-2*cos(4*x)+sin(x/12)**5
42set samples 800
43set title "Butterfly"
44unset key
45plot butterfly(t)
46pause -1 "Hit return to continue"
47reset
48
49set polar
50set grid polar
51unset xtics
52unset ytics
53set border 0
54set style fill solid 0.5
55set rrange [0.1 : 4]
56set size square
57set key title "bounding radius 2.5"
58set key outside top right samplen 0.7
59
60plot 3.+sin(t)*cos(5*t) with filledcurve above r=2.5 notitle,\
61     3.+sin(t)*cos(5*t) with line
62
63pause -1 "Hit return to continue"
64# undo what we've done above
65reset
66