lets-plot 4.6.0rc1__cp312-cp312-macosx_10_15_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of lets-plot might be problematic. Click here for more details.

Files changed (91) hide show
  1. lets_plot/__init__.py +283 -0
  2. lets_plot/_global_settings.py +191 -0
  3. lets_plot/_kbridge.py +134 -0
  4. lets_plot/_type_utils.py +110 -0
  5. lets_plot/_version.py +6 -0
  6. lets_plot/bistro/__init__.py +16 -0
  7. lets_plot/bistro/_plot2d_common.py +100 -0
  8. lets_plot/bistro/corr.py +447 -0
  9. lets_plot/bistro/im.py +196 -0
  10. lets_plot/bistro/joint.py +192 -0
  11. lets_plot/bistro/qq.py +207 -0
  12. lets_plot/bistro/residual.py +341 -0
  13. lets_plot/bistro/waterfall.py +252 -0
  14. lets_plot/export/__init__.py +6 -0
  15. lets_plot/export/ggsave_.py +133 -0
  16. lets_plot/frontend_context/__init__.py +8 -0
  17. lets_plot/frontend_context/_configuration.py +144 -0
  18. lets_plot/frontend_context/_frontend_ctx.py +16 -0
  19. lets_plot/frontend_context/_html_contexts.py +117 -0
  20. lets_plot/frontend_context/_intellij_python_json_ctx.py +38 -0
  21. lets_plot/frontend_context/_json_contexts.py +39 -0
  22. lets_plot/frontend_context/_jupyter_notebook_ctx.py +119 -0
  23. lets_plot/frontend_context/_mime_types.py +7 -0
  24. lets_plot/frontend_context/_static_html_page_ctx.py +27 -0
  25. lets_plot/frontend_context/_static_svg_ctx.py +26 -0
  26. lets_plot/frontend_context/_webbr_html_page_ctx.py +29 -0
  27. lets_plot/frontend_context/sandbox.py +5 -0
  28. lets_plot/geo_data/__init__.py +18 -0
  29. lets_plot/geo_data/core.py +331 -0
  30. lets_plot/geo_data/geocoder.py +977 -0
  31. lets_plot/geo_data/geocodes.py +512 -0
  32. lets_plot/geo_data/gis/__init__.py +0 -0
  33. lets_plot/geo_data/gis/fluent_dict.py +201 -0
  34. lets_plot/geo_data/gis/geocoding_service.py +42 -0
  35. lets_plot/geo_data/gis/geometry.py +91 -0
  36. lets_plot/geo_data/gis/json_request.py +232 -0
  37. lets_plot/geo_data/gis/json_response.py +308 -0
  38. lets_plot/geo_data/gis/request.py +492 -0
  39. lets_plot/geo_data/gis/response.py +247 -0
  40. lets_plot/geo_data/livemap_helper.py +65 -0
  41. lets_plot/geo_data/to_geo_data_frame.py +141 -0
  42. lets_plot/geo_data/type_assertion.py +34 -0
  43. lets_plot/geo_data_internals/__init__.py +4 -0
  44. lets_plot/geo_data_internals/constants.py +13 -0
  45. lets_plot/geo_data_internals/utils.py +33 -0
  46. lets_plot/mapping.py +115 -0
  47. lets_plot/package_data/lets-plot.min.js +2 -0
  48. lets_plot/plot/__init__.py +64 -0
  49. lets_plot/plot/_global_theme.py +14 -0
  50. lets_plot/plot/annotation.py +233 -0
  51. lets_plot/plot/coord.py +242 -0
  52. lets_plot/plot/core.py +943 -0
  53. lets_plot/plot/expand_limits_.py +78 -0
  54. lets_plot/plot/facet.py +206 -0
  55. lets_plot/plot/font_features.py +71 -0
  56. lets_plot/plot/geom.py +8160 -0
  57. lets_plot/plot/geom_extras.py +53 -0
  58. lets_plot/plot/geom_function_.py +216 -0
  59. lets_plot/plot/geom_imshow_.py +401 -0
  60. lets_plot/plot/geom_livemap_.py +330 -0
  61. lets_plot/plot/ggbunch_.py +96 -0
  62. lets_plot/plot/gggrid_.py +126 -0
  63. lets_plot/plot/ggtb_.py +56 -0
  64. lets_plot/plot/guide.py +229 -0
  65. lets_plot/plot/label.py +187 -0
  66. lets_plot/plot/marginal_layer.py +181 -0
  67. lets_plot/plot/plot.py +244 -0
  68. lets_plot/plot/pos.py +346 -0
  69. lets_plot/plot/sampling.py +338 -0
  70. lets_plot/plot/sandbox_.py +26 -0
  71. lets_plot/plot/scale.py +3577 -0
  72. lets_plot/plot/scale_colormap_mpl.py +297 -0
  73. lets_plot/plot/scale_convenience.py +155 -0
  74. lets_plot/plot/scale_identity_.py +658 -0
  75. lets_plot/plot/scale_position.py +1336 -0
  76. lets_plot/plot/series_meta.py +129 -0
  77. lets_plot/plot/stat.py +581 -0
  78. lets_plot/plot/subplots.py +322 -0
  79. lets_plot/plot/subplots_util.py +24 -0
  80. lets_plot/plot/theme_.py +766 -0
  81. lets_plot/plot/theme_set.py +393 -0
  82. lets_plot/plot/tooltip.py +486 -0
  83. lets_plot/plot/util.py +226 -0
  84. lets_plot/settings_utils.py +244 -0
  85. lets_plot/tilesets.py +364 -0
  86. lets_plot-4.6.0rc1.dist-info/LICENSE +21 -0
  87. lets_plot-4.6.0rc1.dist-info/METADATA +199 -0
  88. lets_plot-4.6.0rc1.dist-info/RECORD +91 -0
  89. lets_plot-4.6.0rc1.dist-info/WHEEL +5 -0
  90. lets_plot-4.6.0rc1.dist-info/top_level.txt +2 -0
  91. lets_plot_kotlin_bridge.cpython-312-darwin.so +0 -0
