14.10.2014 Views

gnuplot documentation

gnuplot documentation

gnuplot documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

70 SET-SHOW <strong>gnuplot</strong> 4.3 127<br />

70.52 Polar<br />

The set polar command changes the meaning of the plot from rectangular coordinates to polar coordinates.<br />

Syntax:<br />

set polar<br />

unset polar<br />

show polar<br />

There have been changes made to polar mode in version 3.7, so that scripts for <strong>gnuplot</strong> versions 3.5 and<br />

earlier will require modification. The main change is that the dummy variable t is used for the angle so<br />

that the x and y ranges can be controlled independently. Other changes are: 1) tics are no longer put<br />

along the zero axes automatically — use set xtics axis nomirror; set ytics axis nomirror; 2) the<br />

grid, if selected, is not automatically polar — use set grid polar; 3) the grid is not labelled with angles<br />

— use set label as necessary.<br />

In polar coordinates, the dummy variable (t) is an angle. The default range of t is [0:2*pi], or, if degree<br />

units have been selected, to [0:360] (see set angles (p. 85)).<br />

The command unset polar changes the meaning of the plot back to the default rectangular coordinate<br />

system.<br />

The set polar command is not supported for splots. See the set mapping (p. 112) command for<br />

similar functionality for splot (p. 150)s.<br />

While in polar coordinates the meaning of an expression in t is really r = f(t), where t is an angle of<br />

rotation. The trange controls the domain (the angle) of the function, and the x and y ranges control<br />

the range of the graph in the x and y directions. Each of these ranges, as well as the rrange, may be<br />

autoscaled or set explicitly. See set xrange (p. 142) for details of all the ranges (p. 77) commands.<br />

Example:<br />

set polar<br />

plot t*sin(t)<br />

plot [-2*pi:2*pi] [-3:3] [-3:3] t*sin(t)<br />

The first plot uses the default polar angular domain of 0 to 2*pi. The radius and the size of the graph<br />

are scaled automatically. The second plot expands the domain, and restricts the size of the graph to<br />

[-3:3] in both directions.<br />

You may want to set size square to have <strong>gnuplot</strong> try to make the aspect ratio equal to unity, so that<br />

circles look circular. See also<br />

and<br />

polar demos (polar.dem)<br />

polar data plot (poldat.dem).<br />

70.53 Print<br />

The set print command redirects the output of the print command to a file.<br />

Syntax:<br />

set print<br />

set print "-"<br />

set print ""<br />

set print "" append<br />

set print "|"<br />

Without "", the output file is restored to . The "-" means<br />

. The append flag causes the file to be opened in append mode. A starting<br />

with "|" is opened as a pipe to the on platforms that support piping.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!