File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 1515
1616from __future__ import annotations
1717
18+ import dataclasses
1819import pickle
1920import sys
2021import warnings
2122import weakref
22- from dataclasses import dataclass
2323from math import fabs
24- from typing import TYPE_CHECKING
24+ from typing import TYPE_CHECKING , Any
2525
2626import numpy as np
2727import qwt
6464 import guidata .dataset .io
6565
6666
67- @dataclass
67+ @dataclasses . dataclass
6868class BasePlotOptions :
6969 """Base plot options
7070
@@ -124,6 +124,17 @@ def __post_init__(self) -> None:
124124 RuntimeWarning ,
125125 )
126126
127+ def copy (self , other_options : dict [str , Any ]) -> BasePlotOptions :
128+ """Copy the options and replace some of them with the given dictionary
129+
130+ Args:
131+ other_options: The dictionary
132+
133+ Returns:
134+ BasePlotOptions: The new options
135+ """
136+ return dataclasses .replace (self , ** other_options )
137+
127138
128139class BasePlot (qwt .QwtPlot ):
129140 """Enhanced QwtPlot class providing methods for handling items and axes better
You can’t perform that action at this time.
0 commit comments