You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
too much white space around Root Locus with omega-damping grid #1147
When I turn on the omega-damping grid for root locus plot with grid=True (turned on by default), it adds too much white space around the actual plot, which is very annoying. With this grid turned off, plot is tight and nice.
I would like root locus to not have this extra white space around when grid is turned on, I am pretty sure this is some sort of platform-specific bug. Would appreciate any help 🙏
No, I ran it in IPython in a terminal, so the Matplotlib backend would be different. I just tried in Colab and reproduced it (like you), so now I think it is something new.
control's grid.py defines ModifiedExtremeCycleFinder, subclassing matplotlib's angle_helper.ExtremeFinderCycle, and overrides __call__. ExtremeFinderCycle is a subclass of ExtremeFinderSimple.
Somewhere between matplotlib 3.10.0 and 3.11.0, matplotlib moved the extreme finder logic into _find_transformed_bbox, which is called by ExtremeFinderSimple's __call__, and _find_transformed_bbox is directly called in some places, e.g., GridFinder.get_grid_info. In control, _find_transformed_bbox is not overridden, so we're getting the "finder" behaviour of ExtremeFinderCycle.
I did a cursory search of matplotlib's issues for ExtremeFinderSimple and _find_transformed_bbox, but nothing is mentioned. The docs for this corner of matplotlib are a bit thin.
Anyway, the fix on the control side is to move the calcs in ModifiedExtremeCycleFinder.__call__ to _find_transformed_bbox, and (to be confirmed) just omit the __call__ override.
That doesn't solve the extra whitespace question for Matplotlib 3.10.0, of course - I've hijacked the discussion around that a bit, sorry.
Activity
slivingston commentedon Apr 26, 2025
I cannot reproduce on the current tip of
mainbranch, so this must have been fixed already. There is a new release coming soon: #1130murrayrm commentedon Apr 26, 2025
@slivingston Did you run inside a Jupyter notebook? What version?
I tried running this using the following versions and got the same problem as @datacurse noted:
I also tried running this on Colab and I get the same problem using the following commands:
slivingston commentedon Apr 26, 2025
No, I ran it in IPython in a terminal, so the Matplotlib backend would be different. I just tried in Colab and reproduced it (like you), so now I think it is something new.
roryyorke commentedon Jul 11, 2026
With matplotlib 3.10.0, I can reproduce this. (Also happens in Colab, at time of writing, and Colab is also running matplotlib 3.10.0)
With matplotlib 3.11.0, there's no extra whitespace, but the damping grid lines look wrong.
Other installed packages at end; apologies for long list, I also installed jupyterlab.
matplotlib 3.10.0
matplotlib 3.11.0
packages
changing matplotlib versions didn't result in any upgrade or downgrade of other packages. This list is for matplotlib 3.11.0.
roryyorke commentedon Jul 12, 2026
control's
grid.pydefinesModifiedExtremeCycleFinder, subclassing matplotlib'sangle_helper.ExtremeFinderCycle, and overrides__call__.ExtremeFinderCycleis a subclass ofExtremeFinderSimple.Somewhere between matplotlib 3.10.0 and 3.11.0, matplotlib moved the extreme finder logic into
_find_transformed_bbox, which is called byExtremeFinderSimple's__call__, and_find_transformed_bboxis directly called in some places, e.g., GridFinder.get_grid_info. In control,_find_transformed_bboxis not overridden, so we're getting the "finder" behaviour ofExtremeFinderCycle.See https://gist.github.com/roryyorke/655741c97b6bb6062f6fcb037151cac1/revisions for diff of
grid_finder.pybetween 3.10.0 and 3.11.0 (this is "by-hand" created in Github gist; Github doesn't have easily accessible file-diff-between-version capability).I did a cursory search of matplotlib's issues for ExtremeFinderSimple and _find_transformed_bbox, but nothing is mentioned. The docs for this corner of matplotlib are a bit thin.
Anyway, the fix on the control side is to move the calcs in
ModifiedExtremeCycleFinder.__call__to_find_transformed_bbox, and (to be confirmed) just omit the__call__override.That doesn't solve the extra whitespace question for Matplotlib 3.10.0, of course - I've hijacked the discussion around that a bit, sorry.