lets-plot 4.7.0rc2__cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl → 4.7.1rc1__cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.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.
- lets_plot/__init__.py +14 -14
- lets_plot/_global_settings.py +0 -4
- lets_plot/_kbridge.py +11 -3
- lets_plot/_version.py +1 -1
- lets_plot/bistro/corr.py +28 -27
- lets_plot/bistro/im.py +4 -4
- lets_plot/bistro/joint.py +7 -7
- lets_plot/bistro/qq.py +16 -16
- lets_plot/bistro/residual.py +10 -10
- lets_plot/bistro/waterfall.py +26 -27
- lets_plot/export/ggsave_.py +29 -17
- lets_plot/frontend_context/_configuration.py +2 -2
- lets_plot/frontend_context/_html_contexts.py +6 -6
- lets_plot/geo_data/core.py +26 -22
- lets_plot/geo_data/geocoder.py +67 -56
- lets_plot/mapping.py +3 -3
- lets_plot/package_data/lets-plot.min.js +1 -1
- lets_plot/plot/annotation.py +5 -5
- lets_plot/plot/coord.py +4 -4
- lets_plot/plot/core.py +77 -141
- lets_plot/plot/expand_limits_.py +2 -2
- lets_plot/plot/facet.py +21 -17
- lets_plot/plot/font_features.py +3 -3
- lets_plot/plot/geom.py +1129 -1103
- lets_plot/plot/geom_extras.py +1 -1
- lets_plot/plot/geom_function_.py +16 -13
- lets_plot/plot/geom_imshow_.py +8 -7
- lets_plot/plot/geom_livemap_.py +38 -13
- lets_plot/plot/ggbunch_.py +1 -1
- lets_plot/plot/gggrid_.py +3 -3
- lets_plot/plot/ggtb_.py +1 -1
- lets_plot/plot/guide.py +9 -7
- lets_plot/plot/label.py +9 -9
- lets_plot/plot/marginal_layer.py +4 -4
- lets_plot/plot/plot.py +17 -16
- lets_plot/plot/pos.py +15 -15
- lets_plot/plot/sampling.py +8 -8
- lets_plot/plot/scale.py +153 -150
- lets_plot/plot/scale_colormap_mpl.py +9 -6
- lets_plot/plot/scale_convenience.py +6 -6
- lets_plot/plot/scale_identity_.py +9 -9
- lets_plot/plot/scale_position.py +16 -16
- lets_plot/plot/series_meta.py +7 -1
- lets_plot/plot/stat.py +64 -60
- lets_plot/plot/subplots.py +31 -22
- lets_plot/plot/theme_.py +93 -92
- lets_plot/plot/theme_set.py +15 -14
- lets_plot/plot/tooltip.py +14 -14
- lets_plot/plot/util.py +33 -3
- lets_plot/settings_utils.py +12 -12
- {lets_plot-4.7.0rc2.dist-info → lets_plot-4.7.1rc1.dist-info}/METADATA +63 -43
- lets_plot-4.7.1rc1.dist-info/RECORD +95 -0
- lets_plot_kotlin_bridge.cpython-310-aarch64-linux-gnu.so +0 -0
- lets_plot-4.7.0rc2.dist-info/RECORD +0 -95
- {lets_plot-4.7.0rc2.dist-info → lets_plot-4.7.1rc1.dist-info}/WHEEL +0 -0
- {lets_plot-4.7.0rc2.dist-info → lets_plot-4.7.1rc1.dist-info}/licenses/LICENSE +0 -0
- {lets_plot-4.7.0rc2.dist-info → lets_plot-4.7.1rc1.dist-info}/licenses/licenses/LICENSE.FreeType +0 -0
- {lets_plot-4.7.0rc2.dist-info → lets_plot-4.7.1rc1.dist-info}/licenses/licenses/LICENSE.ImageMagick +0 -0
- {lets_plot-4.7.0rc2.dist-info → lets_plot-4.7.1rc1.dist-info}/licenses/licenses/LICENSE.expat +0 -0
- {lets_plot-4.7.0rc2.dist-info → lets_plot-4.7.1rc1.dist-info}/licenses/licenses/LICENSE.fontconfig +0 -0
- {lets_plot-4.7.0rc2.dist-info → lets_plot-4.7.1rc1.dist-info}/top_level.txt +0 -0
lets_plot/__init__.py
CHANGED
|
@@ -119,18 +119,18 @@ class LetsPlot:
|
|
|
119
119
|
-----
|
|
120
120
|
List of possible settings:
|
|
121
121
|
|
|
122
|
-
- html_isolated_frame : preload Lets-Plot JS library or not (bool). Do not use this parameter explicitly. Instead you should call `LetsPlot.setup_html()
|
|
123
|
-
- offline : to work with notebook without the Internet connection (bool). Do not use this parameter explicitly. Instead you should call `LetsPlot.setup_html()
|
|
124
|
-
- no_js : do not generate HTML+JS as an output (bool). Do not use this parameter explicitly. Instead you should call `LetsPlot.setup_html()
|
|
122
|
+
- html_isolated_frame : preload Lets-Plot JS library or not (bool). Do not use this parameter explicitly. Instead you should call `LetsPlot.setup_html() <https://lets-plot.org/python/pages/api/lets_plot.LetsPlot.html#lets_plot.LetsPlot.setup_html>`__.
|
|
123
|
+
- offline : to work with notebook without the Internet connection (bool). Do not use this parameter explicitly. Instead you should call `LetsPlot.setup_html() <https://lets-plot.org/python/pages/api/lets_plot.LetsPlot.html#lets_plot.LetsPlot.setup_html>`__.
|
|
124
|
+
- no_js : do not generate HTML+JS as an output (bool). Do not use this parameter explicitly. Instead you should call `LetsPlot.setup_html() <https://lets-plot.org/python/pages/api/lets_plot.LetsPlot.html#lets_plot.LetsPlot.setup_html>`__. Also note that without JS interactive maps and tooltips doesn't work!
|
|
125
125
|
|
|
126
126
|
Interactive map settings could also be specified:
|
|
127
127
|
|
|
128
|
-
- maptiles_kind : kind of the tiles, could be 'raster_zxy' or 'vector_lets_plot'. Do not use this parameter explicitly. Instead you should construct it with functions `maptiles_zxy()
|
|
129
|
-
- maptiles_url : address of the tile server (str). Do not use this parameter explicitly. Instead you should construct it with functions `maptiles_zxy()
|
|
130
|
-
- maptiles_theme : tiles theme, could be 'color', 'light' or 'dark'. Do not use this parameter explicitly. Instead you should construct it with function `maptiles_lets_plot()
|
|
131
|
-
- maptiles_attribution : an attribution or a copyright notice to display on the map as required by the tile license (str, supports HTML links). Do not use this parameter explicitly. Instead you should construct it with function `maptiles_zxy()
|
|
132
|
-
- maptiles_min_zoom : minimal zoom limit (int). Do not use this parameter explicitly. Instead you should construct it with function `maptiles_zxy()
|
|
133
|
-
- maptiles_max_zoom : maximal zoom limit (int). Do not use this parameter explicitly. Instead you should construct it with function `maptiles_zxy()
|
|
128
|
+
- maptiles_kind : kind of the tiles, could be 'raster_zxy' or 'vector_lets_plot'. Do not use this parameter explicitly. Instead you should construct it with functions `maptiles_zxy() <https://lets-plot.org/python/pages/api/lets_plot.maptiles_zxy.html>`__ and `maptiles_lets_plot() <https://lets-plot.org/python/pages/api/lets_plot.maptiles_lets_plot.html>`__.
|
|
129
|
+
- maptiles_url : address of the tile server (str). Do not use this parameter explicitly. Instead you should construct it with functions `maptiles_zxy() <https://lets-plot.org/python/pages/api/lets_plot.maptiles_zxy.html>`__ and `maptiles_lets_plot() <https://lets-plot.org/python/pages/api/lets_plot.maptiles_lets_plot.html>`__.
|
|
130
|
+
- maptiles_theme : tiles theme, could be 'color', 'light' or 'dark'. Do not use this parameter explicitly. Instead you should construct it with function `maptiles_lets_plot() <https://lets-plot.org/python/pages/api/lets_plot.maptiles_lets_plot.html>`__.
|
|
131
|
+
- maptiles_attribution : an attribution or a copyright notice to display on the map as required by the tile license (str, supports HTML links). Do not use this parameter explicitly. Instead you should construct it with function `maptiles_zxy() <https://lets-plot.org/python/pages/api/lets_plot.maptiles_zxy.html>`__.
|
|
132
|
+
- maptiles_min_zoom : minimal zoom limit (int). Do not use this parameter explicitly. Instead you should construct it with function `maptiles_zxy() <https://lets-plot.org/python/pages/api/lets_plot.maptiles_zxy.html>`__.
|
|
133
|
+
- maptiles_max_zoom : maximal zoom limit (int). Do not use this parameter explicitly. Instead you should construct it with function `maptiles_zxy() <https://lets-plot.org/python/pages/api/lets_plot.maptiles_zxy.html>`__.
|
|
134
134
|
|
|
135
135
|
Examples
|
|
136
136
|
--------
|
|
@@ -170,7 +170,7 @@ class LetsPlot:
|
|
|
170
170
|
Parameters
|
|
171
171
|
----------
|
|
172
172
|
theme : spec
|
|
173
|
-
Theme spec provided by `theme(...)
|
|
173
|
+
Theme spec provided by `theme(...) <https://lets-plot.org/python/pages/api/lets_plot.theme.html>`__, ``theme_xxx()``, ``flavor_xxx()`` functions, or their sum.
|
|
174
174
|
|
|
175
175
|
"""
|
|
176
176
|
if theme is None:
|
|
@@ -189,10 +189,10 @@ class LetsPlot:
|
|
|
189
189
|
"""
|
|
190
190
|
Configure Lets-Plot to show its HTML output in an external browser.
|
|
191
191
|
|
|
192
|
-
When the "show externally" is set up, an invocation of
|
|
192
|
+
When the "show externally" is set up, an invocation of ``figire.show()`` will
|
|
193
193
|
- generate HTML output
|
|
194
194
|
- save it to a temporary file
|
|
195
|
-
- open the file in the default web browser or in a web browser specified by the
|
|
195
|
+
- open the file in the default web browser or in a web browser specified by the ``exec`` parameter.
|
|
196
196
|
|
|
197
197
|
Parameters
|
|
198
198
|
----------
|
|
@@ -202,8 +202,8 @@ class LetsPlot:
|
|
|
202
202
|
new : bool, default=False
|
|
203
203
|
If True, the URL is opened in a new window of the web browser.
|
|
204
204
|
If False, the URL is opened in the already opened web browser window.
|
|
205
|
-
The
|
|
206
|
-
Please note that the
|
|
205
|
+
The ``new`` parameter is only applicable when the ``exec`` parameter is not specified.
|
|
206
|
+
Please note that the ``new`` parameter is not supported by all web browsers and all OS-s.
|
|
207
207
|
|
|
208
208
|
Examples
|
|
209
209
|
--------
|
lets_plot/_global_settings.py
CHANGED
|
@@ -18,7 +18,6 @@ ENV_OFFLINE = 'LETS_PLOT_OFFLINE' # bool
|
|
|
18
18
|
ENV_NO_JS = 'LETS_PLOT_NO_JS' # bool
|
|
19
19
|
ENV_MAX_WIDTH = 'LETS_PLOT_MAX_WIDTH'
|
|
20
20
|
ENV_MAX_HEIGHT = 'LETS_PLOT_MAX_HEIGHT'
|
|
21
|
-
ENV_MAGICK_EXPORT = 'LETS_PLOT_MAGICK_EXPORT' # bool
|
|
22
21
|
ENV_MAPTILES_KIND = 'LETS_PLOT_MAPTILES_KIND'
|
|
23
22
|
ENV_MAPTILES_URL = 'LETS_PLOT_MAPTILES_URL'
|
|
24
23
|
ENV_MAPTILES_THEME = 'LETS_PLOT_MAPTILES_THEME'
|
|
@@ -47,7 +46,6 @@ JS_NAME = 'js_name'
|
|
|
47
46
|
JS_URL_MANUAL = 'js_url_manual'
|
|
48
47
|
MAX_WIDTH = 'max_width'
|
|
49
48
|
MAX_HEIGHT = 'max_height'
|
|
50
|
-
MAGICK_EXPORT = 'magick_export'
|
|
51
49
|
|
|
52
50
|
MAPTILES_KIND = 'maptiles_kind'
|
|
53
51
|
MAPTILES_URL = 'maptiles_url'
|
|
@@ -85,7 +83,6 @@ def _get_env_val(actual_name: str) -> Any:
|
|
|
85
83
|
_settings = {
|
|
86
84
|
OFFLINE: _init_value(OFFLINE, False), # default: download from CDN
|
|
87
85
|
NO_JS: _init_value(NO_JS, False),
|
|
88
|
-
MAGICK_EXPORT: _init_value(MAGICK_EXPORT, True), # default: use cairo for export
|
|
89
86
|
# JS_BASE_URL: 'https://dl.bintray.com/jetbrains/lets-plot',
|
|
90
87
|
# JS_BASE_URL: "https://cdnjs.cloudflare.com/ajax/libs/lets-plot",
|
|
91
88
|
JS_BASE_URL: "https://cdn.jsdelivr.net/gh/JetBrains/lets-plot@v{version}".format(version=__version__),
|
|
@@ -101,7 +98,6 @@ _settings = {
|
|
|
101
98
|
|
|
102
99
|
'dev_' + OFFLINE: _init_value('dev_' + OFFLINE, True), # default: embed js into the notebook
|
|
103
100
|
'dev_' + NO_JS: _init_value('dev_' + NO_JS, False),
|
|
104
|
-
'dev_' + MAGICK_EXPORT: _init_value('dev_' + MAGICK_EXPORT, True), # default: use cairo for export
|
|
105
101
|
# We don't publish "dev" version, it must be served on localhost:
|
|
106
102
|
# $ cd lets-plot
|
|
107
103
|
# ./gradlew js-package:jsBrowserDevelopmentWebpack
|
lets_plot/_kbridge.py
CHANGED
|
@@ -15,15 +15,23 @@ def _generate_dynamic_display_html(plot_spec: Dict) -> str:
|
|
|
15
15
|
return lets_plot_kotlin_bridge.generate_html(plot_spec)
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
def _generate_svg(plot_spec: Dict, use_css_pixelated_image_rendering: bool
|
|
18
|
+
def _generate_svg(plot_spec: Dict, w: float = None, h: float = None, unit: str = None, use_css_pixelated_image_rendering: bool=True) -> str:
|
|
19
19
|
plot_spec = _standardize_plot_spec(plot_spec)
|
|
20
|
-
|
|
20
|
+
w = -1.0 if w is None else float(w)
|
|
21
|
+
h = -1.0 if h is None else float(h)
|
|
22
|
+
unit = '' if unit is None else str(unit) # None is not a valid value for str type - PyArg_ParseTuple will fail
|
|
23
|
+
return lets_plot_kotlin_bridge.export_svg(plot_spec, w, h, unit, use_css_pixelated_image_rendering)
|
|
21
24
|
|
|
22
|
-
def
|
|
25
|
+
def _generate_png(bytestring: Dict, output_width: float, output_height: float, unit: str, dpi: int, scale: float) -> str:
|
|
23
26
|
"""
|
|
24
27
|
Export a plot to PNG format. Returns base64 encoded string of the PNG image.
|
|
25
28
|
"""
|
|
26
29
|
plot_spec = _standardize_plot_spec(bytestring)
|
|
30
|
+
output_width = -1.0 if output_width is None else float(output_width)
|
|
31
|
+
output_height = -1.0 if output_height is None else float(output_height)
|
|
32
|
+
unit = '' if unit is None else str(unit) # None is not a valid value for str type - PyArg_ParseTuple will fail
|
|
33
|
+
dpi = -1 if dpi is None else int(dpi)
|
|
34
|
+
scale = -1.0 if scale is None else float(scale)
|
|
27
35
|
return lets_plot_kotlin_bridge.export_png(plot_spec, output_width, output_height, unit, dpi, scale)
|
|
28
36
|
|
|
29
37
|
|
lets_plot/_version.py
CHANGED
lets_plot/bistro/corr.py
CHANGED
|
@@ -70,8 +70,8 @@ class corr_plot:
|
|
|
70
70
|
|
|
71
71
|
Notes
|
|
72
72
|
-----
|
|
73
|
-
To hide axis tooltips, set 'blank' or the result of `element_blank()
|
|
74
|
-
to the
|
|
73
|
+
To hide axis tooltips, set 'blank' or the result of `element_blank() <https://lets-plot.org/python/pages/api/lets_plot.element_blank.html>`__
|
|
74
|
+
to the ``axis_tooltip``, ``axis_tooltip_x`` or ``axis_tooltip_y`` parameter of the `theme() <https://lets-plot.org/python/pages/api/lets_plot.theme.html>`__.
|
|
75
75
|
|
|
76
76
|
Examples
|
|
77
77
|
--------
|
|
@@ -146,7 +146,7 @@ class corr_plot:
|
|
|
146
146
|
"""
|
|
147
147
|
Parameters
|
|
148
148
|
----------
|
|
149
|
-
data : dict or Pandas or Polars
|
|
149
|
+
data : dict or Pandas or Polars ``DataFrame``
|
|
150
150
|
Correlation matrix or data (correlation will be calculated for each variable pair).
|
|
151
151
|
Data will be recognized as correlation matrix if it has a square shape and all values are
|
|
152
152
|
in range -1.0..+1.0 or NaN.
|
|
@@ -189,7 +189,7 @@ class corr_plot:
|
|
|
189
189
|
|
|
190
190
|
Returns
|
|
191
191
|
-------
|
|
192
|
-
|
|
192
|
+
``corr_plot``
|
|
193
193
|
Correlation plot specification.
|
|
194
194
|
"""
|
|
195
195
|
return self._duplicate()._set_points(type, diag)
|
|
@@ -215,7 +215,7 @@ class corr_plot:
|
|
|
215
215
|
|
|
216
216
|
Returns
|
|
217
217
|
-------
|
|
218
|
-
|
|
218
|
+
``corr_plot``
|
|
219
219
|
Correlation plot specification.
|
|
220
220
|
"""
|
|
221
221
|
return self._duplicate()._set_labels(type, diag, map_size, color)
|
|
@@ -234,14 +234,15 @@ class corr_plot:
|
|
|
234
234
|
|
|
235
235
|
Returns
|
|
236
236
|
-------
|
|
237
|
-
|
|
237
|
+
``corr_plot``
|
|
238
238
|
Correlation plot specification.
|
|
239
239
|
"""
|
|
240
240
|
return self._duplicate()._set_tiles(type, diag)
|
|
241
241
|
|
|
242
242
|
def palette_gradient(self, low, mid, high):
|
|
243
243
|
"""
|
|
244
|
-
Set `scale_color_gradient2()
|
|
244
|
+
Set `scale_color_gradient2() <https://lets-plot.org/python/pages/api/lets_plot.scale_color_gradient2.html>`__ and
|
|
245
|
+
`scale_fill_gradient() <https://lets-plot.org/python/pages/api/lets_plot.scale_fill_gradient.html>`__ for corr plot.
|
|
245
246
|
|
|
246
247
|
Parameters
|
|
247
248
|
----------
|
|
@@ -254,106 +255,106 @@ class corr_plot:
|
|
|
254
255
|
|
|
255
256
|
Returns
|
|
256
257
|
-------
|
|
257
|
-
|
|
258
|
+
``corr_plot``
|
|
258
259
|
Correlation plot specification.
|
|
259
260
|
"""
|
|
260
261
|
return self._duplicate()._set_gradient_palette(low, mid, high)
|
|
261
262
|
|
|
262
263
|
def palette_BrBG(self):
|
|
263
264
|
"""
|
|
264
|
-
Set `scale_color_brewer()
|
|
265
|
+
Set `scale_color_brewer() <https://lets-plot.org/python/pages/api/lets_plot.scale_color_brewer.html>`__ with BrBG palette for corr plot.
|
|
265
266
|
|
|
266
267
|
Returns
|
|
267
268
|
-------
|
|
268
|
-
|
|
269
|
+
``corr_plot``
|
|
269
270
|
Correlation plot specification.
|
|
270
271
|
"""
|
|
271
272
|
return self._set_brewer_palette('BrBG')
|
|
272
273
|
|
|
273
274
|
def palette_PiYG(self):
|
|
274
275
|
"""
|
|
275
|
-
Set `scale_color_brewer()
|
|
276
|
+
Set `scale_color_brewer() <https://lets-plot.org/python/pages/api/lets_plot.scale_color_brewer.html>`__ with PiYG palette for corr plot.
|
|
276
277
|
|
|
277
278
|
Returns
|
|
278
279
|
-------
|
|
279
|
-
|
|
280
|
+
``corr_plot``
|
|
280
281
|
Correlation plot specification.
|
|
281
282
|
"""
|
|
282
283
|
return self._duplicate()._set_brewer_palette('PiYG')
|
|
283
284
|
|
|
284
285
|
def palette_PRGn(self):
|
|
285
286
|
"""
|
|
286
|
-
Set `scale_color_brewer()
|
|
287
|
+
Set `scale_color_brewer() <https://lets-plot.org/python/pages/api/lets_plot.scale_color_brewer.html>`__ with PRGn palette for corr plot.
|
|
287
288
|
|
|
288
289
|
Returns
|
|
289
290
|
-------
|
|
290
|
-
|
|
291
|
+
``corr_plot``
|
|
291
292
|
Correlation plot specification.
|
|
292
293
|
"""
|
|
293
294
|
return self._duplicate()._set_brewer_palette('PRGn')
|
|
294
295
|
|
|
295
296
|
def palette_PuOr(self):
|
|
296
297
|
"""
|
|
297
|
-
Set `scale_color_brewer()
|
|
298
|
+
Set `scale_color_brewer() <https://lets-plot.org/python/pages/api/lets_plot.scale_color_brewer.html>`__ with PuOr palette for corr plot.
|
|
298
299
|
|
|
299
300
|
Returns
|
|
300
301
|
-------
|
|
301
|
-
|
|
302
|
+
``corr_plot``
|
|
302
303
|
Correlation plot specification.
|
|
303
304
|
"""
|
|
304
305
|
return self._duplicate()._set_brewer_palette('PuOr')
|
|
305
306
|
|
|
306
307
|
def palette_RdBu(self):
|
|
307
308
|
"""
|
|
308
|
-
Set `scale_color_brewer()
|
|
309
|
+
Set `scale_color_brewer() <https://lets-plot.org/python/pages/api/lets_plot.scale_color_brewer.html>`__ with RdBu palette for corr plot.
|
|
309
310
|
|
|
310
311
|
Returns
|
|
311
312
|
-------
|
|
312
|
-
|
|
313
|
+
``corr_plot``
|
|
313
314
|
Correlation plot specification.
|
|
314
315
|
"""
|
|
315
316
|
return self._duplicate()._set_brewer_palette('RdBu')
|
|
316
317
|
|
|
317
318
|
def palette_RdGy(self):
|
|
318
319
|
"""
|
|
319
|
-
Set `scale_color_brewer()
|
|
320
|
+
Set `scale_color_brewer() <https://lets-plot.org/python/pages/api/lets_plot.scale_color_brewer.html>`__ with RdGy palette for corr plot.
|
|
320
321
|
|
|
321
322
|
Returns
|
|
322
323
|
-------
|
|
323
|
-
|
|
324
|
+
``corr_plot``
|
|
324
325
|
Correlation plot specification.
|
|
325
326
|
"""
|
|
326
327
|
return self._duplicate()._set_brewer_palette('RdGy')
|
|
327
328
|
|
|
328
329
|
def palette_RdYlBu(self):
|
|
329
330
|
"""
|
|
330
|
-
Set `scale_color_brewer()
|
|
331
|
+
Set `scale_color_brewer() <https://lets-plot.org/python/pages/api/lets_plot.scale_color_brewer.html>`__ with RdYlBu palette for corr plot.
|
|
331
332
|
|
|
332
333
|
Returns
|
|
333
334
|
-------
|
|
334
|
-
|
|
335
|
+
``corr_plot``
|
|
335
336
|
Correlation plot specification.
|
|
336
337
|
"""
|
|
337
338
|
return self._duplicate()._set_brewer_palette('RdYlBu')
|
|
338
339
|
|
|
339
340
|
def palette_RdYlGn(self):
|
|
340
341
|
"""
|
|
341
|
-
Set `scale_color_brewer()
|
|
342
|
+
Set `scale_color_brewer() <https://lets-plot.org/python/pages/api/lets_plot.scale_color_brewer.html>`__ with RdYlGn palette for corr plot.
|
|
342
343
|
|
|
343
344
|
Returns
|
|
344
345
|
-------
|
|
345
|
-
|
|
346
|
+
``corr_plot``
|
|
346
347
|
Correlation plot specification.
|
|
347
348
|
"""
|
|
348
349
|
return self._duplicate()._set_brewer_palette('RdYlGn')
|
|
349
350
|
|
|
350
351
|
def palette_Spectral(self):
|
|
351
352
|
"""
|
|
352
|
-
Set `scale_color_brewer()
|
|
353
|
+
Set `scale_color_brewer() <https://lets-plot.org/python/pages/api/lets_plot.scale_color_brewer.html>`__ with Spectral palette for corr plot.
|
|
353
354
|
|
|
354
355
|
Returns
|
|
355
356
|
-------
|
|
356
|
-
|
|
357
|
+
``corr_plot``
|
|
357
358
|
Correlation plot specification.
|
|
358
359
|
"""
|
|
359
360
|
return self._duplicate()._set_brewer_palette('Spectral')
|
|
@@ -391,7 +392,7 @@ class corr_plot:
|
|
|
391
392
|
|
|
392
393
|
Returns
|
|
393
394
|
-------
|
|
394
|
-
|
|
395
|
+
``PlotSpec``
|
|
395
396
|
Plot specification.
|
|
396
397
|
"""
|
|
397
398
|
|
lets_plot/bistro/im.py
CHANGED
|
@@ -33,8 +33,8 @@ def image_matrix(image_data_array,
|
|
|
33
33
|
|
|
34
34
|
Parameters
|
|
35
35
|
----------
|
|
36
|
-
image_data_array :
|
|
37
|
-
2D
|
|
36
|
+
image_data_array : ``ndarray``
|
|
37
|
+
2D ``numpy.ndarray`` containing images.
|
|
38
38
|
cmap : str, optional
|
|
39
39
|
Name of colormap. For example "viridis", "magma", "plasma", "inferno", or any other colormap
|
|
40
40
|
which is supported by the Palettable package (https://github.com/jiffyclub/palettable)
|
|
@@ -45,7 +45,7 @@ def image_matrix(image_data_array,
|
|
|
45
45
|
This parameter is ignored for RGB(A) images.
|
|
46
46
|
vmin, vmax : number, optional
|
|
47
47
|
Define the data range used for luminance normalization in grey-scale images.
|
|
48
|
-
This parameter is ignored for RGB(A) images or if parameter
|
|
48
|
+
This parameter is ignored for RGB(A) images or if parameter ``norm=False``.
|
|
49
49
|
scale : float, default=1.0
|
|
50
50
|
Specify the image size magnification factor.
|
|
51
51
|
spacer : number, default=1
|
|
@@ -53,7 +53,7 @@ def image_matrix(image_data_array,
|
|
|
53
53
|
|
|
54
54
|
Returns
|
|
55
55
|
-------
|
|
56
|
-
|
|
56
|
+
``SupPlotsSpec``
|
|
57
57
|
A specification describing the combined figure with all plots and their layout.
|
|
58
58
|
|
|
59
59
|
Examples
|
lets_plot/bistro/joint.py
CHANGED
|
@@ -47,19 +47,19 @@ def joint_plot(data, x, y, *,
|
|
|
47
47
|
|
|
48
48
|
Parameters
|
|
49
49
|
----------
|
|
50
|
-
data : dict or Pandas or Polars
|
|
50
|
+
data : dict or Pandas or Polars ``DataFrame``
|
|
51
51
|
The data to be displayed.
|
|
52
52
|
x, y : str
|
|
53
53
|
Names of a variables.
|
|
54
54
|
geom : {'point', 'tile', 'hex', 'density2d', 'density2df'}, default='point'
|
|
55
55
|
The geometric object to use to display the data.
|
|
56
56
|
bins : int or list of int
|
|
57
|
-
Number of bins in both directions, vertical and horizontal. Overridden by
|
|
57
|
+
Number of bins in both directions, vertical and horizontal. Overridden by ``binwidth``.
|
|
58
58
|
If only one value given - interpret it as list of two equal values.
|
|
59
59
|
Applicable simultaneously for 'tile'/'hex' geom and 'histogram' marginal.
|
|
60
60
|
binwidth : float or list of float
|
|
61
61
|
The width of the bins in both directions, vertical and horizontal.
|
|
62
|
-
Overrides
|
|
62
|
+
Overrides ``bins``. The default is to use bin widths that cover the entire range of the data.
|
|
63
63
|
If only one value given - interpret it as list of two equal values.
|
|
64
64
|
Applicable simultaneously for 'tile'/'hex' geom and 'histogram' marginal.
|
|
65
65
|
color : str
|
|
@@ -86,7 +86,7 @@ def joint_plot(data, x, y, *,
|
|
|
86
86
|
Second parameter is a string specifying which sides of the plot the marginal layer will appear on.
|
|
87
87
|
Possible values: 't' (top), 'b' (bottom), 'l' (left), 'r' (right).
|
|
88
88
|
Third parameter (optional) is size of marginal.
|
|
89
|
-
To suppress marginals use
|
|
89
|
+
To suppress marginals use ``marginal='none'``.
|
|
90
90
|
Examples:
|
|
91
91
|
"hist:tr:0.3",
|
|
92
92
|
"dens:tr,hist:bl",
|
|
@@ -94,13 +94,13 @@ def joint_plot(data, x, y, *,
|
|
|
94
94
|
|
|
95
95
|
Returns
|
|
96
96
|
-------
|
|
97
|
-
|
|
97
|
+
``PlotSpec``
|
|
98
98
|
Plot object specification.
|
|
99
99
|
|
|
100
100
|
Notes
|
|
101
101
|
-----
|
|
102
|
-
To hide axis tooltips, set 'blank' or the result of `element_blank()
|
|
103
|
-
to the
|
|
102
|
+
To hide axis tooltips, set 'blank' or the result of `element_blank() <https://lets-plot.org/python/pages/api/lets_plot.element_blank.html>`__
|
|
103
|
+
to the ``axis_tooltip``, ``axis_tooltip_x`` or ``axis_tooltip_y`` parameter of the `theme() <https://lets-plot.org/python/pages/api/lets_plot.theme.html>`__.
|
|
104
104
|
|
|
105
105
|
Examples
|
|
106
106
|
--------
|
lets_plot/bistro/qq.py
CHANGED
|
@@ -16,14 +16,14 @@ def qq_plot(data=None, sample=None, *, x=None, y=None,
|
|
|
16
16
|
"""
|
|
17
17
|
Produce a Q-Q plot (quantile-quantile plot).
|
|
18
18
|
|
|
19
|
-
Supply the
|
|
20
|
-
('normal' or as otherwise specified by the
|
|
19
|
+
Supply the ``sample`` parameter to compare distribution of observations with a theoretical distribution
|
|
20
|
+
('normal' or as otherwise specified by the ``distribution`` parameter).
|
|
21
21
|
|
|
22
|
-
Alternatively, supply
|
|
22
|
+
Alternatively, supply ``x`` and ``y`` parameters to compare the distribution of ``x`` with the distribution of ``y``.
|
|
23
23
|
|
|
24
24
|
Parameters
|
|
25
25
|
----------
|
|
26
|
-
data : dict or Pandas or Polars
|
|
26
|
+
data : dict or Pandas or Polars ``DataFrame``
|
|
27
27
|
The data to be displayed.
|
|
28
28
|
sample : str
|
|
29
29
|
Name of variable specifying a vector of observations used for computing of "sample quantiles".
|
|
@@ -33,16 +33,16 @@ def qq_plot(data=None, sample=None, *, x=None, y=None,
|
|
|
33
33
|
x and y "sample quantiles".
|
|
34
34
|
Use these two parameters to produce a "sample X vs. sample Y" Q-Q plot.
|
|
35
35
|
distribution : {'norm', 'uniform', 't', 'gamma', 'exp', 'chi2'}, default='norm'
|
|
36
|
-
Distribution function to use. Could be specified if
|
|
36
|
+
Distribution function to use. Could be specified if ``sample`` is.
|
|
37
37
|
dparams : list
|
|
38
38
|
Additional parameters (of float type) passed on to distribution function.
|
|
39
|
-
Could be specified if
|
|
40
|
-
If
|
|
41
|
-
If
|
|
42
|
-
If
|
|
43
|
-
If
|
|
44
|
-
If
|
|
45
|
-
If
|
|
39
|
+
Could be specified if ``sample`` is.
|
|
40
|
+
If ``distribution`` is ``'norm'`` then ``dparams`` is a pair [mean, std] (=[0.0, 1.0] by default).
|
|
41
|
+
If ``distribution`` is ``'uniform'`` then ``dparams`` is a pair [a, b] (=[0.0, 1.0] by default).
|
|
42
|
+
If ``distribution`` is ``'t'`` then ``dparams`` is an integer number [d] (=[1] by default).
|
|
43
|
+
If ``distribution`` is ``'gamma'`` then ``dparams`` is a pair [alpha, beta] (=[1.0, 1.0] by default).
|
|
44
|
+
If ``distribution`` is ``'exp'`` then ``dparams`` is a float number [lambda] (=[1.0] by default).
|
|
45
|
+
If ``distribution`` is ``'chi2'`` then ``dparams`` is an integer number [k] (=[1] by default).
|
|
46
46
|
quantiles : list, default=[0.25, 0.75]
|
|
47
47
|
Pair of quantiles to use when fitting the Q-Q line.
|
|
48
48
|
group : str
|
|
@@ -59,7 +59,7 @@ def qq_plot(data=None, sample=None, *, x=None, y=None,
|
|
|
59
59
|
Second parameter is a string specifying which sides of the plot the marginal layer will appear on.
|
|
60
60
|
Possible values: 't' (top), 'b' (bottom), 'l' (left), 'r' (right).
|
|
61
61
|
Third parameter (optional) is size of marginal.
|
|
62
|
-
To suppress marginals use
|
|
62
|
+
To suppress marginals use ``marginal='none'``.
|
|
63
63
|
Examples:
|
|
64
64
|
"hist:tr:0.3",
|
|
65
65
|
"dens:tr,hist:bl",
|
|
@@ -91,7 +91,7 @@ def qq_plot(data=None, sample=None, *, x=None, y=None,
|
|
|
91
91
|
|
|
92
92
|
Returns
|
|
93
93
|
-------
|
|
94
|
-
|
|
94
|
+
``PlotSpec``
|
|
95
95
|
Plot object specification.
|
|
96
96
|
|
|
97
97
|
Notes
|
|
@@ -104,8 +104,8 @@ def qq_plot(data=None, sample=None, *, x=None, y=None,
|
|
|
104
104
|
|
|
105
105
|
----
|
|
106
106
|
|
|
107
|
-
To hide axis tooltips, set 'blank' or the result of `element_blank()
|
|
108
|
-
to the
|
|
107
|
+
To hide axis tooltips, set 'blank' or the result of `element_blank() <https://lets-plot.org/python/pages/api/lets_plot.element_blank.html>`__
|
|
108
|
+
to the ``axis_tooltip``, ``axis_tooltip_x`` or ``axis_tooltip_y`` parameter of the `theme() <https://lets-plot.org/python/pages/api/lets_plot.theme.html>`__.
|
|
109
109
|
|
|
110
110
|
Examples
|
|
111
111
|
--------
|
lets_plot/bistro/residual.py
CHANGED
|
@@ -141,12 +141,12 @@ def residual_plot(data=None, x=None, y=None, *,
|
|
|
141
141
|
"""
|
|
142
142
|
Produce a residual plot that shows the difference between the observed response and the fitted response values.
|
|
143
143
|
|
|
144
|
-
To use
|
|
144
|
+
To use ``residual_plot()``, the `numpy` and `pandas` libraries are required.
|
|
145
145
|
Also, `statsmodels` and `scipy` are required for 'lm' and 'loess' methods.
|
|
146
146
|
|
|
147
147
|
Parameters
|
|
148
148
|
----------
|
|
149
|
-
data : dict or Pandas or Polars
|
|
149
|
+
data : dict or Pandas or Polars ``DataFrame``
|
|
150
150
|
The data to be displayed.
|
|
151
151
|
x : str
|
|
152
152
|
Name of independent variable.
|
|
@@ -154,7 +154,7 @@ def residual_plot(data=None, x=None, y=None, *,
|
|
|
154
154
|
Name of dependent variable that will be fitted.
|
|
155
155
|
method : {'lm', 'loess', 'lowess', 'none'}, default='lm'
|
|
156
156
|
Fitting method: 'lm' (Linear Model) or 'loess'/'lowess' (Locally Estimated Scatterplot Smoothing).
|
|
157
|
-
If value of
|
|
157
|
+
If value of ``deg`` parameter is greater than 1 then linear model becomes polynomial of the given degree.
|
|
158
158
|
If method is 'none' then data lives as is.
|
|
159
159
|
deg : int, default=1
|
|
160
160
|
Degree of polynomial for linear regression model.
|
|
@@ -166,14 +166,14 @@ def residual_plot(data=None, x=None, y=None, *,
|
|
|
166
166
|
max_n : int
|
|
167
167
|
Maximum number of data-points for 'loess' method. If this quantity exceeded random sampling is applied to data.
|
|
168
168
|
geom : {'point', 'tile', 'hex', 'density2d', 'density2df', 'none'}, default='point'
|
|
169
|
-
The geometric object to use to display the data. No object will be used if
|
|
169
|
+
The geometric object to use to display the data. No object will be used if ``geom='none'``.
|
|
170
170
|
bins : int or list of int
|
|
171
|
-
Number of bins in both directions, vertical and horizontal. Overridden by
|
|
171
|
+
Number of bins in both directions, vertical and horizontal. Overridden by ``binwidth``.
|
|
172
172
|
If only one value given - interpret it as list of two equal values.
|
|
173
173
|
Applicable simultaneously for 'tile'/'hex' geom and 'histogram' marginal.
|
|
174
174
|
binwidth : float or list of float
|
|
175
175
|
The width of the bins in both directions, vertical and horizontal.
|
|
176
|
-
Overrides
|
|
176
|
+
Overrides ``bins``. The default is to use bin widths that cover the entire range of the data.
|
|
177
177
|
If only one value given - interpret it as list of two equal values.
|
|
178
178
|
Applicable simultaneously for 'tile'/'hex' geom and 'histogram' marginal.
|
|
179
179
|
color : str
|
|
@@ -198,7 +198,7 @@ def residual_plot(data=None, x=None, y=None, *,
|
|
|
198
198
|
Second parameter is a string specifying which sides of the plot the marginal layer will appear on.
|
|
199
199
|
Possible values: 't' (top), 'b' (bottom), 'l' (left), 'r' (right).
|
|
200
200
|
Third parameter (optional) is size of marginal.
|
|
201
|
-
To suppress marginals use
|
|
201
|
+
To suppress marginals use ``marginal='none'``.
|
|
202
202
|
Examples:
|
|
203
203
|
"hist:tr:0.3",
|
|
204
204
|
"dens:tr,hist:bl",
|
|
@@ -206,7 +206,7 @@ def residual_plot(data=None, x=None, y=None, *,
|
|
|
206
206
|
|
|
207
207
|
Returns
|
|
208
208
|
-------
|
|
209
|
-
|
|
209
|
+
``PlotSpec``
|
|
210
210
|
Plot object specification.
|
|
211
211
|
|
|
212
212
|
Notes
|
|
@@ -216,8 +216,8 @@ def residual_plot(data=None, x=None, y=None, *,
|
|
|
216
216
|
|
|
217
217
|
----
|
|
218
218
|
|
|
219
|
-
To hide axis tooltips, set 'blank' or the result of `element_blank()
|
|
220
|
-
to the
|
|
219
|
+
To hide axis tooltips, set 'blank' or the result of `element_blank() <https://lets-plot.org/python/pages/api/lets_plot.element_blank.html>`__
|
|
220
|
+
to the ``axis_tooltip``, ``axis_tooltip_x`` or ``axis_tooltip_y`` parameter of the `theme() <https://lets-plot.org/python/pages/api/lets_plot.theme.html>`__.
|
|
221
221
|
|
|
222
222
|
Examples
|
|
223
223
|
--------
|