2

次のコードがあります

p = ggplot(aes(x='DHT temp',y='temp3'), data=data)
p + geom_point(alpha=0.1, size=10) + scale_x_continuous(limits=(20,30)) + 
scale_y_continuous(limits=(0,170)) + theme_bw()\
+ geom_abline(intercept=20)

次のエラーが表示されます。

<repr(<ggplot.ggplot.ggplot at 0x607a3d0>) 
failed: UnboundLocalError: local variable 'x' referenced before assignment>

いくつかのサンプルデータ

     HIH     DHThum  DHTtemp temp1   temp3
0    350     67.7    22.7    328     148
1    356     67.9    22.7    328     149
2    365     67.8    22.7    328     148
3    349     67.9    22.6    327     148
4    348     68.0    22.6    328     149
4

2 に答える 2

3

これは ggplot のバグで、バージョン 0.5.8 で修正されました。

于 2015-01-06T21:53:51.957 に答える