lets-plot 4.7.0rc2__cp311-cp311-macosx_11_0_arm64.whl → 4.7.1rc1__cp311-cp311-macosx_11_0_arm64.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 (61) hide show
  1. lets_plot/__init__.py +14 -14
  2. lets_plot/_global_settings.py +0 -4
  3. lets_plot/_kbridge.py +11 -3
  4. lets_plot/_version.py +1 -1
  5. lets_plot/bistro/corr.py +28 -27
  6. lets_plot/bistro/im.py +4 -4
  7. lets_plot/bistro/joint.py +7 -7
  8. lets_plot/bistro/qq.py +16 -16
  9. lets_plot/bistro/residual.py +10 -10
  10. lets_plot/bistro/waterfall.py +26 -27
  11. lets_plot/export/ggsave_.py +29 -17
  12. lets_plot/frontend_context/_configuration.py +2 -2
  13. lets_plot/frontend_context/_html_contexts.py +6 -6
  14. lets_plot/geo_data/core.py +26 -22
  15. lets_plot/geo_data/geocoder.py +67 -56
  16. lets_plot/mapping.py +3 -3
  17. lets_plot/package_data/lets-plot.min.js +1 -1
  18. lets_plot/plot/annotation.py +5 -5
  19. lets_plot/plot/coord.py +4 -4
  20. lets_plot/plot/core.py +77 -141
  21. lets_plot/plot/expand_limits_.py +2 -2
  22. lets_plot/plot/facet.py +21 -17
  23. lets_plot/plot/font_features.py +3 -3
  24. lets_plot/plot/geom.py +1129 -1103
  25. lets_plot/plot/geom_extras.py +1 -1
  26. lets_plot/plot/geom_function_.py +16 -13
  27. lets_plot/plot/geom_imshow_.py +8 -7
  28. lets_plot/plot/geom_livemap_.py +38 -13
  29. lets_plot/plot/ggbunch_.py +1 -1
  30. lets_plot/plot/gggrid_.py +3 -3
  31. lets_plot/plot/ggtb_.py +1 -1
  32. lets_plot/plot/guide.py +9 -7
  33. lets_plot/plot/label.py +9 -9
  34. lets_plot/plot/marginal_layer.py +4 -4
  35. lets_plot/plot/plot.py +17 -16
  36. lets_plot/plot/pos.py +15 -15
  37. lets_plot/plot/sampling.py +8 -8
  38. lets_plot/plot/scale.py +153 -150
  39. lets_plot/plot/scale_colormap_mpl.py +9 -6
  40. lets_plot/plot/scale_convenience.py +6 -6
  41. lets_plot/plot/scale_identity_.py +9 -9
  42. lets_plot/plot/scale_position.py +16 -16
  43. lets_plot/plot/series_meta.py +7 -1
  44. lets_plot/plot/stat.py +64 -60
  45. lets_plot/plot/subplots.py +31 -22
  46. lets_plot/plot/theme_.py +93 -92
  47. lets_plot/plot/theme_set.py +15 -14
  48. lets_plot/plot/tooltip.py +14 -14
  49. lets_plot/plot/util.py +33 -3
  50. lets_plot/settings_utils.py +12 -12
  51. {lets_plot-4.7.0rc2.dist-info → lets_plot-4.7.1rc1.dist-info}/METADATA +63 -43
  52. lets_plot-4.7.1rc1.dist-info/RECORD +95 -0
  53. lets_plot_kotlin_bridge.cpython-311-darwin.so +0 -0
  54. lets_plot-4.7.0rc2.dist-info/RECORD +0 -95
  55. {lets_plot-4.7.0rc2.dist-info → lets_plot-4.7.1rc1.dist-info}/WHEEL +0 -0
  56. {lets_plot-4.7.0rc2.dist-info → lets_plot-4.7.1rc1.dist-info}/licenses/LICENSE +0 -0
  57. {lets_plot-4.7.0rc2.dist-info → lets_plot-4.7.1rc1.dist-info}/licenses/licenses/LICENSE.FreeType +0 -0
  58. {lets_plot-4.7.0rc2.dist-info → lets_plot-4.7.1rc1.dist-info}/licenses/licenses/LICENSE.ImageMagick +0 -0
  59. {lets_plot-4.7.0rc2.dist-info → lets_plot-4.7.1rc1.dist-info}/licenses/licenses/LICENSE.expat +0 -0
  60. {lets_plot-4.7.0rc2.dist-info → lets_plot-4.7.1rc1.dist-info}/licenses/licenses/LICENSE.fontconfig +0 -0
  61. {lets_plot-4.7.0rc2.dist-info → lets_plot-4.7.1rc1.dist-info}/top_level.txt +0 -0
