Skip to content

Bbox.frozen() does not copy minposx/minposy #19296

Closed
@anntzer

Description

@anntzer

Bug report

Bug summary

All's in the title.

One use case which showcases this is to prevent an artist from participating in autoscaling (in effect, a slightly hackish way to implement something like #15595):

ax = ...
dl = ax.dataLim.frozen()
ax.plot(...)
# restore old datalim, so that plot() does not participate in autoscale
ax.dataLim = dl

which works... except for log-scale, as that needs also copying minposx/minposy.

Code for reproduction

from pylab import *
plot([1, 2]); print(gca().dataLim.minposx, gca().dataLim.frozen().minposx)

Actual outcome

1.0 inf

Expected outcome

1.0 1.0

Matplotlib version

  • Operating system: linux
  • Matplotlib version (import matplotlib; print(matplotlib.__version__)): master (3.3.x)
  • Matplotlib backend (print(matplotlib.get_backend())): any
  • Python version: 3.9
  • Jupyter version (if applicable):
  • Other libraries:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions