Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(rect): reproduce unemployment rect plot from bokeh docs #85

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fleimgruber
Copy link

Support for rect glyphs as proposed in #84.

The idea is to reproduce this rect plot from the bokeh gallery.

Right now it hits https://github.com/PatrikHlobil/Pandas-Bokeh/blob/master/pandas_bokeh/plot.py#L421 because the Month column is not numeric (https://github.com/PatrikHlobil/Pandas-Bokeh/blob/master/pandas_bokeh/plot.py#L418).

@PatrikHlobil what would be your general advice on how to proceed? Also, I am not yet sure how to best reuse existing code (as e.g. the category argument is needed to reproduce the example plot).

p_rect_accessor = df_unemployment.plot_bokeh.rect(**kwargs)

p_rect_pandas_backend = df_unemployment.plot(kind="rect", **kwargs)
p_rect_accessor_pandas_backend = df_unemployment.plot.map(**kwargs)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouod be df_unemployment.plot_bokeh.rect

@PatrikHlobil
Copy link
Owner

I would propose that you have a look at the code that uses the category option (e.g. scatterplot) and try to extract the corresponding code into a new function if possible. The code base is really messy, but I didn't have any time to clean it so far 👎

If the scatterplot code doesn't help you, you can also just implement the feature set on your own.

Best, Patrik

PS: Love it that you start your work by writting a test. Wish I would have been so smart when starting this project

@fleimgruber
Copy link
Author

fleimgruber commented Oct 6, 2020

I tried to find the integration points for the rect plot, I think I got at least somewhere. It is still ad-hoc and sketchy, but for now I am only interested in getting the test to run - and then see it "fail" in the plot output HTML. With the latest 3d29552 I get this:

AttributeError: 'PlotAccessor' object has no attribute 'rect'

where I am not sure, but suspect this has to do with Pandas upstream?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants