@@ -32,7 +32,7 @@ class PlotParams:
3232 show (bool): Whether to show the plot.
3333 return_fig (bool): Whether to return the figure object.
3434 window_mode (str): Mode for handling windows
35- ('use_plot', 'use_trace', 'add_to_trace').
35+ ('use_plot', 'use_trace', 'add_to_trace', 'no_window' ).
3636 theme (str): Theme for the plot ('dark' or 'light').
3737 """
3838
@@ -60,10 +60,12 @@ def __init__(
6060 self .xlim = kwargs .get ("xlim" , (0 , 0 ))
6161 self .show = kwargs .get ("show" , True )
6262 self .return_fig = kwargs .get ("return_fig" , False )
63+ self .plot_window = kwargs .get ("plot_window" , True )
6364 self .window_mode = kwargs .get (
6465 "window_mode" , "add_to_trace"
6566 ) # Default mode for handling windows
6667 self .line_width = kwargs .get ("line_width" , 1.0 )
68+ self .antialiasing = kwargs .get ("antialiasing" , True )
6769
6870 def apply_theme (self , theme = "dark" ) -> None :
6971 """Apply the specified theme to the plot parameters.
@@ -120,10 +122,17 @@ def validate(self) -> None:
120122 raise TypeError ("show must be a boolean value." )
121123 if not isinstance (self .return_fig , bool ):
122124 raise TypeError ("return_fig must be a boolean value." )
123- if self .window_mode not in ["use_plot" , "use_trace" , "add_to_trace" ]:
125+ if not isinstance (self .plot_window , bool ):
126+ raise TypeError ("plot_window must be a boolean value." )
127+ if self .window_mode not in [
128+ "use_plot" ,
129+ "use_trace" ,
130+ "add_to_trace" ,
131+ "no_window" ,
132+ ]:
124133 raise ValueError (
125134 f"Invalid window_mode: { self .window_mode } . "
126- "Must be 'use_plot', 'use_trace', or 'add_to_trace '."
135+ "Must be 'use_plot', 'use_trace', 'add_to_trace', or 'no_window '."
127136 )
128137 if not isinstance (self .align_onset , bool ):
129138 raise TypeError ("align_onset must be a boolean value." )
@@ -135,6 +144,8 @@ def validate(self) -> None:
135144 raise TypeError ("line_width must be a number (int or float)." )
136145 if not isinstance (self .theme , str ) and self .theme not in ["dark" , "light" ]:
137146 raise TypeError ("theme must be a string and either 'dark' or 'light'." )
147+ if not isinstance (self .antialiasing , bool ):
148+ raise TypeError ("antialiasing must be a boolean value." )
138149
139150 def to_dict (self ) -> dict :
140151 """Convert the plot parameters to a dictionary."""
@@ -153,12 +164,14 @@ def to_dict(self) -> dict:
153164 "bg_color" : self .bg_color ,
154165 "axis_color" : self .axis_color ,
155166 "window" : self .window ,
167+ "plot_window" : self .plot_window ,
156168 "window_color" : self .window_color ,
157169 "xlim" : self .xlim ,
158170 "show" : self .show ,
159171 "return_fig" : self .return_fig ,
160172 "window_mode" : self .window_mode ,
161173 "theme" : self .theme ,
174+ "antialiasing" : self .antialiasing ,
162175 }
163176
164177 def __iter__ (self ):
0 commit comments