我用python中的plotnine
绘制了两个绘图。我知道不支持绘制子图(here)。我想知道是否有一种方法可以在一个图中创建子图。在
我想用plotineplot.draw()
把它们做成一个图形,然后用matplotlib读取,或者先将它们保存为png,然后用matplotlib读取它们并将它们组合在一起。但是,我对matplotlib不是很在行,直到现在,每次尝试都是徒劳的。在
示例图9:
from plotnine import data
from plotnine import *
plot1 = (ggplot(data.mtcars, aes('wt', 'mpg', color='factor(gear)'))
+ geom_point()
+ stat_smooth(method='lm')
+ facet_wrap('~gear'))
任何帮助都会很有帮助的。在
最后,我创建了一个解决方案,将图保存为图像,然后再次加载并组合它们。这不是最快或最有效的方法,但它工作得很好。在
相关问题 更多 >
编程相关推荐