Skip to content

Commit

Permalink
improve doc of plot module
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipMay committed Dec 10, 2023
1 parent 86e0e4d commit 9d5923e
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions mltb2/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,26 @@ def twin_axes_timeseries_plot(
fig.tight_layout()


def boxplot(values, labels=None, title=None, xlabel=None, ylabel=None, vert=True):
def boxplot(
values,
labels=None,
title: Optional[str] = None,
xlabel: Optional[str] = None,
ylabel: Optional[str] = None,
vert: bool = True,
):
"""Prints one or more boxplots in a single diagram.
This function does not call `matplotlib.pyplot.plot()`.
Args:
values: Values for the boxplot(s).
labels: Labels for the boxplot(s).
title: Title of the plot.
xlabel: Label for the x-axis.
ylabel: Label for the y-axis.
vert: If ``True`` (default), makes the boxes vertical.
If ``False``, makes horizontal boxes.
"""
_, ax = plt.subplots()

Expand All @@ -106,10 +122,24 @@ def boxplot(values, labels=None, title=None, xlabel=None, ylabel=None, vert=True
plt.xticks(rotation=90)


def boxplot_dict(values_dict, title=None, xlabel=None, ylabel=None, vert=True):
def boxplot_dict(
values_dict,
title: Optional[str] = None,
xlabel: Optional[str] = None,
ylabel: Optional[str] = None,
vert: bool = True,
):
"""Create boxplot form dictionary.
This function does not call `matplotlib.pyplot.plot()`.
Args:
values_dict: Dictionary with values for the boxplot(s).
title: Title of the plot.
xlabel: Label for the x-axis.
ylabel: Label for the y-axis.
vert: If ``True`` (default), makes the boxes vertical.
If ``False``, makes horizontal boxes.
"""
values = []
labels = []
Expand Down

0 comments on commit 9d5923e

Please sign in to comment.