python - Plot bar chart from pandas dataframe -
i have following pandas dataframe plot nan
, high
values bar plot
in matplotlib:
df close 1 close 2 close 3 close 4 close 5 close 6 index nan 0.000348 0.000975 0.001450 0.001923 0.002483 0.002916 high 0.001416 -0.000215 0.000058 0.000026 -0.000766 -0.000255
the labels on x-axis shall column names. how can done?
many in advance.
you can plot transposed df:
in [9]: import matplotlib ...: matplotlib.style.use('ggplot') ...: in [10]: df.t.plot.bar(rot=0) out[10]: <matplotlib.axes._subplots.axessubplot @ 0xa1ae240>
with vertical labels:
in [14]: df.t.plot.bar(width=0.85, alpha=0.6, figsize=(14,12)) out[14]: <matplotlib.axes._subplots.axessubplot @ 0xa3499e8>
Comments
Post a Comment