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
[ENH]: Colorbar should support location kwarg that sets both orientation and ticklocation #22676
When colorbar autocreates an Axes, one can pass location, which also sets the colorbar's orientation and the ticklocation (left for a left colorbar, right for a right colorbar, etc.). When one instead passes a manually created Axes (e.g. using inset_axes, as suggested by the colorbar_placement.py example), the location kwarg is not accepted (because things are directly passed to the Colorbar class); one needs to explicitly set orientation and ticklocation (the latter is not even documented by Figure.colorbar):
Add a location kwarg to the Colorbar constructor which sets both orientation and ticklocation, and is mutually exclusive with them.
... or at least better document the workaround.
I assume that setting location should override orientation? Since orientation has a default non-None value. Or should one change the default value to None to be able to detect which value was set?
Activity
oscargus commentedon Jun 14, 2022
I assume that setting
locationshould overrideorientation? Sinceorientationhas a default non-None value. Or should one change the default value to None to be able to detect which value was set?anntzer commentedon Jun 14, 2022
Sure, I would apply the same logic as in make_axes (which is really encapsulated into _normalize_location_orientation).