mikedewar / d3py

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

AttributeError: 'module' object has no attribute 'Figure' #50

Open sloria opened 11 years ago

sloria commented 11 years ago

I get the following error when running the example code in the README:

File "d3py.py", line 1, in <module>
    import d3py
  File "/Users/sloria1/projects/sandbox/d3py.py", line 15, in <module>
    fig = d3py.Figure(df, name="basic_example", width=300, height=300) 
AttributeError: 'module' object has no attribute 'Figure'

From the README:

import d3py
import pandas
import numpy as np

# some test data
T = 100
# this is a data frame with three columns (we only use 2)
df = pandas.DataFrame({
    "time" : range(T),
    "pressure": np.random.rand(T),
    "temp" : np.random.rand(T)
})
## build up a figure, ggplot2 style
# instantiate the figure object
fig = d3py.Figure(df, name="basic_example", width=300, height=300) 
# add some red points
fig += d3py.geoms.Point(x="pressure", y="temp", fill="red")
# writes 3 files, starts up a server, then draws some beautiful points in Chrome
fig.show()
mikedewar commented 11 years ago

Hello! I think I've fixed this. Sorry for the problem. I've updated the code and the example, so now you should use the PandasFigure instead of a straight Figure object to make the plot. If you'd be so kind, please check out the new master branch of the code, install it and see if you can get the README.md example running and also the examples in the example folder.

Thanks so much for logging the issue! Please do shout if there are any problems. I'd like this to at least be installable and for the basic examples to work.

qiuyi116 commented 9 years ago

@mikedewar I also meet this problem. And have do like you said, but it didn't work. File "/home/qy/python/d3py.py", line 15, in fig = d3py.PandasFigure(df, name="basic_example", width=300, height=300) AttributeError: 'module' object has no attribute 'PandasFigure'

rohansb commented 7 years ago

is this still an open issue? How far d3py has come along since, any alternatives/suggestions? do you see it being integrated into pandas anytime soon? http://pandas.pydata.org/developers.html#development-roadmap

mikedewar commented 7 years ago

the story ended a while ago, as described in the README. I'm not sure how the pandas guys intend to think about plotting, but the ggplot-based idiom described in this project still seems pretty good!