|
14 | 14 |
|
15 | 15 | PLOTLY_GET_CHROME_ERROR_MSG = """ |
16 | 16 |
|
17 | | -Kaleido requires Google Chrome to be installed. |
| 17 | +Kaleido requires Google Chrome to be installed. |
18 | 18 |
|
19 | 19 | Either download and install Chrome yourself following Google's instructions for your operating system, |
20 | 20 | or install it from your terminal by running: |
@@ -549,47 +549,67 @@ def write_images( |
549 | 549 | Parameters |
550 | 550 | ---------- |
551 | 551 | 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. |
553 | 554 |
|
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. |
556 | 559 |
|
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: |
559 | 563 | - 'png' |
560 | 564 | - 'jpg' or 'jpeg' |
561 | 565 | - 'webp' |
562 | 566 | - 'svg' |
563 | 567 | - 'pdf' |
564 | 568 |
|
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, will default to `plotly.io.defaults.default_format`. |
566 | 573 |
|
567 | | - width: int or None |
| 574 | + width: int, None, or list of (int or None) |
568 | 575 | The width of the exported image in layout pixels. If the `scale` |
569 | 576 | property is 1.0, this will also be the width of the exported image |
570 | 577 | in physical pixels. |
571 | 578 |
|
| 579 | + Use a list to specify widths for each figure or dict in the list |
| 580 | + provided to the `fig` argument. |
| 581 | + Specify width as an `int` to apply the same width to all exported images. |
572 | 582 | If not specified, will default to `plotly.io.defaults.default_width`. |
573 | 583 |
|
574 | | - height: int or None |
| 584 | + height: int, None, or list of (int or None) |
575 | 585 | The height of the exported image in layout pixels. If the `scale` |
576 | 586 | property is 1.0, this will also be the height of the exported image |
577 | 587 | in physical pixels. |
578 | 588 |
|
| 589 | + Use a list to specify heights for each figure or dict in the list |
| 590 | + provided to the `fig` argument. |
| 591 | + Specify height as an `int` to apply the same height to all exported images. |
579 | 592 | If not specified, will default to `plotly.io.defaults.default_height`. |
580 | 593 |
|
581 | | - scale: int or float or None |
| 594 | + scale: int, float, None, or list of (int, float, or None) |
582 | 595 | The scale factor to use when exporting the figure. A scale factor |
583 | 596 | larger than 1.0 will increase the image resolution with respect |
584 | 597 | to the figure's layout pixel dimensions. Whereas as scale factor of |
585 | 598 | less than 1.0 will decrease the image resolution. |
586 | 599 |
|
| 600 | + Use a list to specify scale for each figure or dict in the list |
| 601 | + provided to the `fig` argument. |
| 602 | + Specify scale as an `int` or `float` to apply the same scale to all exported images. |
587 | 603 | If not specified, will default to `plotly.io.defaults.default_scale`. |
588 | 604 |
|
589 | | - validate: bool |
| 605 | + validate: bool or list of bool |
590 | 606 | True if the figure should be validated before being converted to |
591 | 607 | an image, False otherwise. |
592 | 608 |
|
| 609 | + Use a list to specify validation setting for each figure in the list |
| 610 | + provided to the `fig` argument. |
| 611 | + Specify validate as a boolean to apply the same validation setting to all figures. |
| 612 | +
|
593 | 613 | Returns |
594 | 614 | ------- |
595 | 615 | None |
|
0 commit comments