Files
ResInsight/GrpcInterface/Python/rips/plot.py
T

62 lines
1.8 KiB
Python
Raw Normal View History

"""
ResInsight 2d plot module
"""
import warnings
from .pdmobject import add_method
from .resinsight_classes import (
PlotWindow as PlotWindow,
Plot as Plot,
SnapshotFileFormat,
)
2020-04-16 16:06:18 +02:00
@add_method(PlotWindow)
2026-06-09 17:55:28 +02:00
def export_snapshot(
self,
export_folder="",
file_prefix="",
output_format="PNG",
width=-1,
height=-1,
prefix=None,
file_format=None,
2026-06-09 17:55:28 +02:00
):
2021-01-26 20:48:01 +01:00
"""Export snapshot for the current plot
2020-04-16 16:06:18 +02:00
Arguments:
export_folder(str): The path to export to. By default will use the 'snapshots' folder next to the project file.
file_prefix (str): Deprecated, use prefix. Exported file name prefix
output_format(str): Deprecated, use file_format. Enum string. Can be 'PNG' or 'PDF'.
2026-06-09 01:12:48 +02:00
width (int): The width of the exported snapshot. By default will use the existing size.
height (int): The height of the exported snapshot. By default will use the existing size.
prefix (str): Exported file name prefix
file_format (SnapshotFileFormat): 'PNG' or 'PDF'
2020-04-16 16:06:18 +02:00
"""
if file_prefix:
warnings.warn(
"PlotWindow.export_snapshot(file_prefix=...) is deprecated, use prefix=...",
DeprecationWarning,
stacklevel=3,
2021-01-26 20:48:01 +01:00
)
if output_format != "PNG":
warnings.warn(
"PlotWindow.export_snapshot(output_format=...) is deprecated, use file_format=...",
DeprecationWarning,
stacklevel=3,
)
if prefix is None:
prefix = file_prefix
if file_format is None:
file_format = SnapshotFileFormat(output_format)
self._call_pdm_method_void(
"exportSnapshot",
export_folder=export_folder,
prefix=prefix,
width=width,
height=height,
file_format=file_format,
2021-01-26 20:48:01 +01:00
)