Skip to content

Commit

Permalink
Fixes in docstrings (#1033)
Browse files Browse the repository at this point in the history
* Fix links in docstrings.

* Small fix in docstrings for the coord_polar() function.

* Small fixes in docstrings for the setup_show_ext() function.

* Replace jupyter-execute by the code-block directive in docstrings for the setup_show_ext() function.

* Small fix in examples for the setup_show_ext() function.

* Another small fixes in texts in some docstrings.
  • Loading branch information
ASmirnov-HORIS authored Mar 1, 2024
1 parent 1c18980 commit a86a0e9
Show file tree
Hide file tree
Showing 9 changed files with 91 additions and 90 deletions.
38 changes: 19 additions & 19 deletions python-package/lets_plot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,49 +37,49 @@ def setup_show_ext(cls, *,
exec: str = None,
new: bool = False) -> None:
"""
Configures Lets-Plot HTML output for showing in a browser.
Configure Lets-Plot HTML output for showing in a browser.
Parameters
----------
exec : str, optional
Command to execute to open the plot in a web browser.
If not specified, the default browser will be used.
new : bool, default=False
If `True`, the URL is opened in a new window of the web browser.
If `False`, the URL is opened in the already opened web browser window.
If True, the URL is opened in a new window of the web browser.
If False, the URL is opened in the already opened web browser window.
Examples
--------
.. jupyter-execute::
.. code-block::
:linenos:
:emphasize-lines: 2
from lets_plot import *
LetsPlot.setup_show_ext()
p = ggplot({'x': [0], 'y': [0]}, aes('x', 'y')) + geom_point()
p.show()
from lets_plot import *
LetsPlot.setup_show_ext()
p = ggplot() + geom_point(x=0, y=0)
p.show()
|
.. jupyter-execute::
.. code-block::
:linenos:
:emphasize-lines: 2
from lets_plot import *
LetsPlot.setup_show_ext(exec = 'chrome.exe --app=%s')
p = ggplot({'x': [0], 'y': [0]}, aes('x', 'y')) + geom_point()
p.show()
from lets_plot import *
LetsPlot.setup_show_ext(exec = 'chrome.exe --app=%s')
p = ggplot() + geom_point(x=0, y=0)
p.show()
|
.. jupyter-execute::
.. code-block::
:linenos:
:emphasize-lines: 2
from lets_plot import *
LetsPlot.setup_show_ext(exec = 'open -a safari %s', new=True)
p = ggplot({'x': [0], 'y': [0]}, aes('x', 'y')) + geom_point()
p.show()
from lets_plot import *
LetsPlot.setup_show_ext(exec = 'open -a safari %s', new=True)
p = ggplot() + geom_point(x=0, y=0)
p.show()
"""
cfg._setup_wb_html_context(exec=exec, new=new)
Expand Down Expand Up @@ -158,7 +158,7 @@ def setup_html(cls, *,
def set(cls, settings: Dict):
"""
Set up library options.
For more info see https://lets-plot.org/pages/basemap_tiles.html#configuring-globally.
For more info see https://lets-plot.org/python/pages/basemap_tiles.html#configuring-globally.
Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion python-package/lets_plot/plot/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def format(self, field=None, format=None):
Notes
-----
For more info see https://lets-plot.org/pages/formats.html.
For more info see https://lets-plot.org/python/pages/formats.html.
Examples
--------
Expand Down
5 changes: 3 additions & 2 deletions python-package/lets_plot/plot/coord.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,18 +210,19 @@ def coord_polar(xlim=None, ylim=None, theta=None, start=None, direction=None, tr
start : float, default=0
Offset relative to the starting angle (which is 12 o'clock), in radians.
direction : {1, -1}, default=1
Specify angle direction. 1 for clockwise, -1 for counterclockwise.
Specify angle direction, 1=clockwise, -1=counter-clockwise.
transform_bkgr : bool, default=True
If True, the background is transformed to a circle, rectangle otherwise.
Examples
--------
.. jupyter-execute::
:linenos:
:emphasize-lines: 13
:emphasize-lines: 14
import numpy as np
from lets_plot import *
from lets_plot.mapping import as_discrete
LetsPlot.setup_html()
np.random.seed(42)
n = 20
Expand Down
4 changes: 2 additions & 2 deletions python-package/lets_plot/plot/facet.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def facet_grid(x=None, y=None, *, scales=None, x_order=1, y_order=1, x_format=No
- 'Score: {.2f}' -> 'Score: 12.45',
- 'Score: {}' -> 'Score: 12.454789'.
For more info see https://lets-plot.org/pages/formats.html.
For more info see https://lets-plot.org/python/pages/formats.html.
Examples
--------
Expand Down Expand Up @@ -139,7 +139,7 @@ def facet_wrap(facets, ncol=None, nrow=None, *, scales=None, order=1, format=Non
- 'Score: {.2f}' -> 'Score: 12.45',
- 'Score: {}' -> 'Score: 12.454789'.
For more info see https://lets-plot.org/pages/formats.html.
For more info see https://lets-plot.org/python/pages/formats.html.
Examples
--------
Expand Down
4 changes: 2 additions & 2 deletions python-package/lets_plot/plot/geom.py
Original file line number Diff line number Diff line change
Expand Up @@ -6019,7 +6019,7 @@ def geom_text(mapping=None, *, data=None, stat=None, position=None, show_legend=
- 'Num {}' -> 'Num 12.456789'
- 'TTL: {.2f}$' -> 'TTL: 12.45$'
For more info see https://lets-plot.org/pages/formats.html.
For more info see https://lets-plot.org/python/pages/formats.html.
na_text : str, default='n/a'
Text to show for missing values.
nudge_x : float
Expand Down Expand Up @@ -6210,7 +6210,7 @@ def geom_label(mapping=None, *, data=None, stat=None, position=None, show_legend
- 'Num {}' -> 'Num 12.456789'
- 'TTL: {.2f}$' -> 'TTL: 12.45$'
For more info see https://lets-plot.org/pages/formats.html.
For more info see https://lets-plot.org/python/pages/formats.html.
nudge_x : float
Horizontal adjustment to nudge labels by.
nudge_y : float
Expand Down
Loading

0 comments on commit a86a0e9

Please sign in to comment.