Skip to content

Commit

Permalink
[remove] fixed installation and function
Browse files Browse the repository at this point in the history
  • Loading branch information
janscience committed Oct 29, 2024
1 parent ba3e798 commit 6a68881
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/plottools/remove.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
- `uninstall_remove()`: uninstall all code of the remove module from matplotlib.
"""

import matplotlib as mpl


def remove_lines(ax):
"""Remove all line artists that are lines without a marker.
Expand All @@ -31,7 +33,7 @@ def remove_lines(ax):
if line.get_marker() == 'None':
remove_lines.append(line)
for line in remove_lines:
ax.remove(line)
line.remove()


def remove_markers(ax):
Expand All @@ -47,7 +49,7 @@ def remove_markers(ax):
if line.get_marker() != 'None' and line.get_linestyle() == 'None':
remove_lines.append(line)
for line in remove_lines:
ax.remove(line)
line.remove()


def install_remove():
Expand All @@ -63,7 +65,7 @@ def install_remove():
if not hasattr(mpl.axes.Axes, 'remove_lines'):
mpl.axes.Axes.remove_lines = remove_lines
if not hasattr(mpl.axes.Axes, 'remove_markers'):
mpl.axes.Axes.remove_lines = remove_markers
mpl.axes.Axes.remove_markers = remove_markers


def uninstall_remove():
Expand Down

0 comments on commit 6a68881

Please sign in to comment.