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
Cartopy has artists separate from the XAxis and YAxis which must be considered for title placement. Currently, it does that by overriding _update_title_position. Overriding a private method is not ideal, neither is repeating some of the code that is already in the parent method.
Proposed fix
Factor out a public method that returns top. Making it public means it can safely be overridden in subclasses such as PolarAxes and Cartopy's GeoAxes. Knowing it can/should be overridden in subclasses means that in the parent Axes we can use the most efficient approach that works for Axes.
Summary
topwithinAxes._update_title_positiononly needed to work for ordinaryAxesinstances.XAxisandYAxiswhich must be considered for title placement. Currently, it does that by overriding_update_title_position. Overriding a private method is not ideal, neither is repeating some of the code that is already in the parent method.Proposed fix
Factor out a public method that returns
top. Making it public means it can safely be overridden in subclasses such asPolarAxesand Cartopy'sGeoAxes. Knowing it can/should be overridden in subclasses means that in the parentAxeswe can use the most efficient approach that works forAxes.