Skip to content
Snippets Groups Projects

Multi var plot

Merged Peter Lünenschloß requested to merge multiVarPlot into develop
Compare and
2 files
+ 239
111
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 27
5
@@ -194,12 +194,18 @@ class ToolsMixin:
self._flags[mask, field] = UNFLAGGED
return self
@register(mask=[], demask=[], squeeze=[])
@register(
mask=[],
demask=[],
squeeze=[],
multivariate=True,
)
def plot(
self: "SaQC",
field: str,
field: str | list[str],
path: str | None = None,
max_gap: str | None = None,
mode: Literal["subplots", "oneplot"] = "subplots",
history: Literal["valid", "complete"] | list[str] | None = "valid",
xscope: slice | None = None,
phaseplot: str | None = None,
@@ -264,15 +270,30 @@ class ToolsMixin:
To reopen a pickled figure execute: ``pickle.load(open(savepath, "w")).show()``
ax_kwargs :
Axis keywords. Change the axis labeling defaults. Most important keywords:
``"xlabel"``, ``"ylabel"``, ``"title"``, ``"fontsize"``, ``"cycleskip"``.
Axis keywords. Change axis specifics:
* ``"xlabel"``: Either single string, that is to be attached to all x-axis´, or
a List of labels, matching the number of variables to plot in length, or a dictionary, directly
assigning labels to certain fields - defaults to ``None`` (no labels)
* ``"ylabel"``: Either single string, that is to be attached to all y-axis´, or
a List of labels, matching the number of variables to plot in length, or a dictionary, directly
assigning labels to certain fields - defaults to ``None`` (no labels)
* ``"title"``: Either a List of labels, matching the number of variables to plot in length, or a dictionary, directly
assigning labels to certain variables - defaults to ``None`` (every plot gets titled the plotted variables name)
* ``"fontsize"``: (float) Adjust labeling and titeling fontsize
* ``"cycleskip"``: (int) start the cycle of shapes that are assigned any flag-type with a certain lag - defaults to ``0`` (no skip)
* ``"nrows"``, ``"ncols"``: shape of the subplot matrix the plots go into: If both are assigned, a subplot
matrix of shape `nrows` x `ncols` is generated. If only one is assigned, the unassigned dimension is 1.
defaults to plotting into subplot matrix with 2 columns and the necessary number of rows to fit the
number of variables to plot.
"""
data, flags = self._data.copy(), self._flags.copy()
level = kwargs.get("flag", UNFLAGGED)
if dfilter < np.inf:
data[field].loc[flags[field] >= dfilter] = np.nan
for f in field:
data[f].loc[flags[f] >= dfilter] = np.nan
if store_kwargs is None:
store_kwargs = {}
@@ -290,6 +311,7 @@ class ToolsMixin:
field=field,
flags=flags,
level=level,
mode=mode,
max_gap=max_gap,
history=history,
xscope=xscope,
Loading