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

34 lines
1.1 KiB
Python
Raw Normal View History

"""
ResInsight 2d plot module
"""
2020-08-19 07:30:51 +02:00
import Commands_pb2
from .pdmobject import add_method
2025-05-16 15:46:45 +02:00
from .resinsight_classes import PlotWindow as PlotWindow, Plot as Plot
2020-04-16 16:06:18 +02:00
@add_method(PlotWindow)
2026-06-09 01:12:48 +02:00
def export_snapshot(self, export_folder="", file_prefix="", output_format="PNG", width=-1, height=-1):
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 global export folder
prefix (str): Exported file name prefix
output_format(str): 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.
2020-04-16 16:06:18 +02:00
"""
return self._execute_command(
2021-01-26 20:48:01 +01:00
exportSnapshots=Commands_pb2.ExportSnapshotsRequest(
type="PLOTS",
prefix=file_prefix,
viewId=self.id,
exportFolder=export_folder,
plotOutputFormat=output_format,
2026-06-09 01:12:48 +02:00
width=width,
height=height,
2021-01-26 20:48:01 +01:00
)
)