Python Matplotlib figure title overlaps axes label when using twiny

前端 未结 6 1972
滥情空心
滥情空心 2020-11-27 11:42

I am trying to plot two separate quantities on the same graph using twiny as follows:

fig = figure()
ax = fig.add_subplot(111)
ax.plot(T, r, \'b-\', T, R, \'         


        
6条回答
  •  眼角桃花
    2020-11-27 12:13

    ax.set_title('My Title\n', fontsize="15", color="red")
    plt.imshow(myfile, origin="upper")
    

    If you put '\n' right after your title string, the plot is drawn just below the title. That might be a fast solution too.

提交回复
热议问题