@@ -267,9 +267,17 @@ def plot(
267267 backend : Backends = "matplotlib" ,
268268 savefig = False ,
269269 layers = None ,
270+ verbose : bool = False ,
270271 ):
272+ if verbose :
273+ print (f"Plotting figure using backend: { backend } " )
274+
271275 if backend == "matplotlib" :
272- return self .plot_matplotlib (savefig = savefig , layers = layers )
276+ return self .plot_matplotlib (
277+ savefig = savefig ,
278+ layers = layers ,
279+ verbose = verbose ,
280+ )
273281 elif backend == "plotly" :
274282 return self .plot_plotly (savefig = savefig )
275283 elif backend == "tikzpics" :
@@ -280,10 +288,19 @@ def plot(
280288 def show (
281289 self ,
282290 backend : Backends = "matplotlib" ,
291+ verbose : bool = False ,
283292 ):
293+ if verbose :
294+ print (f"Showing figure using backend: { backend } " )
295+
284296 if backend == "matplotlib" :
285- self .plot (backend = "matplotlib" , savefig = False , layers = None )
286- self ._matplotlib_fig .show ()
297+ self .plot (
298+ backend = "matplotlib" ,
299+ savefig = False ,
300+ layers = None ,
301+ verbose = verbose ,
302+ )
303+ # self._matplotlib_fig.show()
287304 elif backend == "plotly" :
288305 self .plot_plotly (savefig = False )
289306 elif backend == "tikzpics" :
@@ -292,13 +309,21 @@ def show(
292309 else :
293310 raise ValueError ("Invalid backend" )
294311
295- def plot_matplotlib (self , savefig = False , layers = None , usetex = False ):
312+ def plot_matplotlib (
313+ self ,
314+ savefig : bool = False ,
315+ layers : list | None = None ,
316+ usetex : bool = False ,
317+ verbose : bool = False ,
318+ ):
296319 """
297320 Generate and optionally display the subplots.
298321
299322 Parameters:
300323 filename (str, optional): Filename to save the figure.
301324 """
325+ if verbose :
326+ print ("Generating Matplotlib figure..." )
302327
303328 tex_fonts = setup_tex_fonts (fontsize = self .fontsize , usetex = usetex )
304329
@@ -309,15 +334,20 @@ def plot_matplotlib(self, savefig=False, layers=None, usetex=False):
309334 grid_alpha = 1.0 ,
310335 grid_linestyle = "dotted" ,
311336 )
312-
337+ if verbose :
338+ print ("Plot style set up." )
339+ print (f"{ self ._figsize = } { self ._width = } { self ._ratio = } " )
313340 if self ._figsize is not None :
314341 fig_width , fig_height = self ._figsize
315342 else :
316343 fig_width , fig_height = set_size (
317344 width = self ._width ,
318345 ratio = self ._ratio ,
319346 dpi = self .dpi ,
347+ verbose = verbose ,
320348 )
349+ if verbose :
350+ print (f"Figure size: { fig_width } x { fig_height } points" )
321351
322352 fig , axes = plt .subplots (
323353 self .nrows ,
0 commit comments