0

Python の ggplot からの Geombar。

これがこのgeombarのコードです

gg1 = ggplot(aes(y='y', x='x'), data=new_data) +
    geom_bar(stat="identity") +   
    labs(x="Hour of day",y="Hourly entries") +
    ggtitle("Riders per a hour of day for weekdays")

new_data は、より大きなデータベースから取り出した 2 つの列です。データが大きい。x 変数は 4 時間ブロックの時間 (0、4、8、12 など) であり、y 変数はそれらのブロック内のエントリの量です。

私ならこうします。

gg1 = ggplot(aes(y='y', x='x', fill = 'r'), data=new_data) +
    geom_bar(stat="identity") + 
    labs(x="Hour of day",y="Hourly entries") +
    ggtitle("Riders per a hour of day for weekdays")

私は通常得る

ValueError: incompatible sizes: argument 'bottom' must be length 22570 or scalar

これで、上記と同じグラフが得られました。

4

0 に答える 0