making matplotlib graphs look like R by default?

后端 未结 8 1731
自闭症患者
自闭症患者 2021-01-29 23:02

Is there a way to make matplotlib behave identically to R, or almost like R, in terms of plotting defaults? For example R treats its axes pretty differently from

8条回答
  •  迷失自我
    2021-01-29 23:27

    The Seaborn visualisation library can do that. For example, to reproduce the style of the R histogram use:

    sns.despine(offset=10, trim=True)
    

    as in https://seaborn.pydata.org/tutorial/aesthetics.html#removing-axes-spines

    To reproduce the style of the R scatter plot use:

    sns.set_style("ticks")
    

    as shown in https://seaborn.pydata.org/tutorial/aesthetics.html#seaborn-figure-styles

提交回复
热议问题