Skip to content
Snippets Groups Projects
Commit 472062b5 authored by Bert Palm's avatar Bert Palm 🎇
Browse files

removed default fixed figure-size in interactive mode, which is unfortunate on small displays

parent d4a11d5f
No related branches found
No related tags found
1 merge request!283fixed some plotting issues
Pipeline #28968 passed with stage
in 2 minutes and 50 seconds
......@@ -261,6 +261,12 @@ def plot(
"""
Stores or shows a figure object, containing data graph with flag marks for field.
There are two modes, 'interactive' and 'store' mode, wich is determind via the
``save_path`` keyword. In interactive mode (default) the plot is shown at runtime
and the execution stops until the plot window is closed manually by a user. In
store mode the generated plot is stored to disk and no manually interaction is
needed.
Parameters
----------
data : {pd.DataFrame, dios.DictOfSeries}
......@@ -273,8 +279,10 @@ def plot(
Flags or flagger object
save_path : str, default None
Path to the location where the figure shall be stored to.
If ``None`` is passed, plots are not stored and shown interactively instead.
If ``None`` is passed, interactive mode is entered; plots are shown immediatly
and a user need to close them manually before execution continues.
If a filepath is passed instead, store-mode is entered and
the plot is stored unter the passed location.
max_gap : str, default None
If None, all the points in the data will be connected, resulting in long linear
......@@ -301,8 +309,9 @@ def plot(
removed by later tests
fig_kwargs : dict, default None
Keyword arguments controlling figure generation. ``None`` defaults to
``{"figsize": (16, 9)}``.
Keyword arguments controlling figure generation. In interactive mode,
``None`` defaults to ``{"figsize": (16, 9)}`` to ensure a proper figure size,
in store-mode ``None`` defaults to a empty dictionary.
save_kwargs : dict, default {}
Keywords to be passed on to the ``matplotlib.pyplot.savefig`` method, handling
......@@ -347,8 +356,12 @@ def plot(
if interactive:
mpl.use(_MPL_DEFAULT_BACKEND)
else:
mpl.use("Agg")
# ensure a proper size in stored plot
if fig_kwargs is None:
fig_kwargs = {"figsize": (16, 9)}
fig = makeFig(
data=data,
......
......@@ -118,7 +118,7 @@ def makeFig(
if plot_kwargs is None:
plot_kwargs = {"history": False}
if fig_kwargs is None:
fig_kwargs = {"figsize": (16, 9)}
fig_kwargs = {}
if stats_dict is None:
stats_dict = {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment