161161 'legend_loc' : 'best' ,
162162 'legend_onaxis' : 'on plot' ,
163163 'linecolors' : linecolors ,
164- 'margins' : ( 0.15 , 0.05 , 0.05 , 0.15 ) ,
164+ 'margins' : [ 0.15 , 0.05 , 0.05 , 0.15 ] ,
165165 'mpl_legend' : None ,
166166 'plot_type' : 'lineplot' ,
167167 'scatter_size' : 30 ,
@@ -360,11 +360,10 @@ def get_config(self):
360360 to self.configdict
361361 """
362362 cnf = {}
363-
364363 for attr in ('added_texts' , 'auto_margins' , 'axes_style' , 'current_theme' ,
365364 'data_deriv' , 'data_expr' , 'draggable_legend' , 'facecolor' ,
366365 'framecolor' , 'gridcolor' , 'hidewith_legend' , 'legend_loc' ,
367- 'legend_onaxis' , 'linecolors' , 'margins' , 'mpl_legend' , 'ntrace' ,
366+ 'legend_onaxis' , 'linecolors' , 'margins' ,'ntrace' ,
368367 'plot_type' , 'scatter_mask' , 'scatter_normalcolor' ,
369368 'scatter_normaledge' , 'scatter_selectcolor' , 'scatter_selectedge' ,
370369 'scatter_size' , 'show_grid' , 'show_legend' , 'show_legend_frame' ,
@@ -393,11 +392,11 @@ def load_config(self, conf):
393392
394393 self .ntrace = cnf .get ('ntrace' , 1 )
395394
396- self .set_theme (theme = cnf [ 'current_theme' ] )
395+ self .set_theme (theme = cnf . get ( 'current_theme' , 'dark' if DARK_THEME else 'light' ) )
397396 for attr in ('added_texts' , 'auto_margins' , 'axes_style' , 'current_theme' ,
398397 'data_deriv' , 'data_expr' , 'draggable_legend' , 'facecolor' ,
399398 'framecolor' , 'gridcolor' , 'hidewith_legend' , 'legend_loc' ,
400- 'legend_onaxis' , 'linecolors' , 'margins' , 'mpl_legend' ,
399+ 'legend_onaxis' , 'linecolors' , 'margins' ,
401400 'plot_type' , 'scatter_mask' , 'scatter_normalcolor' ,
402401 'scatter_normaledge' , 'scatter_selectcolor' , 'scatter_selectedge' ,
403402 'scatter_size' , 'show_grid' , 'show_legend' , 'show_legend_frame' ,
@@ -408,6 +407,8 @@ def load_config(self, conf):
408407 if attr in cnf :
409408 setattr (self , attr , cnf .get (attr ))
410409
410+ self .canvas .draw ()
411+
411412 def reset_lines (self ):
412413 self .lines = [None ]* len (self .traces )
413414 self .dy = [None ]* len (self .traces )
@@ -541,7 +542,7 @@ def relabel(self, xlabel=None, ylabel=None, y2label=None, y3label=None,
541542 def set_margins (self , left = 0.1 , top = 0.1 , right = 0.1 , bottom = 0.1 ,
542543 delay_draw = False ):
543544 "set margins"
544- self .margins = (left , top , right , bottom )
545+ self .margins = [ float (left ), float ( top ), float ( right ), float ( bottom )]
545546 if self .panel is not None :
546547 self .panel .gridspec .update (left = left , top = 1 - top ,
547548 right = 1 - right , bottom = bottom )
0 commit comments