Skip to content

Commit

Permalink
improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
bendichter committed Feb 19, 2024
1 parent 348f22c commit acf311b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 3 additions & 3 deletions brokenaxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,9 @@ def __getattr__(self, method):
"get_second_yaxis",
"get_second_xaxis",
"get_legend",
"get_title",
"get_xlabel",
"get_ylabel",
]:
return getattr(self.big_ax, method)

Expand Down Expand Up @@ -363,9 +366,6 @@ def legend(self, handles=None, labels=None, *args, **kwargs):
labels = l
return self.big_ax.legend(handles=handles, labels=labels, *args, **kwargs)

def axis(self, *args, **kwargs):
[ax.axis(*args, **kwargs) for ax in self.axs]

def secondary_yaxis(
self, location="right", functions=None, label=None, labelpad=30
):
Expand Down
8 changes: 8 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,11 @@ def test_get_axis_special():
assert isinstance(bax.get_shared_x_axes(), mpl.cbook.GrouperView)
assert isinstance(bax.get_xaxis(), mpl.axis.XAxis)
assert isinstance(bax.get_shared_y_axes(), mpl.cbook.GrouperView)


def test_draw_diags():
fig = plt.figure(figsize=(5, 2))
bax = brokenaxes(
xlims=((0, 0.1), (0.4, 0.7)), ylims=((-1, 0.7), (0.79, 1)), hspace=0.05
)
bax.draw_diags(tilt=90, d=.05)

0 comments on commit acf311b

Please sign in to comment.