文章(post)

Tricks for better looking Matplotlib drawing

Tricks for better looking Matplotlib drawing

$\LaTeX$ and multi-line in all the texts

You can have $\LaTeX$ environment by simply add r before the text. If you want to have multi-line, you can do like below:

1
text=r"First line""\n"r"Second line"

where you have to add r for both line to enable the $\LaTeX$ env.

multi-columns in legend

Use plt.legend(ncol=k) where k is the number of columns you want.

本文由作者按照 CC BY 4.0 进行授权 This post is licensed under CC BY 4.0 by the author.

热门标签(Trending Tags)