Skip to content

Commit 0694b6f

Browse files
authored
Merge pull request #34 from elmbeech/master
v4.0.3
2 parents 0c449be + 37d845a commit 0694b6f

File tree

10 files changed

+64
-11
lines changed

10 files changed

+64
-11
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ Developers, please make pull requests to the https://github.com/elmbeech/physice
125125
+ evt generate lineage tree graph output files.
126126

127127
## Release Notes:
128+
+ version 4.0.3 (2025-07-20): elmbeech/physicelldataloader
129+
+ timestep and timeseries **plot_contour**, **plot_scatter**, and **plot_timeseries** handle now **kwargs** arguments.
130+
+ minor bugfixes.
131+
128132
+ version 4.0.2 (2025-06-29): elmbeech/physicelldataloader
129133
+ minor bugfixes.
130134

man/docstring/mcds.plot_contour.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@
7070
or white (jpeg, tiff).
7171
figure background color.
7272
73+
**kwargs: possible additional keyword arguments input,
74+
handled by the matplotlib contour and contourf function.
75+
+ https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.contour.html
76+
+ https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.contourf.html
77+
7378
```
7479

7580
## output:

man/docstring/mcds.plot_scatter.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@
7575
or white (jpeg, tiff).
7676
figure background color.
7777
78+
**kwargs: possible additional keyword arguments input,
79+
handled by the pandas dataframe plot function.
80+
+ https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.plot.html
81+
7882
```
7983

8084
## output:

man/docstring/mcdsts.plot_contour.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@
6262
or white (jpeg, tiff).
6363
figure background color.
6464
65+
**kwargs: possible additional keyword arguments input,
66+
handled by the matplotlib contour and contourf function.
67+
+ https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.contour.html
68+
+ https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.contourf.html
69+
6570
```
6671

6772
## output:

man/docstring/mcdsts.plot_scatter.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@
7272
or white (jpeg, tiff).
7373
figure background color.
7474
75+
**kwargs: possible additional keyword arguments input,
76+
handled by the pandas dataframe plot function.
77+
+ https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame
78+
7579
```
7680

7781
## output:

man/docstring/mcdsts.plot_timeseries.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@
101101
figure background color.
102102
only relevant if ext not is None.
103103
104+
**kwargs: possible additional keyword arguments input,
105+
handled by the pandas series plot function.
106+
+ https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.plot.html
107+
104108
```
105109

106110
## output:
129 KB
Loading

pcdl/VERSION.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '4.0.2'
1+
__version__ = '4.0.3'

pcdl/timeseries.py

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

pcdl/timestep.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,7 @@ def get_conc_df(self, z_slice=None, halt=False, values=1, drop=set(), keep=set()
11181118
return df_conc
11191119

11201120

1121-
def plot_contour(self, focus, z_slice=0.0, vmin=None, vmax=None, alpha=1, fill=True, cmap='viridis', title=None, grid=True, xlim=None, ylim=None, xyequal=True, ax=None, figsizepx=None, ext=None, figbgcolor=None):
1121+
def plot_contour(self, focus, z_slice=0.0, vmin=None, vmax=None, alpha=1, fill=True, cmap='viridis', title=None, grid=True, xlim=None, ylim=None, xyequal=True, ax=None, figsizepx=None, ext=None, figbgcolor=None, **kwargs):
11221122
"""
11231123
input:
11241124
focus: string
@@ -1188,6 +1188,11 @@ def plot_contour(self, focus, z_slice=0.0, vmin=None, vmax=None, alpha=1, fill=T
11881188
or white (jpeg, tiff).
11891189
figure background color.
11901190
1191+
**kwargs: possible additional keyword arguments input,
1192+
handled by the matplotlib contour and contourf function.
1193+
+ https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.contour.html
1194+
+ https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.contourf.html
1195+
11911196
output:
11921197
fig: matplotlib figure, depending on ext, either as object or as file.
11931198
the figure containing the contour plot and color bar.
@@ -1269,9 +1274,9 @@ def plot_contour(self, focus, z_slice=0.0, vmin=None, vmax=None, alpha=1, fill=T
12691274

12701275
# get contour plot
12711276
if fill:
1272-
ax.contourf(df_mesh.columns, df_mesh.index, df_mesh.values, vmin=vmin, vmax=vmax, alpha=alpha, cmap=cmap)
1277+
ax.contourf(df_mesh.columns, df_mesh.index, df_mesh.values, vmin=vmin, vmax=vmax, alpha=alpha, cmap=cmap, **kwargs)
12731278
else:
1274-
ax.contour(df_mesh.columns, df_mesh.index, df_mesh.values, vmin=vmin, vmax=vmax, alpha=alpha, cmap=cmap)
1279+
ax.contour(df_mesh.columns, df_mesh.index, df_mesh.values, vmin=vmin, vmax=vmax, alpha=alpha, cmap=cmap, **kwargs)
12751280

12761281
# set title
12771282
if not (title is None):
@@ -1513,7 +1518,7 @@ def get_cell_attribute_list(self):
15131518
return self.data['cell']['ls_cellattr'].copy()
15141519

15151520

1516-
def plot_scatter(self, focus='cell_type', z_slice=0.0, z_axis=None, alpha=1, cmap='viridis', title=None, grid=True, legend_loc='lower left', xlim=None, ylim=None, xyequal=True, s=1.0, ax=None, figsizepx=None, ext=None, figbgcolor=None):
1521+
def plot_scatter(self, focus='cell_type', z_slice=0.0, z_axis=None, alpha=1, cmap='viridis', title=None, grid=True, legend_loc='lower left', xlim=None, ylim=None, xyequal=True, s=1.0, ax=None, figsizepx=None, ext=None, figbgcolor=None, **kwargs):
15171522
"""
15181523
input:
15191524
focus: string; default is 'cell_type'
@@ -1588,6 +1593,10 @@ def plot_scatter(self, focus='cell_type', z_slice=0.0, z_axis=None, alpha=1, cma
15881593
or white (jpeg, tiff).
15891594
figure background color.
15901595
1596+
**kwargs: possible additional keyword arguments input,
1597+
handled by the pandas dataframe plot function.
1598+
+ https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.plot.html
1599+
15911600
output:
15921601
fig: matplotlib figure, depending on ext, either as object or as file.
15931602
the figure contains the scatter plot and color bar (numerical data)
@@ -1737,6 +1746,7 @@ def plot_scatter(self, focus='cell_type', z_slice=0.0, z_axis=None, alpha=1, cma
17371746
s = 's',
17381747
grid = grid,
17391748
ax = ax,
1749+
**kwargs,
17401750
)
17411751

17421752
# plot categorical data legen

0 commit comments

Comments
 (0)