Skip to content

Navigation Menu

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

Appearance settings

[Bug]: get_path_collection_extents wrong when master_transform is not affine #26515

Copy link
Copy link
Open
@anntzer

Description

@anntzer
Issue body actions

Bug summary

All's in the title.

Code for reproduction

from matplotlib.path import *
from matplotlib.transforms import *
from matplotlib.scale import LogTransform

get_path_collection_extents(
    Affine2D().scale(2, 3),
    [Path([(1, 2), (3, 4)])], [], [(0, 0)], IdentityTransform())
get_path_collection_extents(
    blended_transform_factory(IdentityTransform(), LogTransform(10)) + Affine2D().scale(2, 3),
    [Path([(1, 2), (3, 4)])], [], [(0, 0)], IdentityTransform())

Actual outcome

Both expressions evaluate to Bbox([[2.0, 6.0], [6.0, 12.0]]).

Expected outcome

The second expression is different.

Additional information

This probably has the same underlying cause as #7975 (implicit conversion of the non-affine transform to its affine component only). (I tried to add a warning for the deprecation in #7975 and ran into this bug.)
get_path_collection_extents is called by Collection.get_datalim; it may be possible to construct a more explicit example where the autoscaling is wrong for a suitably-constructed Collection.

Operating system

macos

Matplotlib Version

3.8.0.dev1803+gbba391d1b6

Matplotlib Backend

any

Python version

3.11.3

Jupyter version

No response

Installation

git checkout

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.