Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

AxesImage does not respect its clip_box property #14396

Closed
Milestone
@anntzer

Description

@anntzer

Bug report

Bug summary

Regardless of an AxesImage clip_box property value, they are always additionally clipped to their parent Axes' bbox, unlike other artists (e.g. Line2D) who can have a clip_box completely independent of their parent axes.

Code for reproduction

from matplotlib import pyplot as pltfig, axs = plt.subplots(2, 2)l, = axs[0, 1].plot([0, 1])l.set_clip_box(axs[0, 0].bbox)im = axs[1, 1].imshow([[0, 1], [2, 3]], aspect="auto", extent=(0, 1, 0, 1))im.set_clip_path(None)im.set_clip_box(axs[1, 0].bbox)plt.show()

Actual outcome

The line inaxs[0, 1] can be seen inaxs[0, 0] by panningaxs[0, 1] to the side.
The image inaxs[1, 1] cannot be seen inaxs[1, 0] (or anywhere else, for that matter) by panning.

Expected outcome

im is correctly clipped toaxs[1, 0].

This is likely due to the implementation of AxesImage.make_image

    def make_image(self, renderer, magnification=1.0, unsampled=False):        # docstring inherited        trans = self.get_transform()        # image is created in the canvas coordinate.        x1, x2, y1, y2 = self.get_extent()        bbox = Bbox(np.array([[x1, y1], [x2, y2]]))        transformed_bbox = TransformedBbox(bbox, trans)        return self._make_image(            self._A, bbox, transformed_bbox, self.axes.bbox, magnification,            unsampled=unsampled)

(passingself.axes.bbox as clipping bbox to self._make_image is the problem).

Matplotlib version

  • Operating system: linux
  • Matplotlib version: master
  • Matplotlib backend (print(matplotlib.get_backend())): qt5agg
  • Python version: 37
  • Jupyter version (if applicable): none
  • Other libraries:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp