mikedewar / d3py

a plottling library for python, based on D3
1.42k stars 201 forks source link

have bar default to using the Pandas index as its x-domain #40

Open mikedewar opened 12 years ago

mikedewar commented 12 years ago

suggested idiom:

df = pandas.DataFrame(
    {
        "count" : [1,4,7,3,2,9],
    },
    index = ["a", "b", "c", "d", "e", "f"]
)

with d3py.Figure(df) as p:
    p += d3py.Bar(y = "count")
    p += d3py.xAxis()
    p.show()

this would draw the bar chart with the index as the x-bins.