lets_plot.coord_polar#

lets_plot.coord_polar(xlim=None, ylim=None, theta=None, start=None, direction=None, transform_bkgr=None)#

Polar coordinate system. It is used for pie charts and polar plots.

Parameters:
xlimlist

Limits (2 elements) for the x axis. 1st element defines lower limit, 2nd element defines upper limit. None means no lower / upper bound - depending on the index in list.

ylimlist

Limits (2 elements) for the y axis. 1st element defines lower limit, 2nd element defines upper limit. None means no lower / upper bound - depending on the index in list.

theta{‘x’, ‘y’}, default=’x’

Aesthetic that is used to map angle.

startfloat, default=0

Offset relative to the starting angle (which is 12 o’clock), in radians.

direction{1, -1}, default=1

Specify angle direction, 1=clockwise, -1=counter-clockwise.

transform_bkgrbool, default=True

If True, the background is transformed to a circle, rectangle otherwise.

Examples

 1import numpy as np
 2from lets_plot import *
 3from lets_plot.mapping import as_discrete
 4LetsPlot.setup_html()
 5np.random.seed(42)
 6n = 20
 7data = {
 8    'v': 1 + np.random.randint(5, size=n)
 9}
10ggplot(data) + \
11    geom_bar(aes(fill=as_discrete('v')), size=0, show_legend=False) + \
12    scale_x_continuous(expand=[0, 0]) + \
13    scale_y_continuous(expand=[0, 0]) + \
14    coord_polar(theta='y')