Matplotlib colorbar ticks on left/opposite side

前端 未结 4 1896
孤城傲影
孤城傲影 2020-12-09 08:31

One could generate a vertical colorbar like so(simplified):

import matplotlib.pyplot as plt
import matplotlib as mpl

plt.figure()
c_ax=plt.subplot(111)
cb =          


        
4条回答
  •  一个人的身影
    2020-12-09 09:15

    For some reason applying changes to the colorbar input axes (cax parameter) did not work for me.

    However, grabbing the axes from the colorbar object and then applying the changes worked nicely:

    cb.ax.xaxis.set_ticks_position("top")
    

提交回复
热议问题