如何使用plotnine包在Python中将不同的图表排列成行和列?

huangapple go评论71阅读模式
英文:

How to arrange different plots in rows and column in python if we are making plots by using plotnine package?

问题

在Python中,我们可以使用PLOTNINE来实现相同的效果吗?

英文:

In R, we could plot each graph independently and then arrange all or some of the graphs easily by packages like gridExtra.

p1 <- ggplot(aes(x1,y1), data=df) + geom_point()
p2 <- ggplot(aes(x2,y2), data=df) + geom_point()

grid.arrange(p1, p2, ncol=1)

However, can we do the same thing in Python with PLOTNINE?

答案1

得分: 1

我遇到了相同的问题并找到了解决方法。它是patchworklib包。它允许您像在R中使用ggplot一样排列多个plotnine绘图。在GitHub上查看它:https://github.com/ponnhide/patchworklib

英文:

I had the same problem and found a solution. It is the patchworklib package. It allows you to arrange multiple plotnine plot, as you would do with ggplot in R. Give it a look on github: https://github.com/ponnhide/patchworklib

huangapple
  • 本文由 发表于 2020年1月6日 17:03:52
  • 转载请务必保留本文链接:https://go.coder-hub.com/59609235.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定