From the matplotlib command summary for the colorbar method I am aware that the keyword argument orientation := 'horizontal' | 'vertical'
as a parameter places an horizontal bar underneath the plot or a vertical to the right of it respectively.
Yet, in my situation, I would rather place the colour bar at the opposite side of the default (without too much fiddling... if possible).
How could I code this? Am I missing some obvious feature?
I've found another method that avoids having to manually edit axes locations, and instead allows you to keep the colorbar linked to an existing plot axis by using the location keyword (method adapted initially from here).
The location argument is meant to be used on colorbars which reference multiple axes in a list (and will throw an error if colorbar is given only one axis), but if you simply put your one axis in a list, it will allow you to use the argument. You can use the following code as an example:
which yields this plot:
:
I think the easiest way is to make sure the colorbar is in its own axis. You can adapt from this example:
which results in this: