Skip to content

Commit 815d975

Browse files
authored
Merge pull request #5164 from plotly/docstring-updates
Kaleido doc string updates
2 parents 1965279 + 2f66bf1 commit 815d975

File tree

1 file changed

+32
-11
lines changed

1 file changed

+32
-11
lines changed

plotly/io/_kaleido.py

+32-11
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
PLOTLY_GET_CHROME_ERROR_MSG = """
1616
17-
Kaleido requires Google Chrome to be installed.
17+
Kaleido requires Google Chrome to be installed.
1818
1919
Either download and install Chrome yourself following Google's instructions for your operating system,
2020
or install it from your terminal by running:
@@ -549,47 +549,68 @@ def write_images(
549549
Parameters
550550
----------
551551
fig:
552-
Iterable of figure objects or dicts representing a figure
552+
List of figure objects or dicts representing a figure.
553+
Also accepts a single figure or dict representing a figure.
553554
554-
file: str or writeable
555-
Iterables of strings or pathlib.Path objects representing local file paths to write to.
555+
file: str, pathlib.Path, or list of (str or pathlib.Path)
556+
List of str or pathlib.Path objects representing local file paths to write to.
557+
Can also be a single str or pathlib.Path object if fig argument is
558+
a single figure or dict representing a figure.
556559
557-
format: str or None
558-
The desired image format. One of
560+
format: str, None, or list of (str or None)
561+
The image format to use for exported images.
562+
Supported formats are:
559563
- 'png'
560564
- 'jpg' or 'jpeg'
561565
- 'webp'
562566
- 'svg'
563567
- 'pdf'
564568
565-
If not specified, this will default to `plotly.io.defaults.default_format`.
569+
Use a list to specify formats for each figure or dict in the list
570+
provided to the `fig` argument.
571+
Specify format as a `str` to apply the same format to all exported images.
572+
If not specified, and the corresponding `file` argument has a file extension, then `format` will default to the
573+
file extension. Otherwise, will default to `plotly.io.defaults.default_format`.
566574
567-
width: int or None
575+
width: int, None, or list of (int or None)
568576
The width of the exported image in layout pixels. If the `scale`
569577
property is 1.0, this will also be the width of the exported image
570578
in physical pixels.
571579
580+
Use a list to specify widths for each figure or dict in the list
581+
provided to the `fig` argument.
582+
Specify width as an `int` to apply the same width to all exported images.
572583
If not specified, will default to `plotly.io.defaults.default_width`.
573584
574-
height: int or None
585+
height: int, None, or list of (int or None)
575586
The height of the exported image in layout pixels. If the `scale`
576587
property is 1.0, this will also be the height of the exported image
577588
in physical pixels.
578589
590+
Use a list to specify heights for each figure or dict in the list
591+
provided to the `fig` argument.
592+
Specify height as an `int` to apply the same height to all exported images.
579593
If not specified, will default to `plotly.io.defaults.default_height`.
580594
581-
scale: int or float or None
595+
scale: int, float, None, or list of (int, float, or None)
582596
The scale factor to use when exporting the figure. A scale factor
583597
larger than 1.0 will increase the image resolution with respect
584598
to the figure's layout pixel dimensions. Whereas as scale factor of
585599
less than 1.0 will decrease the image resolution.
586600
601+
Use a list to specify scale for each figure or dict in the list
602+
provided to the `fig` argument.
603+
Specify scale as an `int` or `float` to apply the same scale to all exported images.
587604
If not specified, will default to `plotly.io.defaults.default_scale`.
588605
589-
validate: bool
606+
validate: bool or list of bool
590607
True if the figure should be validated before being converted to
591608
an image, False otherwise.
592609
610+
Use a list to specify validation setting for each figure in the list
611+
provided to the `fig` argument.
612+
Specify validate as a boolean to apply the same validation setting to all figures.
613+
593614
Returns
594615
-------
595616
None

0 commit comments

Comments
 (0)