Adding caption below X-axis for a scatter plot using matplotlib

前端 未结 5 1050
灰色年华
灰色年华 2021-02-07 03:17

I am pretty new to python and to the matplotlib library. I have created a scatter plot using matplotlib and now I wish to add caption a little below the X-axis. This is my code:

5条回答
  •  闹比i
    闹比i (楼主)
    2021-02-07 04:23

    You can simply use figtext. You can also change the value of x and y-axes as you want.

    txt="I need the caption to be present a little below X-axis"
    plt.figtext(0.5, 0.01, txt, wrap=True, horizontalalignment='center', fontsize=12)
    

提交回复
热议问题