绘图库
Plotnine

原始链接: https://plotnine.org/

最后,自定义主题以匹配您的个人风格或组织品牌。 ``` ( ggplot(anscombe_quartet, aes("x", "y")) + geom_point(color="sienna", fill="orange", size=3) + geom_smooth(method="lm", se=False, fullrange=True, color="steelblue", size=1) + facet_wrap("dataset") + labs(title="Anscombe’s Quartet") + scale_y_continuous(breaks=(4, 8, 12)) + coord_fixed(xlim=(3, 22), ylim=(2, 14)) + theme_tufte(base_family="Futura", base_size=16) + theme( axis_line=element_line(color="#4d4d4d"), axis_ticks_major=element_line(color="#00000000"), axis_title=element_blank(), panel_spacing=0.09, ) ) ``` 就是这样,我们从一行代码开始,逐步改进并自定义了数据可视化效果。想知道如何利用自己的数据开始创建这类可视化吗?在下一节中,我们将介绍如何安装 Plotnine。

```Hacker News最新 | 过往 | 评论 | 提问 | 展示 | 招聘 | 提交登录Plotnine (plotnine.org)6 分,作者:tosh,1 小时前 | 隐藏 | 过往 | 收藏 | 2 条评论 帮助 jstanley 10 分钟前 [–] 利用“+”运算符重载来配置绘图……这真是一个“选择”。回复jamessb 0 分钟前 | 父评论 [–] Plotnine 受 ggplot2 库的启发很大,而 ggplot2 也以同样的方式使用 + 运算符:https://ggplot2.tidyverse.org/#usage回复 准则 | 常见问题 | 列表 | API | 安全 | 法律 | 加入 YC | 联系 搜索:```
相关文章

原文

Finally, customize the theme to match your personal style or your organization’s brand.

(
    ggplot(anscombe_quartet, aes("x", "y"))
    + geom_point(color="sienna", fill="orange", size=3)
    + geom_smooth(method="lm", se=False, fullrange=True,
                  color="steelblue", size=1)
    + facet_wrap("dataset")
    + labs(title="Anscombe’s Quartet")
    + scale_y_continuous(breaks=(4, 8, 12))
    + coord_fixed(xlim=(3, 22), ylim=(2, 14)) 
    + theme_tufte(base_family="Futura", base_size=16)
    + theme(
        axis_line=element_line(color="#4d4d4d"),
        axis_ticks_major=element_line(color="#00000000"),
        axis_title=element_blank(),
        panel_spacing=0.09,
    )
)

There you have it, we started with a single line of code, and incrementally improved and customized our data visualization.

Curious how you can start creating these kinds of visualizations with your own data? In the next section we cover how to install Plotnine.

联系我们 contact @ memedata.com