@@ -22,6 +22,7 @@ def __init__(self, **kwargs):
2222 self ._description = kwargs .get ('description' , None )
2323 self ._label = kwargs .get ('label' , None )
2424
25+ self ._dpi = kwargs .get ('dpi' , 300 )
2526 self ._width = kwargs .get ('width' , 426.79135 )
2627 self ._ratio = kwargs .get ('ratio' , "golden" )
2728 self ._gridspec_kw = kwargs .get ('gridspec_kw' , {"wspace" : 0.08 , "hspace" : 0.1 })
@@ -106,7 +107,8 @@ def plot_matplotlib(self, show=True, savefig=False):
106107 else :
107108 fig_width , fig_height = plt_utils .set_size (width = self ._width , ratio = self ._ratio )
108109
109- fig , axes = plt .subplots (self .nrows , self .ncols , figsize = (fig_width , fig_height ), squeeze = False )
110+ print (fig_width , fig_height , fig_width / self ._dpi , fig_height / self ._dpi )
111+ fig , axes = plt .subplots (self .nrows , self .ncols , figsize = (fig_width / self ._dpi , fig_height / self ._dpi ), squeeze = False , dpi = self ._dpi )
110112
111113 for (row , col ), line_plot in self .subplots .items ():
112114 ax = axes [row ][col ]
@@ -138,7 +140,7 @@ def plot_plotly(self, show=True, savefig=None):
138140 fig_width , fig_height = self ._figsize
139141 else :
140142 fig_width , fig_height = plt_utils .set_size (width = self ._width , ratio = self ._ratio )
141-
143+ print ( self . _width , fig_width , fig_height )
142144 # Create subplots
143145 fig = make_subplots (rows = self .nrows , cols = self .ncols , subplot_titles = [
144146 f"Subplot ({ row } , { col } )" for (row , col ) in self .subplots .keys ()
@@ -152,8 +154,8 @@ def plot_plotly(self, show=True, savefig=None):
152154
153155 # Update layout settings
154156 fig .update_layout (
155- width = fig_width ,
156- height = fig_height ,
157+ # width=fig_width,
158+ # height=fig_height,
157159 font = dict (size = fontsize ),
158160 margin = dict (l = 10 , r = 10 , t = 40 , b = 10 ), # Adjust margins if needed
159161 )
@@ -169,6 +171,11 @@ def plot_plotly(self, show=True, savefig=None):
169171
170172
171173 # Property getters
174+
175+ @property
176+ def dpi (self ):
177+ return self ._dpi
178+
172179 @property
173180 def nrows (self ):
174181 return self ._nrows
@@ -198,6 +205,10 @@ def subplot_matrix(self):
198205 return self ._subplot_matrix
199206
200207 # Property setters
208+ @nrows .setter
209+ def dpi (self , value ):
210+ self ._dpi = value
211+
201212 @nrows .setter
202213 def nrows (self , value ):
203214 self ._nrows = value
0 commit comments