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 autoscaleax.dataLim=dl
which works... except for log-scale, as that needs also copying minposx/minposy.
If you overload 'frozen' by implementing it inside BBox, than you can add whichever of BBox's attributes (such as miniposx and minposy) to the attributes returned in the frozen version.
Another option is extending BBox.get_points but I don't like that approach since miniposx and miniposy aren't points.
I've reclassified this - I don't think anything that touches the minpos machinery is a "Good first issue". Maybe its "Easy" if you know what minpos is and understand its use in the library, but given that it is almost undocumented, that requires digging through the code. Thats not to preclude this being a "first issue", but first time contributors should expect to do said digging.
Activity
Monishver commented on Jan 18, 2021
Hello @anntzer , I'm new to open source, and would like to contribute to this issue, could you explain this issue more and navigate me a little bit.
story645 commented on Jan 18, 2021
hi @Monishver! check out our development guide at https://matplotlib.org/devdocs/
The issue is that the method frozen on BBoxes parent
matplotlib/lib/matplotlib/transforms.py
Lines 259 to 261 in 6530db1
One possible solution is for Bbox to implement its own frozen method but there are probably others.
Monishver commented on Jan 19, 2021
Thanks for giving a detailed overview, I have started looking into it and will try to implement it in few days.
story645 commented on Jan 26, 2021
If you overload 'frozen' by implementing it inside BBox, than you can add whichever of BBox's attributes (such as miniposx and minposy) to the attributes returned in the frozen version.
Another option is extending BBox.get_points but I don't like that approach since miniposx and miniposy aren't points.
jklymak commented on Jan 26, 2021
I've reclassified this - I don't think anything that touches the minpos machinery is a "Good first issue". Maybe its "Easy" if you know what minpos is and understand its use in the library, but given that it is almost undocumented, that requires digging through the code. Thats not to preclude this being a "first issue", but first time contributors should expect to do said digging.
Add test testing matplotlib#19296
Add overriding frozen function to Bbox
Add overriding frozen function to Bbox
Add requirement report for Issue matplotlib#19296
Fix requirement report for Issue matplotlib#19296
Add test testing matplotlib#19296
Add overriding frozen function to Bbox