8000 Simplify parameter handling in FloatingAxesBase. by anntzer · Pull Request #20253 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Simplify parameter handling in FloatingAxesBase. #20253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions lib/mpl_toolkits/axisartist/floating_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import numpy as np

from matplotlib import _api, cbook
import matplotlib.axes as maxes
import matplotlib.patches as mpatches
from matplotlib.path import Path
import matplotlib.axes as maxes

from mpl_toolkits.axes_grid1.parasite_axes import host_axes_class_factory

Expand Down Expand Up @@ -311,13 +311,9 @@ def get_boundary(self):

class FloatingAxesBase:

def __init__(self, *args, **kwargs):
grid_helper = kwargs.get("grid_helper", None)
if grid_helper is None:
raise ValueError("FloatingAxes requires grid_helper argument")
if not hasattr(grid_helper, "get_boundary"):
raise ValueError("grid_helper must implement get_boundary method")
super().__init__(*args, **kwargs)
def __init__(self, *args, grid_helper, **kwargs):
_api.check_isinstance(GridHelperCurveLinear, grid_helper=grid_helper)
super().__init__(*args, grid_helper=grid_helper, **kwargs)
self.set_aspect(1.)
self.adjust_axes_lim()

Expand Down
0