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> 

enter image description here

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> 

enter image description here


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -