diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 7e2103003cad..1f55d912c007 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -474,11 +474,22 @@ def indicate_inset(self, bounds, inset_ax=None, *, transform=None, if self.yaxis.get_inverted(): ey = 1 - ey xy_data = x + ex * width, y + ey * height + + disallowed_keys = { + 'alpha', 'rasterized', 'transform', + 'color', 'facecolor', 'url', + 'hatch', 'in_layout', 'path_effects'} + + patch_kwargs = { + key: val for key, val in kwargs.items() + if key not in disallowed_keys} + p = mpatches.ConnectionPatch( xyA=xy_inset_ax, coordsA=inset_ax.transAxes, xyB=xy_data, coordsB=self.transData, arrowstyle="-", zorder=zorder, - edgecolor=edgecolor, alpha=alpha) + edgecolor=edgecolor, alpha=alpha, + **patch_kwargs) connects.append(p) self.add_patch(p)