Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export to file-like object #938

Merged
merged 20 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix path description in doc string
  • Loading branch information
RYangazov committed Dec 5, 2023
commit 120d8142a72b1dbd41cba5ba621829f107bc100b
20 changes: 12 additions & 8 deletions python-package/lets_plot/plot/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,8 +483,9 @@ def to_svg(self, path):
self : `PlotSpec`
Plot specification to export.
path : str, file-like object
String or file-like object implementing a binary write() function.
When path is a string, the SVG image is written to a file with that name.
Сan be either a string specifying a file path or a file-like object.
If a string is provided, the result will be exported to the file at that path.
If a file-like object is provided, the result will be exported to that object.

Examples
--------
Expand Down Expand Up @@ -514,8 +515,9 @@ def to_html(self, path, iframe: bool = None):
self : `PlotSpec`
Plot specification to export.
path : str, file-like object
String or file-like object implementing a binary write() function.
When path is a string, the HTML page is written to a file with that name.
Сan be either a string specifying a file path or a file-like object.
If a string is provided, the result will be exported to the file at that path.
If a file-like object is provided, the result will be exported to that object.
iframe : bool, default=False
Whether to wrap HTML page into a iFrame.

Expand Down Expand Up @@ -545,8 +547,9 @@ def to_png(self, path, scale: float = None):
self : `PlotSpec`
Plot specification to export.
path : str, file-like object
String or file-like object implementing a binary write() function.
When path is a string, the PNG image is written to a file with that name.
Сan be either a string specifying a file path or a file-like object.
If a string is provided, the result will be exported to the file at that path.
If a file-like object is provided, the result will be exported to that object.
scale : float
Scaling factor for raster output. Default value is 2.0.

Expand Down Expand Up @@ -584,8 +587,9 @@ def to_pdf(self, path, scale: float = None):
self : `PlotSpec`
Plot specification to export.
path : str, file-like object
String or file-like object implementing a binary write() function.
When path is a string, the PDF is written to a file with that name.
Сan be either a string specifying a file path or a file-like object.
If a string is provided, the result will be exported to the file at that path.
If a file-like object is provided, the result will be exported to that object.
scale : float
Scaling factor for raster output. Default value is 2.0.

Expand Down
20 changes: 12 additions & 8 deletions python-package/lets_plot/plot/subplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ def to_svg(self, path):
self : `SupPlotsSpec`
Subplots specification to export.
path : str, file-like object
String or file-like object implementing a binary write() function.
When path is a string, the SVG image is written to a file with that name.
Сan be either a string specifying a file path or a file-like object.
If a string is provided, the result will be exported to the file at that path.
If a file-like object is provided, the result will be exported to that object.

Examples
--------
Expand Down Expand Up @@ -159,8 +160,9 @@ def to_html(self, path, iframe: bool = None):
self : `SupPlotsSpec`
Subplots specification to export.
path : str, file-like object
String or file-like object implementing a binary write() function.
When path is a string, the HTML page is written to a file with that name.
Сan be either a string specifying a file path or a file-like object.
If a string is provided, the result will be exported to the file at that path.
If a file-like object is provided, the result will be exported to that object.
iframe : bool, default=False
Whether to wrap HTML page into a iFrame.

Expand Down Expand Up @@ -194,8 +196,9 @@ def to_png(self, path, scale=None):
self : `SupPlotsSpec`
Subplots specification to export.
path : str, file-like object
String or file-like object implementing a binary write() function.
When path is a string, the PNG image is written to a file with that name.
Сan be either a string specifying a file path or a file-like object.
If a string is provided, the result will be exported to the file at that path.
If a file-like object is provided, the result will be exported to that object.
scale : float
Scaling factor for raster output. Default value is 2.0.

Expand Down Expand Up @@ -237,8 +240,9 @@ def to_pdf(self, path, scale=None):
self : `SupPlotsSpec`
Subplots specification to export.
path : str, file-like object
String or file-like object implementing a binary write() function.
When path is a string, the PDF is written to a file with that name.
Сan be either a string specifying a file path or a file-like object.
If a string is provided, the result will be exported to the file at that path.
If a file-like object is provided, the result will be exported to that object.
scale : float
Scaling factor for raster output. Default value is 2.0.

Expand Down