Python matplotlib decrease size of colorbar labels

前端 未结 2 546
滥情空心
滥情空心 2020-12-02 19:39

I need your help! I have a plotting code which is the following:

fig = plt.figure()
ax1 = fig.add_subplot(111)

imax1 = ax1.imshow(data,interpolation = \'nea         


        
相关标签:
2条回答
  • 2020-12-02 20:19

    If you are here because you're trying to increase font size, but some numbers disappear because of big size with the above answer, you can do

    cbar = plt.colorbar()
    for t in cbar.ax.get_yticklabels():
         t.set_fontsize(20)
    
    0 讨论(0)
  • 2020-12-02 20:25

    Aha! Found the answer here:

    cbar.ax.tick_params(labelsize=10) 
    

    P.S. Upvote that answer and give Paul some love!

    0 讨论(0)
提交回复
热议问题