Files
ResInsight/GrpcInterface/Python/rips/plot.py
T
2026-06-17 13:55:32 +02:00

34 lines
1.1 KiB
Python

"""
ResInsight 2d plot module
"""
import Commands_pb2
from .pdmobject import add_method
from .resinsight_classes import PlotWindow as PlotWindow, Plot as Plot
@add_method(PlotWindow)
def export_snapshot(self, export_folder="", file_prefix="", output_format="PNG", width=-1, height=-1):
"""Export snapshot for the current plot
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'.
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.
"""
return self._execute_command(
exportSnapshots=Commands_pb2.ExportSnapshotsRequest(
type="PLOTS",
prefix=file_prefix,
viewId=self.id,
exportFolder=export_folder,
plotOutputFormat=output_format,
width=width,
height=height,
)
)