Skip to content

Commit

Permalink
Merge pull request #212 from kavanase/master
Browse files Browse the repository at this point in the history
Add `**kwargs` to `draw_themed_line`
  • Loading branch information
utf authored Oct 11, 2023
2 parents 9edbdba + 1c27aa9 commit ff141b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 6 additions & 2 deletions sumo/plotting/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,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
Expand All @@ -346,6 +349,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)
Expand Down
3 changes: 0 additions & 3 deletions sumo/plotting/bs_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,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.
Expand Down

0 comments on commit ff141b1

Please sign in to comment.