@@ -27,7 +27,7 @@ def arrow(angle=None, length=None, ends=None, type=None):
27
27
 
28
28
  Returns
29
29
  -------
30
- `FeatureSpec`
30
+ ``FeatureSpec``
31
31
  Arrow object specification.
32
32
 
33
33
  Examples
@@ -86,11 +86,11 @@ def geom_function(mapping=None, *, data=None, stat=None, geom=None, position=Non
86
86
 
87
87
  Parameters
88
88
  ----------
89
- mapping : `FeatureSpec`
90
- Set of aesthetic mappings created by `aes()` function.
89
+ mapping : ``FeatureSpec``
90
+ Set of aesthetic mappings created by `aes() <https://lets-plot.org/python/pages/api/lets_plot.aes.html>`__ function.
91
91
  Aesthetic mappings describe the way that variables in the data are
92
92
  mapped to plot "aesthetics".
93
- data : dict or Pandas or Polars `DataFrame`
93
+ data : dict or Pandas or Polars ``DataFrame``
94
94
  The data to be used in this layer. Specify to describe the definition area of a function.
95
95
  If None, the default, the data will not be used at all.
96
96
  stat : str, default='identity'
@@ -100,19 +100,22 @@ def geom_function(mapping=None, *, data=None, stat=None, geom=None, position=Non
100
100
  'density2d' (computes and draws 2D kernel density estimate).
101
101
  geom : str, default='line'
102
102
  The geometry to display the function, as a string.
103
- position : str or `FeatureSpec`, default='identity'
103
+ position : str or ``FeatureSpec``, default='identity'
104
104
  Position adjustment.
105
105
  Either a position adjustment name: 'dodge', 'jitter', 'nudge', 'jitterdodge', 'fill',
106
- 'stack' or 'identity', or the result of calling a position adjustment function (e.g., `position_dodge()` etc.).
106
+ 'stack' or 'identity', or the result of calling a position adjustment function
107
+ (e.g., `position_dodge() <https://lets-plot.org/python/pages/api/lets_plot.position_dodge.html>`__ etc.).
107
108
  show_legend : bool, default=True
108
109
  False - do not show legend for this layer.
109
110
  inherit_aes : bool, default=True
110
111
  False - do not combine the layer aesthetic mappings with the plot shared mappings.
111
- manual_key : str or `layer_key`
112
+ manual_key : str or ``layer_key``
112
113
  The key to show in the manual legend.
113
- Specify text for the legend label or advanced settings using the `layer_key()` function.
114
- tooltips : `layer_tooltips`
115
- Result of the call to the `layer_tooltips()` function.
114
+ Specify text for the legend label or advanced settings using the
115
+ `layer_key() <https://lets-plot.org/python/pages/api/lets_plot.layer_key.html>`__ function.
116
+ tooltips : ``layer_tooltips``
117
+ Result of the call to the
118
+ `layer_tooltips() <https://lets-plot.org/python/pages/api/lets_plot.layer_tooltips.html>`__ function.
116
119
  Specify appearance, style and content.
117
120
  Set tooltips='none' to hide tooltips from the layer.
118
121
  fun : function
@@ -131,12 +134,12 @@ def geom_function(mapping=None, *, data=None, stat=None, geom=None, position=Non
131
134
 
132
135
  Returns
133
136
  -------
134
- `LayerSpec`
137
+ ``LayerSpec``
135
138
  Geom object specification.
136
139
 
137
140
  Notes
138
141
  -----
139
- `geom_function()` understands the following aesthetics mappings:
142
+ ``geom_function()`` understands the following aesthetics mappings:
140
143
 
141
144
  - x : x-axis value.
142
145
  - alpha : transparency level of a layer. Accept values between 0 and 1.
@@ -146,8 +149,8 @@ def geom_function(mapping=None, *, data=None, stat=None, geom=None, position=Non
146
149
 
147
150
  ----
148
151
 
149
- To hide axis tooltips, set 'blank' or the result of `element_blank()`
150
- to the `axis_tooltip`, `axis_tooltip_x` or `axis_tooltip_y` parameter of the `theme()`.
152
+ To hide axis tooltips, set 'blank' or the result of `element_blank() <https://lets-plot.org/python/pages/api/lets_plot.element_blank.html>`__
153
+ 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>`__.
151
154
 
152
155
  Examples
153
156
  --------
@@ -107,7 +107,8 @@ def geom_imshow(image_data, cmap=None, *,
107
107
  - (M, N, 3) - color RGB image
108
108
  - (M, N, 4) - color RGB image with alpha channel
109
109
 
110
- This geom is not as flexible as `geom_raster()` or `geom_tile()`
110
+ This geom is not as flexible as `geom_raster() <https://lets-plot.org/python/pages/api/lets_plot.geom_raster.html>`__
111
+ or `geom_tile() <https://lets-plot.org/python/pages/api/lets_plot.geom_tile.html>`__
111
112
  but vastly superior in the terms of rendering efficiency.
112
113
 
113
114
  Parameters
@@ -116,7 +117,7 @@ def geom_imshow(image_data, cmap=None, *,
116
117
  Specify image type, size and pixel values.
117
118
  Supported array shapes are:
118
119
 
119
- - (M, N): an image with scalar data. The values are mapped to colors (greys by default) using normalization. See parameters `norm`, `cmap`, `vmin`, `vmax`.
120
+ - (M, N): an image with scalar data. The values are mapped to colors (greys by default) using normalization. See parameters ``norm``, ``cmap``, ``vmin``, ``vmax``.
120
121
  - (M, N, 3): an image with RGB values (0-1 float or 0-255 int).
121
122
  - (M, N, 4): an image with RGBA values (0-1 float or 0-255 int).
122
123
 
@@ -134,18 +135,18 @@ def geom_imshow(image_data, cmap=None, *,
134
135
  The alpha blending value, between 0 (transparent) and 1 (opaque).
135
136
  vmin, vmax : number, optional
136
137
  Define the data range used for luminance normalization in grey-scale images.
137
- This parameter is ignored for RGB(A) images or if parameter `norm=False`.
138
+ This parameter is ignored for RGB(A) images or if parameter ``norm=False``.
138
139
  extent : list of 4 numbers: [left, right, bottom, top], optional
139
140
  Define image's bounding box in terms of the "data coordinates".
140
141
 
141
- - `left, right`: coordinates of pixels' outer edge along the x-axis for pixels in the 1-st and the last column.
142
- - `bottom, top`: coordinates of pixels' outer edge along the y-axis for pixels in the 1-st and the last row.
142
+ - ``left``, ``right``: coordinates of pixels' outer edge along the x-axis for pixels in the 1-st and the last column.
143
+ - ``bottom``, ``top``: coordinates of pixels' outer edge along the y-axis for pixels in the 1-st and the last row.
143
144
 
144
145
  The default is: [-0.5, ncol-0.5, -0.5, nrow-0.5]
145
146
  compression : int, optional
146
147
  The compression level to be used by the ``zlib`` module.
147
148
  Values from 0 (no compression) to 9 (highest).
148
- Value `None` means that the `zlib` module uses
149
+ Value None means that the ``zlib`` module uses
149
150
  the default level of compression (which is generally acceptable).
150
151
  show_legend : bool, default=True
151
152
  Greyscale images only.
@@ -155,7 +156,7 @@ def geom_imshow(image_data, cmap=None, *,
155
156
 
156
157
  Returns
157
158
  -------
158
- `LayerSpec`
159
+ ``LayerSpec``
159
160
  Geom object specification.
160
161
 
161
162
  Notes
@@ -47,14 +47,14 @@ def geom_livemap(*,
47
47
  Zoom of the map in the range 1 - 15.
48
48
  projection : str, default='epsg3857'
49
49
  The map projection. There are: 'epsg3857' for Mercator projection;
50
- 'epsg4326' for Equirectangular projection. `projection` only works
50
+ 'epsg4326' for Equirectangular projection. ``projection`` only works
51
51
  with vector map tiles (i.e. Lets-Plot map tiles).
52
52
  tiles : str
53
53
  Tile provider:
54
54
 
55
- - pass a predefined constant from the `tilesets` module (Lets-Plot's vector tiles, e.g. `LETS_PLOT_COLOR`, or external raster tiles, e.g. `OPEN_TOPO_MAP`);
55
+ - pass a predefined constant from the ``tilesets`` module (Lets-Plot's vector tiles, e.g. `LETS_PLOT_COLOR <https://lets-plot.org/python/pages/api/lets_plot.tilesets.LETS_PLOT_COLOR.html>`__, or external raster tiles, e.g. `OPEN_TOPO_MAP <https://lets-plot.org/python/pages/api/lets_plot.tilesets.OPEN_TOPO_MAP.html>`__);
56
56
  - pass a URL for a standard raster ZXY tile provider with {z}, {x} and {y} wildcards (e.g. 'http://my.tile.com/{z}/{x}/{y}.png') if the required tileset not present in the module;
57
- - pass the result of a call to a `maptiles_zxy()` function if further customisation is required (e.g. attribution or zoom).
57
+ - pass the result of a call to a `maptiles_zxy() <https://lets-plot.org/python/pages/api/lets_plot.maptiles_zxy.html>`__ function if further customisation is required (e.g. attribution or zoom).
58
58
 
59
59
  More information about tiles can be found here:
60
60
  https://lets-plot.org/python/pages/basemap_tiles.html
@@ -62,33 +62,37 @@ def geom_livemap(*,
62
62
  Show buttons "copy location" and "draw geometry".
63
63
  data_size_zoomin : int, default=0
64
64
  Control how zooming-in of the map widget increases size of geometry objects (circles, lines etc.) on map
65
- when the size is set by means of mapping between the data and the `size` aesthetic.
66
- `0` - size never increases;
67
- `-1` - size will be increasing without limits;
68
- `n` - a number of zooming-in steps (counting from the initial state of the map widget)
65
+ when the size is set by means of mapping between the data and the ``size`` aesthetic.
66
+ 0 - size never increases;
67
+ -1 - size will be increasing without limits;
68
+ n - a number of zooming-in steps (counting from the initial state of the map widget)
69
69
  when size of objects will be increasing. Farther zooming will no longer affect the size.
70
70
  const_size_zoomin : int, default=-1
71
71
  Control how zooming-in of the map widget increases size of geometry objects (circles, lines etc.) on map
72
72
  when the size is not linked to a data (i.e. constant size).
73
- `0` - size never increases;
74
- `-1` - size will be increasing without limits;
75
- `n` - a number of zooming-in steps (counting from the initial state of the map widget)
73
+ 0 - size never increases;
74
+ -1 - size will be increasing without limits;
75
+ n - a number of zooming-in steps (counting from the initial state of the map widget)
76
76
  when size of objects will be increasing. Farther zooming will no longer affect the size.
77
77
  other_args
78
78
  Other arguments passed on to the layer.
79
79
 
80
80
  Returns
81
81
  -------
82
- `LayerSpec`
82
+ ``LayerSpec``
83
83
  Geom object specification.
84
84
 
85
85
  Notes
86
86
  -----
87
- `geom_livemap()` draws a map, which can be dragged and zoomed.
87
+ ``geom_livemap()`` draws a map, which can be dragged and zoomed.
88
88
 
89
89
  ----
90
90
 
91
- By default the livemap area has a non-zero inset. You can get rid of this with the theme: `theme(plot_inset=0)`.
91
+ By default the livemap area has a non-zero inset. You can get rid of this with the theme: ``theme(plot_inset=0)``.
92
+
93
+ ---
94
+
95
+ When drawing a path with two points, the shortest route is taken. To create a longer arc, add intermediate points.
92
96
 
93
97
  Examples
94
98
  --------
@@ -120,6 +124,27 @@ def geom_livemap(*,
120
124
  geom_point(color='white', tooltips=layer_tooltips().line('@city')) + \\
121
125
  ggtitle("The shortest path between New York and Prague")
122
126
 
127
+ |
128
+
129
+ .. jupyter-execute::
130
+ :linenos:
131
+ :emphasize-lines: 9
132
+
133
+ from lets_plot import *
134
+ LetsPlot.setup_html()
135
+ data = {
136
+ 'x': [-170, 170, -170, 0, 170],
137
+ 'y': [10, 10, -10, -10, -10],
138
+ 'route': ['A', 'A', 'B', 'B', 'B'],
139
+ }
140
+ ggplot(data) + \\
141
+ geom_livemap(zoom=1, location=[180, 0]) + \\
142
+ geom_path(aes('x', 'y', color='route'), size=1) + \\
143
+ scale_color_manual(values=['red', 'green'],
144
+ labels={'A': "'x': [-170, 170]",
145
+ 'B': "'x': [-170, 0, 170]"}) + \\
146
+ ggtitle("A path that crosses the antimeridian")
147
+
123
148
  """
124
149
  if 'symbol' in other_args:
125
150
  print("WARN: The parameter 'symbol' is no longer supported. "
@@ -37,7 +37,7 @@ def ggbunch(plots: List,
37
37
 
38
38
  Returns
39
39
  -------
40
- `SupPlotsSpec`
40
+ ``SupPlotsSpec``
41
41
  A specification describing the combined figure with all plots and their layout.
42
42
 
43
43
  Examples
lets_plot/plot/gggrid_.py CHANGED
@@ -49,15 +49,15 @@ def gggrid(plots: list, ncol: int = None, *,
49
49
  vspace : float, default=4.0
50
50
  Cell vertical spacing in px.
51
51
  fit : bool, default=True
52
- Whether to stretch each plot to match the aspect ratio of its cell (`fit=True`),
53
- or to preserve the original aspect ratio of plots (`fit=False`).
52
+ Whether to stretch each plot to match the aspect ratio of its cell (``fit=True``),
53
+ or to preserve the original aspect ratio of plots (``fit=False``).
54
54
  align : bool, default=False
55
55
  If True, align inner areas (i.e. "geom" bounds) of plots.
56
56
  However, cells containing other (sub)grids are not participating in the plot "inner areas" layouting.
57
57
 
58
58
  Returns
59
59
  -------
60
- `SupPlotsSpec`
60
+ ``SupPlotsSpec``
61
61
  The grid specification.
62
62
 
63
63
  Examples
lets_plot/plot/ggtb_.py CHANGED
@@ -33,7 +33,7 @@ def ggtb() -> FeatureSpec:
33
33
 
34
34
  Returns
35
35
  -------
36
- `FeatureSpec`
36
+ ``FeatureSpec``
37
37
  Toolbar feature specification.
38
38
 
39
39
  Examples
lets_plot/plot/guide.py CHANGED
@@ -28,7 +28,7 @@ def guide_legend(title=None, *, nrow=None, ncol=None, byrow=None, override_aes=N
28
28
 
29
29
  Returns
30
30
  -------
31
- `FeatureSpec`
31
+ ``FeatureSpec``
32
32
  Legend guide specification.
33
33
 
34
34
  Notes
@@ -74,7 +74,7 @@ def guide_colorbar(title=None, *, barwidth=None, barheight=None, nbin=None):
74
74
 
75
75
  Returns
76
76
  -------
77
- `FeatureSpec`
77
+ ``FeatureSpec``
78
78
  Color guide specification.
79
79
 
80
80
  Notes
@@ -122,17 +122,17 @@ def guides(**kwargs):
122
122
 
123
123
  - An aesthetic name
124
124
  - 'manual' - a key referring to the default custom legend
125
- - A group name referring to a custom legend where the group is defined via the `layer_key()` function
125
+ - A group name referring to a custom legend where the group is defined via the `layer_key() <https://lets-plot.org/python/pages/api/lets_plot.layer_key.html>`__ function
126
126
 
127
127
  The value can be either:
128
128
 
129
129
  - A string ('colorbar', 'legend')
130
- - A call to a guide function (`guide_colorbar()`, `guide_legend()`) specifying additional arguments
130
+ - A call to a guide function (`guide_colorbar() <https://lets-plot.org/python/pages/api/lets_plot.guide_colorbar.html>`__, `guide_legend() <https://lets-plot.org/python/pages/api/lets_plot.guide_legend.html>`__) specifying additional arguments
131
131
  - 'none' to hide the guide
132
132
 
133
133
  Returns
134
134
  -------
135
- `FeatureSpec`
135
+ ``FeatureSpec``
136
136
  Guides specification.
137
137
 
138
138
  Examples
@@ -195,12 +195,14 @@ def layer_key(label, group=None, *, index=None, **kwargs):
195
195
 
196
196
  Returns
197
197
  -------
198
- `FeatureSpec`
198
+ ``FeatureSpec``
199
199
  Custom legend specification.
200
200
 
201
201
  Notes
202
202
  -----
203
- The group name specified with the `group` parameter can be used in the `labs()` and `guides()` functions
203
+ The group name specified with the ``group`` parameter can be used in the
204
+ `labs() <https://lets-plot.org/python/pages/api/lets_plot.labs.html>`__ and
205
+ `guides() <https://lets-plot.org/python/pages/api/lets_plot.guides.html>`__ functions
204
206
  to further customize the display of this group (e.g. change its name).
205
207
  In particular, items in the 'manual' group will be displayed without a title unless you change it manually.
206
208
 
lets_plot/plot/label.py CHANGED
@@ -27,12 +27,12 @@ def ggtitle(label, subtitle=None):
27
27
 
28
28
  Returns
29
29
  -------
30
- `FeatureSpec`
30
+ ``FeatureSpec``
31
31
  Plot title specification.
32
32
 
33
33
  Notes
34
34
  -----
35
- Split a long title/subtitle into two lines or more using `\\\\n` as a text separator.
35
+ Split a long title/subtitle into two lines or more using ``\\\\n`` as a text separator.
36
36
 
37
37
  Examples
38
38
  --------
@@ -61,7 +61,7 @@ def xlab(label):
61
61
 
62
62
  Returns
63
63
  -------
64
- `FeatureSpec`
64
+ ``FeatureSpec``
65
65
  Axis label specification.
66
66
 
67
67
  Examples
@@ -91,7 +91,7 @@ def ylab(label):
91
91
 
92
92
  Returns
93
93
  -------
94
- `FeatureSpec`
94
+ ``FeatureSpec``
95
95
  Axis label specification.
96
96
 
97
97
  Examples
@@ -125,15 +125,15 @@ def labs(title=None, subtitle=None, caption=None, **labels):
125
125
  labels
126
126
  Name-value pairs where the name can be:
127
127
 
128
- - An aesthetic name
129
- - 'manual' - a key referring to the default custom legend
130
- - A group name referring to a custom legend where the group is defined via the `layer_key()` function
128
+ - An aesthetic name.
129
+ - 'manual' - a key referring to the default custom legend.
130
+ - A group name referring to a custom legend where the group is defined via the `layer_key() <https://lets-plot.org/python/pages/api/lets_plot.layer_key.html>`__ function.
131
131
 
132
- The value should be a string, e.g. `color="New Color label"`.
132
+ The value should be a string, e.g. ``color="New Color label"``.
133
133
 
134
134
  Returns
135
135
  -------
136
- `FeatureSpec` or `FeatureSpecArray`
136
+ ``FeatureSpec`` or ``FeatureSpecArray``
137
137
  Labels specification.
138
138
 
139
139
  Examples
@@ -22,14 +22,14 @@ def ggmarginal(sides: str, *, size=None, layer: Union[LayerSpec, FeatureSpecArra
22
22
  Size of marginal geometry (width or height, depending on the margin side) as a fraction of the entire
23
23
  plotting area of the plot.
24
24
  The value should be in range [0.01..0.95].
25
- layer : `LayerSpec`
25
+ layer : ``LayerSpec``
26
26
  A marginal geometry layer.
27
- The result of calling of the `geom_xxx()` / `stat_xxx()` function.
28
- Marginal plot works best with `density`,`histogram`,`boxplot`,`violin` and `freqpoly` geometry layers.
27
+ The result of calling of the ``geom_xxx()``/``stat_xxx()`` function.
28
+ Marginal plot works best with ``density``, ``histogram``, ``boxplot``, ``violin`` and ``freqpoly`` geometry layers.
29
29
 
30
30
  Returns
31
31
  -------
32
- `FeatureSpec`
32
+ ``FeatureSpec``
33
33
  An object specifying a marginal geometry layer or a list of marginal geometry layers.
34
34
 
35
35
  Notes
lets_plot/plot/plot.py CHANGED
@@ -20,38 +20,38 @@ def ggplot(data=None, mapping=None):
20
20
 
21
21
  Parameters
22
22
  ----------
23
- data : dict or Pandas or Polars `DataFrame`
23
+ data : dict or Pandas or Polars ``DataFrame``
24
24
  Default dataset to use for the plot. If not specified,
25
25
  must be supplied in each layer added to the plot.
26
- mapping : `FeatureSpec`
26
+ mapping : ``FeatureSpec``
27
27
  Default list of aesthetic mappings to use for the plot.
28
28
  If not specified, must be supplied in each layer added to the plot.
29
29
 
30
30
  Returns
31
31
  -------
32
- `PlotSpec`
32
+ ``PlotSpec``
33
33
  Plot specification.
34
34
 
35
35
  Notes
36
36
  -----
37
- `ggplot()` initializes a ggplot object.
37
+ ``ggplot()`` initializes a ggplot object.
38
38
  It can be used to declare the input data frame for a graphic and
39
39
  to specify the set of plot aesthetics intended to be common
40
40
  throughout all subsequent layers unless specifically overridden.
41
41
 
42
- `ggplot()` is typically used to construct a plot incrementally,
42
+ ``ggplot()`` is typically used to construct a plot incrementally,
43
43
  using the + operator to add layers to the existing ggplot object.
44
44
  This is advantageous in that the code is explicit about which layers
45
45
  are added and the order in which they are added. For complex graphics
46
- with multiple layers, initialization with `ggplot()` is recommended.
46
+ with multiple layers, initialization with ``ggplot()`` is recommended.
47
47
 
48
48
  There are three common ways to invoke ggplot (see examples below):
49
49
 
50
- - `ggplot(data, aes(x, y))`: This method is recommended if all layers use the same data and the same set of aesthetics, although this method can also be used to add a layer using data from another data frame.
51
- - `ggplot(data)`: This method specifies the default data frame to use for the plot, but no aesthetics are defined up front. This is useful when one data frame is used predominantly as layers are added, but the aesthetics may vary from one layer to another.
52
- - `ggplot()`: This method initializes a skeleton ggplot object which is fleshed out as layers are added. This method is useful when multiple data frames are used to produce different layers, as is often the case in complex graphics.
50
+ - ``ggplot(data, aes(x, y))``: This method is recommended if all layers use the same data and the same set of aesthetics, although this method can also be used to add a layer using data from another data frame.
51
+ - ``ggplot(data)``: This method specifies the default data frame to use for the plot, but no aesthetics are defined up front. This is useful when one data frame is used predominantly as layers are added, but the aesthetics may vary from one layer to another.
52
+ - ``ggplot()``: This method initializes a skeleton ggplot object which is fleshed out as layers are added. This method is useful when multiple data frames are used to produce different layers, as is often the case in complex graphics.
53
53
 
54
- `ggplot()` with no layers defined will produce an error message:
54
+ ``ggplot()`` with no layers defined will produce an error message:
55
55
  "No layers in plot".
56
56
 
57
57
  Examples
@@ -109,7 +109,7 @@ def ggsize(width, height):
109
109
 
110
110
  Returns
111
111
  -------
112
- `FeatureSpec`
112
+ ``FeatureSpec``
113
113
  Plot size specification.
114
114
 
115
115
  Examples
@@ -142,13 +142,14 @@ def ggsize(width, height):
142
142
 
143
143
  class GGBunch(FeatureSpec):
144
144
  """
145
- Class `GGBunch` is deprecated and will be removed in future releases.
146
- Please, use function `ggbunch()` to combine several plots into a single figure with custom layout.
145
+ Class ``GGBunch`` is deprecated and will be removed in future releases.
146
+ Please, use function `ggbunch() <https://lets-plot.org/python/pages/api/lets_plot.ggbunch.html>`__
147
+ to combine several plots into a single figure with custom layout.
147
148
 
148
149
  Collection of plots created by ggplot function.
149
- Use method `add_plot()` to add plot to 'bunch'.
150
+ Use method ``add_plot()`` to add plot to 'bunch'.
150
151
  Each plot can have arbitrary location and size.
151
- Use `show()` to draw all plots in bunch.
152
+ Use ``show()`` to draw all plots in bunch.
152
153
 
153
154
  Examples
154
155
  --------
@@ -191,7 +192,7 @@ class GGBunch(FeatureSpec):
191
192
  Parameters
192
193
  ----------
193
194
  plot_spec
194
- Plot specification created by `ggplot()` function.
195
+ Plot specification created by ``ggplot()`` function.
195
196
  x : int
196
197
  x-coordinate of plot origin in px.
197
198
  y : int
lets_plot/plot/pos.py CHANGED
@@ -26,7 +26,7 @@ def position_dodge(width=None):
26
26
 
27
27
  Returns
28
28
  -------
29
- `FeatureSpec`
29
+ ``FeatureSpec``
30
30
  Geom object position specification.
31
31
 
32
32
  Notes
@@ -56,7 +56,7 @@ def position_dodge(width=None):
56
56
 
57
57
  def position_dodgev(height=None):
58
58
  """
59
- Function `position_dodgev()` is deprecated and will be removed in future releases.
59
+ Function ``position_dodgev()`` is deprecated and will be removed in future releases.
60
60
 
61
61
  """
62
62
  print("WARN: The function position_dodgev() is deprecated and will be removed in future releases.")
@@ -84,7 +84,7 @@ def position_jitter(width=None, height=None, seed=None):
84
84
 
85
85
  Returns
86
86
  -------
87
- `FeatureSpec`
87
+ ``FeatureSpec``
88
88
  Geom object position specification.
89
89
 
90
90
  Notes
@@ -129,12 +129,12 @@ def position_nudge(x=None, y=None, unit=None):
129
129
  Possible values:
130
130
 
131
131
  - 'identity': a unit of 1 corresponds to a difference of 1 in data space;
132
- - 'size': a unit of 1 corresponds to the diameter of a point with `size=1`;
132
+ - 'size': a unit of 1 corresponds to the diameter of a point with ``size=1``;
133
133
  - 'px': the unit is measured in screen pixels.
134
134
 
135
135
  Returns
136
136
  -------
137
- `FeatureSpec`
137
+ ``FeatureSpec``
138
138
  Geom object position specification.
139
139
 
140
140
  Notes
@@ -165,23 +165,23 @@ def position_nudge(x=None, y=None, unit=None):
165
165
 
166
166
  def position_jitterdodge(dodge_width=None, jitter_width=None, jitter_height=None, seed=None):
167
167
  """
168
- This is primarily used for aligning points generated through `geom_point()`
169
- with dodged boxplots (e.g., a `geom_boxplot()` with a fill aesthetic supplied).
168
+ This is primarily used for aligning points generated through `geom_point() <https://lets-plot.org/python/pages/api/lets_plot.geom_point.html>`__
169
+ with dodged boxplots (e.g., a `geom_boxplot() <https://lets-plot.org/python/pages/api/lets_plot.geom_boxplot.html>`__ with a fill aesthetic supplied).
170
170
 
171
171
  Parameters
172
172
  ----------
173
173
  dodge_width : float
174
174
  Bin width.
175
- The value of `dodge_width` is relative and typically ranges between 0 and 1.
175
+ The value of ``dodge_width`` is relative and typically ranges between 0 and 1.
176
176
  Values that are greater than 1 lead to overlapping of the boxes.
177
177
  The default value is taken from the width aesthetics of the data point.
178
178
  jitter_width : float, default=.4
179
179
  Jittering width.
180
- The value of `jitter_width` is relative and typically ranges between 0 and 0.5.
180
+ The value of ``jitter_width`` is relative and typically ranges between 0 and 0.5.
181
181
  Values that are greater than 0.5 lead to overlapping of the points.
182
182
  jitter_height : float, default=.4
183
183
  Jittering height.
184
- The value of `jitter_height` is relative and typically ranges between 0 and 0.5.
184
+ The value of ``jitter_height`` is relative and typically ranges between 0 and 0.5.
185
185
  Values that are greater than 0.5 lead to overlapping of the points.
186
186
  seed : int
187
187
  A random seed to make the jitter reproducible.
@@ -189,7 +189,7 @@ def position_jitterdodge(dodge_width=None, jitter_width=None, jitter_height=None
189
189
 
190
190
  Returns
191
191
  -------
192
- `FeatureSpec`
192
+ ``FeatureSpec``
193
193
  Geom object position specification.
194
194
 
195
195
  Notes
@@ -233,14 +233,14 @@ def position_stack(vjust=None, mode=None):
233
233
  not a dimension (like bars or areas).
234
234
  Set to 0 to align with the bottom, 0.5 for the middle, and 1 for the top.
235
235
  mode : {'groups', 'all'}, default='groups'
236
- If 'groups', objects inside one group are positioned as in `position='identity'`,
236
+ If 'groups', objects inside one group are positioned as in ``position='identity'``,
237
237
  but each group is shifted to sum of heights of previous groups
238
238
  (where height of a group is a maximum of it's y values).
239
239
  If 'all', each object will be shifted.
240
240
 
241
241
  Returns
242
242
  -------
243
- `FeatureSpec`
243
+ ``FeatureSpec``
244
244
  Geom object position specification.
245
245
 
246
246
  Notes
@@ -279,14 +279,14 @@ def position_fill(vjust=None, mode=None):
279
279
  not a dimension (like bars or areas).
280
280
  Set to 0 to align with the bottom, 0.5 for the middle, and 1 for the top.
281
281
  mode : {'groups', 'all'}, default='groups'
282
- If 'groups', objects inside one group are positioned as in `position='identity'`,
282
+ If 'groups', objects inside one group are positioned as in ``position='identity'``,
283
283
  but each group is shifted to sum of heights of previous groups
284
284
  (where height of a group is a maximum of it's y values).
285
285
  If 'all', each object will be shifted.
286
286
 
287
287
  Returns
288
288
  -------
289
- `FeatureSpec`
289
+ ``FeatureSpec``
290
290
  Geom object position specification.
291
291
 
292
292
  Notes