我在带有plotine的python中使用ggplot,我有这段代码:
my_plot_availability = (ggplot(df)
+ aes(x='time_elapsed',y='mean',fill='policy')
+ geom_bar(position=position_dodge(),stat = "identity", color = "black",size = 0.5)
+ geom_errorbar(aes(ymin='mean-error', ymax='mean+error'), width=.2,position=position_dodge(.9))
+ facet_wrap('mobility')
+ scale_fill_manual(["darkgray", "gray"])
+ labs(x = "Time elpased [s]")
+ labs(y = "Mean content availability")
+ theme(element_text(family="Times",size=12))
)
绘制此图:
而且我希望具有相同大小的条,即使在某些情况下(如情况0)也只有一个条。我知道我应该这样做:
position=position_dodge2(preserve='single')
但是我在python中遇到以下错误:
NameError: name 'position_dodge2' is not defined
您知道如何解决吗?
您需要将您的皮兰汀版本升级到v0.6.0。