@@ -521,7 +521,7 @@ def get_conc_attribute(self, values=1, drop=set(), keep=set(), allvalues=False):
521521 return dlr_variable_range
522522
523523
524- def plot_contour (self , focus , z_slice = 0.0 , extrema = None , alpha = 1 , fill = True , cmap = 'viridis' , title = '' , grid = True , xlim = None , ylim = None , xyequal = True , figsizepx = None , ext = 'jpeg' , figbgcolor = None ):
524+ def plot_contour (self , focus , z_slice = 0.0 , extrema = None , alpha = 1 , fill = True , cmap = 'viridis' , title = '' , grid = True , xlim = None , ylim = None , xyequal = True , figsizepx = None , ext = 'jpeg' , figbgcolor = None , ** kwargs ):
525525 """
526526 input:
527527 self: TimeSeries class instance
@@ -583,6 +583,11 @@ def plot_contour(self, focus, z_slice=0.0, extrema=None, alpha=1, fill=True, cma
583583 or white (jpeg, tiff).
584584 figure background color.
585585
586+ **kwargs: possible additional keyword arguments input,
587+ handled by the matplotlib contour and contourf function.
588+ + https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.contour.html
589+ + https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.contourf.html
590+
586591 output:
587592 fig: matplotlib figures, depending on ext, either as files or as
588593 objects. the figures contains the contour plot and color bar.
@@ -653,6 +658,7 @@ def plot_contour(self, focus, z_slice=0.0, extrema=None, alpha=1, fill=True, cma
653658 figsizepx = figsizepx ,
654659 ext = ext ,
655660 figbgcolor = figbgcolor ,
661+ ** kwargs ,
656662 )
657663 lo_output .append (o_output )
658664
@@ -845,7 +851,7 @@ def get_cell_attribute(self, values=1, drop=set(), keep=set(), allvalues=False):
845851 return dl_variable_range
846852
847853
848- def plot_scatter (self , focus = 'cell_type' , z_slice = 0.0 , z_axis = None , alpha = 1 , cmap = 'viridis' , title = '' , grid = True , legend_loc = 'lower left' , xlim = None , ylim = None , xyequal = True , s = 1.0 , figsizepx = None , ext = 'jpeg' , figbgcolor = None ):
854+ def plot_scatter (self , focus = 'cell_type' , z_slice = 0.0 , z_axis = None , alpha = 1 , cmap = 'viridis' , title = '' , grid = True , legend_loc = 'lower left' , xlim = None , ylim = None , xyequal = True , s = 1.0 , figsizepx = None , ext = 'jpeg' , figbgcolor = None , ** kwargs ):
849855 """
850856 input:
851857 self: TimeSeries class instance
@@ -917,6 +923,10 @@ def plot_scatter(self, focus='cell_type', z_slice=0.0, z_axis=None, alpha=1, cma
917923 or white (jpeg, tiff).
918924 figure background color.
919925
926+ **kwargs: possible additional keyword arguments input,
927+ handled by the pandas dataframe plot function.
928+ + https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame
929+
920930 output:
921931 fig: matplotlib figures, depending on ext, either as files or
922932 as objects. the figures contains the scatter plot and
@@ -956,6 +966,7 @@ def plot_scatter(self, focus='cell_type', z_slice=0.0, z_axis=None, alpha=1, cma
956966 figsizepx = figsizepx ,
957967 ext = ext ,
958968 figbgcolor = figbgcolor ,
969+ ** kwargs ,
959970 )
960971 lo_output .append (o_output )
961972
@@ -1130,7 +1141,7 @@ def make_ome_tiff(self, cell_attribute='ID', conc_cutoff={}, focus=None, file=Tr
11301141
11311142 ## TIME SERIES RELATED FUNCTIONS ##
11321143
1133- def plot_timeseries (self , focus_cat = None , focus_num = None , aggregate_num = np .nanmean , frame = 'cell' , z_slice = None , logy = False , ylim = None , secondary_y = None , subplots = False , sharex = False , sharey = False , linestyle = '-' , linewidth = None , cmap = None , color = None , grid = True , legend = True , yunit = None , title = None , ax = None , figsizepx = [640 , 480 ], ext = None , figbgcolor = None ):
1144+ def plot_timeseries (self , focus_cat = None , focus_num = None , aggregate_num = np .nanmean , frame = 'cell' , z_slice = None , logy = False , ylim = None , secondary_y = None , subplots = False , sharex = False , sharey = False , linestyle = '-' , linewidth = None , cmap = None , color = None , grid = True , legend = True , yunit = None , title = None , ax = None , figsizepx = [640 , 480 ], ext = None , figbgcolor = None , ** kwargs ):
11341145 """
11351146 input:
11361147 self: TimeSeries class instance
@@ -1231,6 +1242,10 @@ def plot_timeseries(self, focus_cat=None, focus_num=None, aggregate_num=np.nanme
12311242 figure background color.
12321243 only relevant if ext not is None.
12331244
1245+ **kwargs: possible additional keyword arguments input,
1246+ handled by the pandas series plot function.
1247+ + https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.plot.html
1248+
12341249 output:
12351250 if ext is None: a fig matplotlib figure, containing the ax axis object, is returned.
12361251 else: an image file is generated under the returned path.
@@ -1370,7 +1385,8 @@ def plot_timeseries(self, focus_cat=None, focus_num=None, aggregate_num=np.nanme
13701385 ylabel = ylabel ,
13711386 xlabel = f"time [{ mcds .get_unit_dict ()['time' ]} ]" ,
13721387 title = title ,
1373- ax = ax
1388+ ax = ax ,
1389+ ** kwargs ,
13741390 )
13751391 else :
13761392 # if color
@@ -1390,15 +1406,16 @@ def plot_timeseries(self, focus_cat=None, focus_num=None, aggregate_num=np.nanme
13901406 ylabel = ylabel ,
13911407 xlabel = f"time [{ mcds .get_unit_dict ()['time' ]} ]" ,
13921408 title = title ,
1393- ax = ax
1409+ ax = ax ,
1410+ ** kwargs ,
13941411 )
13951412
13961413 # output
13971414 if (ext is None ):
13981415 return fig
13991416 else :
14001417 if (focus_num == 'count' ):
1401- s_ofile = 'timeseries_{frame}_{focus_cat}_{focus_num}.{ext}' .replace (' ' ,'_' )
1418+ s_ofile = f 'timeseries_{ frame } _{ focus_cat } _{ focus_num } .{ ext } ' .replace (' ' ,'_' )
14021419 else :
14031420 s_ofile = f"timeseries_{ frame } _{ focus_cat } _{ focus_num } _{ aggregate_num .__name__ .replace ('np.nan' ,'' )} .{ ext } " .replace (' ' ,'_' )
14041421 s_pathfile = self .path + '/' + s_ofile
0 commit comments