Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

polar

Polar Coordinate Plot (Matlab Style)


Description

The polar function accepts polar coordinates, plots them in a Cartesian plane, and draws the polar grid on the plane.

Usage

polar(t, r, type="l", 
      col = "blue", grcol = "darkgrey", bxcol = "black",
      main = "Polar Plot", add = FALSE, ...)

Arguments

t, r

vectors specifying angle and radius.

type

type of the plot, lines, points, or no plotting.

col

color of the graph.

grcol, bxcol

color of grid anf box around the plot.

main

plot title.

add

logical; if true, the graph will be plotted into the coordinate system of an existing plot.

...

plotting parameters to be passed to the points function.

Details

polar(theta,rho) creates a polar coordinate plot of the angle theta versus the radius rho. theta is the angle from the x-axis to the radius vector specified in radians; rho is the length of the radius vector.

Value

Generates a plot; no returns.

Examples

## Not run: 
t <- deg2rad(seq(0, 360, by = 2))
polar(t, cos(2*t), bxcol = "white", main = "Sine and Cosine")
polar(t, sin(2*t), col = "red", add = TRUE)

## End(Not run)

pracma

Practical Numerical Math Functions

v2.3.3
GPL (>= 3)
Authors
Hans W. Borchers [aut, cre]
Initial release
2021-01-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.