Polar

The set polar command changes the meaning of the plot from rectangular coordinates to polar coordinates. In polar coordinates, the dummy variable (x) is an angle. The range of this angle is changed from whatever it was to [0:2*pi].

The command set nopolar changes the meaning of the plot back to the default rectangular coordinate system. The range of x is changed from whatever it was to [-10:10].

While in polar coordinates the meaning of an expression in x is really r = f(x), where x is an angle of rotation. The xrange controls the domain (the angle) of the function, and the yrange controls the range (the radius). The plot is plotted on a rectangular grid, and the x and y axes are both in units of the radius. Thus, the yrange controls both dimensions of the plot output. There is no way to specify the output dimensions separately.

Syntax:

        set polar
        set nopolar
        show polar
Example:
        set polar
        plot x*sin(x)
        plot [-2*pi:2*pi] [-3:3] x*sin(x)
The first plot uses the default polar angular domain of 0 to 2*pi. The radius (and the size of the plot) is scaled automatically. The second plot expands the domain, and restricts the range of the radius (and the size of the plot) to [-3:3].