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

geom_polygon aes group #6

Closed
stoneyv opened this issue May 22, 2017 · 2 comments
Closed

geom_polygon aes group #6

stoneyv opened this issue May 22, 2017 · 2 comments
Labels

Comments

@stoneyv
Copy link

stoneyv commented May 22, 2017

I attempted to use the geom_polygon method by adapting a ggplot2 geom_polygon example. I omitted the group aesthetic which is not implemented in plotnine. I want to adapt some of my R ggplot2 geo visualization code, but I need to understand plotnine's implementation of geom_polygon first. I can contribute some geo examples to plotnine. Here is a notebook that I saved as a gist.
https://gist.github.com/stoneyv/df80e7cdfcd64ad6199c6faccccd215d
I pip installed source cloned from master into a conda virtual environment. I am able to successfully produce example visualizations from the notebooks in the plotnine-examples repo. I will try and use the debugger pdb or pudb to step through plotnine this week.

@has2k1
Copy link
Owner

has2k1 commented May 22, 2017

@stoneyv, You do not need to call the draw method, just print the plot or make sure it is the last object in the cell. And, all geoms accept the group aesthetic.

This should work for you

(ggplot(aes('x', 'y' )) +
 geom_polygon(datapoly_df, aes(fill='value', group='iid')))

And, you should have this instead

'iid': np.repeat(ids, 4),

@has2k1
Copy link
Owner

has2k1 commented May 22, 2017

About geo stuff. I am thinking about it. I have an implementation (written a while back) that plots a geopandas dataframe, but I do not quite like it.

has2k1 added a commit that referenced this issue May 22, 2017
@has2k1 has2k1 closed this as completed in 565ad5e May 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants