Make part of a matplotlib title bold and a different color

前端 未结 3 1612
滥情空心
滥情空心 2020-11-29 11:18

I would like to change part of a title to be bold. For example:

plt.title(\"This is title number: \" + str(number))

Given a title like the

3条回答
  •  心在旅途
    2020-11-29 11:43

    activate latex text rendering

    from matplotlib import rc
    rc('text', usetex=True)
    
    plt.title("This is title number: " + r"\textbf{" + str(number) + "}")
    

提交回复
热议问题