-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
ENH: add ability to remove layout engine #22452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,6 +100,30 @@ def execute(self, fig): | |
raise NotImplementedError | ||
|
||
|
||
class PlaceHolderLayoutEngine(LayoutEngine): | ||
""" | ||
This layout engine does not adjust the figure layout at all. | ||
|
||
The purpose of this `.LayoutEngine` is to act as a place holder when the | ||
user removes a layout engine to ensure an incompatible `.LayoutEngine` can | ||
not be set later. | ||
|
||
Parameters | ||
---------- | ||
adjust_compatible, colorbar_gridspec : bool | ||
Allow the PlaceHolderLayoutEngine to mirror the behavior of whatever | ||
layout engine it is replacing. | ||
|
||
""" | ||
def __init__(self, adjust_compatible, colorbar_gridspec, **kwargs): | ||
self._adjust_compatible = adjust_compatible | ||
self._colorbar_gridspec = colorbar_gridspec | ||
super().__init__(**kwargs) | ||
|
||
def execute(self, fig): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess I'm not sure about adding a Null engine here. It makes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can not stick a formatter on at init time without making the bools tri-states ( Unfortunately I think that "never been set" vs "was set and then removed" are in fact different. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah I see - we don't want to switch colorbar behaviour after it has started to be used... So we are turning off the algorithm, but keeping its side effect. At some point we need to figure out how to ditch the two ways of placing colorbars without breaking everybody. |
||
return | ||
|
||
|
||
class TightLayoutEngine(LayoutEngine): | ||
""" | ||
Implements the ``tight_layout`` geometry management. See | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were we doing
*None*
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We seem to have about the same number of both
[edit updated to exclude docs build product]