Skip to content

Commit

Permalink
Adds myplot
Browse files Browse the repository at this point in the history
  • Loading branch information
GaidaiIgor committed Jun 21, 2021
1 parent ece9450 commit 6652947
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plots_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ def get_axes(axes):

def filter_kwargs_plot(kwargs):
"""Filters out keys unknown to plot function."""
known_keys = {'color', 'linestyle', 'linewidth', 'marker', 'markersize', 'label'}
known_keys = {'color', 'linestyle', 'ls', 'linewidth', 'lw', 'marker', 'markersize', 'label'}
return {key: value for key, value in kwargs.items() if key in known_keys}


def myplot(x, y, axes=None, marker='.', **kwargs):
axes = get_axes(axes)
axes.plot(x, y, marker=marker, markersize=10, **filter_kwargs_plot(kwargs))
axes.legend().set_draggable(True)
return axes


0 comments on commit 6652947

Please sign in to comment.