From 3802f5ac5ece95238ffe37443f31964fe2e599e1 Mon Sep 17 00:00:00 2001 From: Sean Kavanagh Date: Wed, 28 Jun 2023 10:03:18 +0100 Subject: [PATCH 1/2] Add `**kwargs` to `draw_themed_line` --- sumo/plotting/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sumo/plotting/__init__.py b/sumo/plotting/__init__.py index 2e9aab9f..7d20f461 100644 --- a/sumo/plotting/__init__.py +++ b/sumo/plotting/__init__.py @@ -300,13 +300,16 @@ def get_interpolated_colors(color1, color2, color3, weights, colorspace="lab"): return np.minimum(rgb_colors, 1) -def draw_themed_line(y, ax, orientation="horizontal"): +def draw_themed_line(y, ax, orientation="horizontal", **kwargs): """Draw a horizontal line using the theme settings Args: y (float): Position of line in data coordinates ax (Axes): Matplotlib Axes on which line is drawn - + orientation (str, optional): Orientation of line. Options are + ``"horizontal"`` or ``"vertical"``. + **kwargs: Additional keyword arguments passed to ``ax.axhline`` or + ``ax.axvline``, which can be used to override the theme settings. """ # Note to future developers: feel free to add plenty more optional @@ -320,6 +323,7 @@ def draw_themed_line(y, ax, orientation="horizontal"): zorder=0, linewidth=rcParams["ytick.major.width"], ) + themed_line_options.update(kwargs) if orientation == "horizontal": ax.axhline(y, **themed_line_options) From 1c27aa91a82341328e79c23f4d90a5b8ac1e556e Mon Sep 17 00:00:00 2001 From: Sean Kavanagh Date: Wed, 28 Jun 2023 12:31:48 +0100 Subject: [PATCH 2/2] Docstring fix --- sumo/plotting/bs_plotter.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/sumo/plotting/bs_plotter.py b/sumo/plotting/bs_plotter.py index 29e0495a..d155d243 100644 --- a/sumo/plotting/bs_plotter.py +++ b/sumo/plotting/bs_plotter.py @@ -217,9 +217,6 @@ def get_plot( style (:obj:`list`, :obj:`str`, or :obj:`dict`): Any matplotlib style specifications, to be composed on top of Sumo base style. - no_base_style (:obj:`bool`, optional): Prevent use of sumo base - style. This can make alternative styles behave more - predictably. no_base_style (:obj:`bool`, optional): Prevent use of sumo base style. This can make alternative styles behave more predictably.