@@ -0,0 +1,64 @@
1
+ #
2
+ # Copyright (c) 2019. JetBrains s.r.o.
3
+ # Use of this source code is governed by the MIT license that can be found in the LICENSE file.
4
+ #
5
+ from .annotation import *
6
+ from .coord import *
7
+ from .core import *
8
+ from .expand_limits_ import *
9
+ from .facet import *
10
+ from .font_features import *
11
+ from .geom import *
12
+ from .geom_extras import *
13
+ from .geom_function_ import *
14
+ from .geom_imshow_ import *
15
+ from .geom_livemap_ import *
16
+ from .ggbunch_ import *
17
+ from .gggrid_ import *
18
+ from .ggtb_ import *
19
+ from .guide import *
20
+ from .label import *
21
+ from .marginal_layer import *
22
+ from .plot import *
23
+ from .pos import *
24
+ from .sampling import *
25
+ from .scale import *
26
+ from .scale_colormap_mpl import *
27
+ from .scale_convenience import *
28
+ from .scale_identity_ import *
29
+ from .scale_position import *
30
+ from .stat import *
31
+ from .theme_ import *
32
+ from .theme_set import *
33
+ from .tooltip import *
34
+
35
+ __all__ = (coord.__all__ +
36
+ core.__all__ +
37
+ facet.__all__ +
38
+ geom.__all__ +
39
+ geom_extras.__all__ +
40
+ geom_function_.__all__ +
41
+ geom_imshow_.__all__ +
42
+ geom_livemap_.__all__ +
43
+ guide.__all__ +
44
+ label.__all__ +
45
+ plot.__all__ +
46
+ pos.__all__ +
47
+ sampling.__all__ +
48
+ scale.__all__ +
49
+ scale_colormap_mpl.__all__ +
50
+ scale_convenience.__all__ +
51
+ scale_identity_.__all__ +
52
+ scale_position.__all__ +
53
+ stat.__all__ +
54
+ theme_.__all__ +
55
+ theme_set.__all__ +
56
+ tooltip.__all__ +
57
+ annotation.__all__ +
58
+ marginal_layer.__all__ +
59
+ font_features.__all__ +
60
+ ggbunch_.__all__ +
61
+ gggrid_.__all__ +
62
+ ggtb_.__all__ +
63
+ expand_limits_.__all__
64
+ )
@@ -0,0 +1,14 @@
1
+ #
2
+ # Copyright (c) 2024. JetBrains s.r.o.
3
+ # Use of this source code is governed by the MIT license that can be found in the LICENSE file.
4
+ #
5
+ _global_theme = None
6
+
7
+
8
+ def _set_global_theme(theme):
9
+ global _global_theme
10
+ _global_theme = theme
11
+
12
+
13
+ def _get_global_theme():
14
+ return _global_theme
@@ -0,0 +1,233 @@
1
+ # Copyright (c) 2022. JetBrains s.r.o.
2
+ # Use of this source code is governed by the MIT license that can be found in the LICENSE file.
3
+
4
+ from typing import List
5
+
6
+ from lets_plot.plot.core import FeatureSpec, _filter_none
7
+
8
+ #
9
+ # Annotations
10
+ #
11
+
12
+ __all__ = ['layer_labels']
13
+
14
+
15
+ class layer_labels(FeatureSpec):
16
+ """
17
+ Configure annotations (for pie and bar charts).
18
+
19
+ Examples
20
+ --------
21
+ .. jupyter-execute::
22
+ :linenos:
23
+ :emphasize-lines: 6
24
+
25
+ from lets_plot import *
26
+ LetsPlot.setup_html()
27
+ data = {'name': ['a', 'b', 'c', 'd', 'b'], 'value': [40, 90, 10, 50, 20 ] }
28
+ ggplot(data) + geom_pie(aes(slice='value', fill='name'), size=15, hole=0.4, \\
29
+ stat='identity', tooltips = 'none', \\
30
+ labels=layer_labels().line('@value'))
31
+
32
+ """
33
+
34
+ def __init__(self, variables: List[str] = None):
35
+ """
36
+ Initialize self.
37
+
38
+ Parameters
39
+ ----------
40
+ variables : list of str
41
+ Variable names to place in the annotation with default formatting.
42
+
43
+ """
44
+
45
+ self._formats: List = []
46
+ self._lines: List = None
47
+ self._variables = variables
48
+ self._size = None
49
+ super().__init__('labels', name=None)
50
+
51
+ def as_dict(self):
52
+ """
53
+ Return the dictionary of all properties of the object.
54
+
55
+ Returns
56
+ -------
57
+ dict
58
+ Dictionary of properties.
59
+
60
+ Examples
61
+ --------
62
+ .. jupyter-execute::
63
+ :linenos:
64
+ :emphasize-lines: 6
65
+
66
+ from lets_plot import *
67
+ LetsPlot.setup_html()
68
+ layer_labels().format('@{..prop..}', '.0%') \\
69
+ .line('@name') \\
70
+ .line('(@{..prop..})') \\
71
+ .as_dict()
72
+
73
+ """
74
+ d = super().as_dict()
75
+ d['formats'] = self._formats
76
+ d['lines'] = self._lines
77
+ d['variables'] = self._variables
78
+ d['annotation_size'] = self._size
79
+ return _filter_none(d)
80
+
81
+ def format(self, field=None, format=None):
82
+ """
83
+ Define the format for displaying the value.
84
+ This format will be applied to the corresponding value specified in the 'line' template.
85
+
86
+ Parameters
87
+ ----------
88
+ field : str
89
+ Name of an aesthetic or variable that would be formatted.
90
+ The field name starts with a '^' prefix for aesthetics,
91
+ the variable name starts with a '@' prefix or without any prefix.
92
+ format : str
93
+ Formatting specification. The format contains a number format ('1.f'),
94
+ a string template ('{.1f}') or a date/time format ('%d.%m.%y').
95
+ The numeric format for non-numeric value will be ignored.
96
+ If you need to include a brace character in the literal text,
97
+ it can be escaped by doubling: `{{` and `}}`.
98
+
99
+ Returns
100
+ -------
101
+ `layer_labels`
102
+ Annotations specification.
103
+
104
+ Notes
105
+ -----
106
+ For more info see `Formatting <https://lets-plot.org/python/pages/formats.html>`__.
107
+
108
+ Examples
109
+ --------
110
+ .. jupyter-execute::
111
+ :linenos:
112
+ :emphasize-lines: 7
113
+
114
+ from lets_plot import *
115
+ LetsPlot.setup_html()
116
+ data = {'name': ['a', 'b', 'c', 'd', 'b'], 'value': [40, 90, 10, 50, 20 ] }
117
+ ggplot(data) + geom_pie(aes(fill=as_discrete('name', order_by='..count..'), weight='value'), \\
118
+ size=15, tooltips='none', \\
119
+ labels=layer_labels(['..proppct..']) \\
120
+ .format('..proppct..', '{.1f}%'))
121
+
122
+ |
123
+
124
+ .. jupyter-execute::
125
+ :linenos:
126
+ :emphasize-lines: 7, 9, 11, 13
127
+
128
+ from lets_plot import *
129
+ LetsPlot.setup_html()
130
+ data = {'name': ['a', 'b', 'c', 'd', 'b'], 'value': [40, 90, 10, 50, 20 ] }
131
+ ggplot(data) + geom_pie(aes(fill=as_discrete('name', order_by='..count..', order=1), weight='value'), \\
132
+ size=15, tooltips='none', \\
133
+ labels=layer_labels() \\
134
+ .format('^fill', '{{{}}}') \\
135
+ .line('^fill') \\
136
+ .format('..count..', 'd') \\
137
+ .line('@{..count..}') \\
138
+ .format('..prop..', '.1%') \\
139
+ .line('@{..prop..}') \\
140
+ .format('..sum..', 'of {d}') \\
141
+ .line('@{..sum..}'))
142
+
143
+ """
144
+ self._formats.append({"field": field, "format": format})
145
+ return self
146
+
147
+ def line(self, value):
148
+ """
149
+ Line to show in the annotation.
150
+
151
+ Parameters
152
+ ----------
153
+ value : str
154
+ Enriched string which becomes one line of the annotation.
155
+
156
+ Returns
157
+ -------
158
+ `layer_labels`
159
+ Annotations specification.
160
+
161
+ Notes
162
+ -----
163
+ Variables and aesthetics can be accessed via special syntax:
164
+
165
+ - ^color for aes,
166
+ - @x for variable,
167
+ - @{x + 1} for variable with spaces in the name,
168
+ - @{x^2 + 1} for variable with spaces and '^' symbol in the name,
169
+ - @x^2 for variable with '^' symbol in its name.
170
+
171
+ A '^' symbol can be escaped with a backslash, a brace character
172
+ in the literal text - by doubling:
173
+
174
+ - 'x\\\\^2' -> "x^2"
175
+ - '{{x}}' -> "{x}"
176
+
177
+ Examples
178
+ --------
179
+ .. jupyter-execute::
180
+ :linenos:
181
+ :emphasize-lines: 8-11
182
+
183
+ from lets_plot import *
184
+ LetsPlot.setup_html()
185
+ data = {'name': ['a', 'b', 'c', 'd', 'b'], 'value': [40, 90, 10, 50, 20 ] }
186
+ ggplot(data) + geom_pie(aes(fill='name', weight='value'), size=15, \\
187
+ tooltips='none', \\
188
+ labels=layer_labels()\\
189
+ .format('..prop..', '.1%')\\
190
+ .line('"^fill"')\\
191
+ .line('@{..count..}')\\
192
+ .line('@{..prop..}')\\
193
+ .line('(@{..sum..})'))
194
+
195
+ """
196
+ if self._lines is None:
197
+ self._lines = []
198
+ self._lines.append(value)
199
+ return self
200
+
201
+ def size(self, value):
202
+ """
203
+ Text size in the annotation.
204
+
205
+ Parameters
206
+ ----------
207
+ value : float
208
+ Text size in the annotation.
209
+
210
+ Returns
211
+ -------
212
+ `layer_labels`
213
+ Annotations specification.
214
+
215
+ Examples
216
+ --------
217
+
218
+ .. jupyter-execute::
219
+ :linenos:
220
+ :emphasize-lines: 7
221
+
222
+ from lets_plot import *
223
+ LetsPlot.setup_html()
224
+ data = {'name': ['a', 'b', 'c', 'd', 'b'], 'value': [40, 90, 10, 50, 20 ] }
225
+ ggplot(data) + geom_pie(aes(slice='value', fill='name'), size=15, hole=0.4, \\
226
+ stat='identity', tooltips = 'none', \\
227
+ labels=layer_labels().line('@value')
228
+ .size(25))
229
+
230
+ """
231
+
232
+ self._size = value
233
+ return self
@@ -0,0 +1,242 @@
1
+ #
2
+ # Copyright (c) 2019. JetBrains s.r.o.
3
+ # Use of this source code is governed by the MIT license that can be found in the LICENSE file.
4
+ #
5
+ from .core import FeatureSpec
6
+
7
+ #
8
+ # Coordinate Systems
9
+ #
10
+ __all__ = ['coord_cartesian',
11
+ 'coord_fixed',
12
+ 'coord_map',
13
+ 'coord_flip',
14
+ 'coord_polar',
15
+ ]
16
+
17
+
18
+ def coord_cartesian(xlim=None, ylim=None, flip=False):
19
+ """
20
+ The Cartesian coordinate system is the most familiar and common type of coordinate system.
21
+ Setting limits on the coordinate system will zoom the plot like you're looking at it with a magnifying glass.
22
+ It does not change the underlying data as setting limits on a scale does.
23
+
24
+ Parameters
25
+ ----------
26
+ xlim : list
27
+ Limits (2 elements) for the x axis.
28
+ 1st element defines lower limit, 2nd element defines upper limit.
29
+ None means no lower / upper bound - depending on the index in list.
30
+ ylim : list
31
+ Limits (2 elements) for the y axis.
32
+ 1st element defines lower limit, 2nd element defines upper limit.
33
+ None means no lower / upper bound - depending on the index in list.
34
+ flip : bool
35
+ Flip the coordinate system axis so that horizontal axis becomes vertical and vice versa.
36
+
37
+ Returns
38
+ -------
39
+ `FeatureSpec`
40
+ Coordinate system specification.
41
+
42
+ Examples
43
+ --------
44
+ .. jupyter-execute::
45
+ :linenos:
46
+ :emphasize-lines: 7
47
+
48
+ from lets_plot import *
49
+ LetsPlot.setup_html()
50
+ data = {'x': [0, 8, 12, 17, 20, 26],
51
+ 'y': [0, 8, 12, 17, 20, 26],
52
+ 'g': ['a', 'a', 'b', 'b', 'c', 'c']}
53
+ ggplot(data) + geom_line(aes(x='x', y='y', group='g')) + \\
54
+ coord_cartesian(xlim=(4, 23), ylim=(3, 22))
55
+
56
+ """
57
+
58
+ return _coord('cartesian', xlim=xlim, ylim=ylim, flip=flip)
59
+
60
+
61
+ def coord_fixed(ratio=1., xlim=None, ylim=None, flip=False):
62
+ """
63
+ A fixed scale coordinate system forces a specified ratio between the physical representations of data units on the axes.
64
+
65
+ Parameters
66
+ ----------
67
+ ratio : float
68
+ The ratio represents the number of units on the y-axis equivalent to one unit on the x-axis.
69
+ ratio = 1, ensures that one unit on the x-axis is the same length as one unit on the y-axis.
70
+ Ratios higher than one make units on the y-axis longer than units on the x-axis, and vice versa.
71
+ xlim : list
72
+ Limits (2 elements) for the x axis.
73
+ 1st element defines lower limit, 2nd element defines upper limit.
74
+ None means no lower / upper bound - depending on the index in list.
75
+ ylim : list
76
+ Limits (2 elements) for the y axis.
77
+ 1st element defines lower limit, 2nd element defines upper limit.
78
+ None means no lower / upper bound - depending on the index in list.
79
+ flip : bool
80
+ Flip the coordinate system axis so that horizontal axis becomes vertical and vice versa.
81
+
82
+ Returns
83
+ -------
84
+ `FeatureSpec`
85
+ Coordinate system specification.
86
+
87
+ Examples
88
+ --------
89
+ .. jupyter-execute::
90
+ :linenos:
91
+ :emphasize-lines: 9
92
+
93
+ import numpy as np
94
+ from lets_plot import *
95
+ LetsPlot.setup_html()
96
+ n = 30
97
+ np.random.seed(42)
98
+ x = np.random.uniform(-1, 1, size=n)
99
+ y = 25 * x ** 2 + np.random.normal(size=n)
100
+ ggplot({'x': x, 'y': y}, aes(x='x', y='y')) + \\
101
+ geom_point() + coord_fixed(ratio=.2, ylim=(7, 20))
102
+
103
+ """
104
+
105
+ return _coord('fixed', ratio=ratio, xlim=xlim, ylim=ylim, flip=flip)
106
+
107
+
108
+ def coord_map(xlim=None, ylim=None, flip=False):
109
+ """
110
+ Project a portion of the earth, which is approximately spherical,
111
+ onto a flat 2D plane.
112
+ Map projections generally do not preserve straight lines, so this requires considerable computation.
113
+
114
+ Parameters
115
+ ----------
116
+ xlim : list
117
+ Limits (2 elements) for the x axis.
118
+ 1st element defines lower limit, 2nd element defines upper limit.
119
+ None means no lower / upper bound - depending on the index in list.
120
+ ylim : list
121
+ Limits (2 elements) for the y axis.
122
+ 1st element defines lower limit, 2nd element defines upper limit.
123
+ None means no lower / upper bound - depending on the index in list.
124
+ flip : bool
125
+ Flip the coordinate system axis so that horizontal axis becomes vertical and vice versa.
126
+
127
+ Returns
128
+ -------
129
+ `FeatureSpec`
130
+ Coordinate system specification.
131
+
132
+ Examples
133
+ --------
134
+ .. jupyter-execute::
135
+ :linenos:
136
+ :emphasize-lines: 6
137
+
138
+ from lets_plot import *
139
+ from lets_plot.geo_data import *
140
+ LetsPlot.setup_html()
141
+ us = geocode_states('US-48').get_boundaries(4)
142
+ ggplot() + geom_map(map=us, fill='gray', color='white') + \\
143
+ coord_map(xlim=(-130, -100))
144
+
145
+ """
146
+
147
+ return _coord('map', xlim=xlim, ylim=ylim, flip=flip)
148
+
149
+
150
+ def coord_flip(xlim=None, ylim=None):
151
+ """
152
+ Flip axis of default coordinate system so that horizontal axis becomes vertical and vice versa.
153
+
154
+ Parameters
155
+ ----------
156
+ xlim : list
157
+ Limits (2 elements) for the x axis.
158
+ 1st element defines lower limit, 2nd element defines upper limit.
159
+ None means no lower / upper bound - depending on the index in list.
160
+ ylim : list
161
+ Limits (2 elements) for the y axis.
162
+ 1st element defines lower limit, 2nd element defines upper limit.
163
+ None means no lower / upper bound - depending on the index in list.
164
+
165
+ Returns
166
+ -------
167
+ `FeatureSpec`
168
+ Coordinate system specification.
169
+
170
+ Examples
171
+ --------
172
+ .. jupyter-execute::
173
+ :linenos:
174
+ :emphasize-lines: 12
175
+
176
+ import numpy as np
177
+ from lets_plot import *
178
+ LetsPlot.setup_html()
179
+ np.random.seed(42)
180
+ n = 10
181
+ x = np.arange(n)
182
+ y = 1 + np.random.randint(5, size=n)
183
+ ggplot() + \\
184
+ geom_bar(aes(x='x', y='y', fill='x'), data={'x': x, 'y': y}, \\
185
+ stat='identity', show_legend=False) + \\
186
+ scale_fill_discrete() + \\
187
+ coord_flip()
188
+
189
+ """
190
+
191
+ return _coord('flip', xlim=xlim, ylim=ylim, flip=True)
192
+
193
+
194
+ def coord_polar(xlim=None, ylim=None, theta=None, start=None, direction=None, transform_bkgr=None):
195
+ """
196
+ Polar coordinate system. It is used for pie charts and polar plots.
197
+
198
+ Parameters
199
+ ----------
200
+ xlim : list
201
+ Limits (2 elements) for the x axis.
202
+ 1st element defines lower limit, 2nd element defines upper limit.
203
+ None means no lower / upper bound - depending on the index in list.
204
+ ylim : list
205
+ Limits (2 elements) for the y axis.
206
+ 1st element defines lower limit, 2nd element defines upper limit.
207
+ None means no lower / upper bound - depending on the index in list.
208
+ theta : {'x', 'y'}, default='x'
209
+ Aesthetic that is used to map angle.
210
+ start : float, default=0
211
+ Offset relative to the starting angle (which is 12 o'clock), in radians.
212
+ direction : {1, -1}, default=1
213
+ Specify angle direction, 1=clockwise, -1=counter-clockwise.
214
+ transform_bkgr : bool, default=True
215
+ If True, the background is transformed to a circle, rectangle otherwise.
216
+
217
+ Examples
218
+ --------
219
+ .. jupyter-execute::
220
+ :linenos:
221
+ :emphasize-lines: 13
222
+
223
+ import numpy as np
224
+ from lets_plot import *
225
+ LetsPlot.setup_html()
226
+ np.random.seed(42)
227
+ n = 20
228
+ data = {
229
+ 'v': 1 + np.random.randint(5, size=n)
230
+ }
231
+ ggplot(data) + \\
232
+ geom_bar(aes(fill=as_discrete('v')), size=0, show_legend=False) + \\
233
+ scale_x_continuous(expand=[0, 0]) + \\
234
+ scale_y_continuous(expand=[0, 0]) + \\
235
+ coord_polar(theta='y')
236
+
237
+ """
238
+ return _coord('polar', xlim=xlim, ylim=ylim, theta=theta, start=start, direction=direction, transform_bkgr=transform_bkgr)
239
+
240
+
241
+ def _coord(name, **other):
242
+ return FeatureSpec('coord', name=name, **other)