coord_polar#
- 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 * 3LetsPlot.setup_html() 4np.random.seed(42) 5n = 20 6data = { 7 'v': 1 + np.random.randint(5, size=n) 8} 9ggplot(data) + \ 10 geom_bar(aes(fill=as_discrete('v')), size=0, show_legend=False) + \ 11 scale_x_continuous(expand=[0, 0]) + \ 12 scale_y_continuous(expand=[0, 0]) + \ 13 coord_polar(theta='y')