-
Notifications
You must be signed in to change notification settings - Fork 26
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
vba_chroropleth does not allow None
#50
Comments
Can you share here some reproducible example of this bug? I'm not really sure that I follow. I tried to run this function removing both arguments and the results were generated as follows:
I also reproduced the first example of the doc:
And the map was generated: |
Even changing to
Both arguments of the function the same graphs are generated. |
I think @darribas meant if you leave out the y variable or set |
Thanks for this, my bad for very poorly communicating my point. Yes, it's what @slumnitz suggests. With the following pre: from libpysal import examples
import geopandas as gpd
import matplotlib.pyplot as plt
import matplotlib
import numpy as np
from splot.mapping import vba_choropleth
link_to_data = examples.get_path('columbus.shp')
gdf = gpd.read_file(link_to_data) I'm proposing we allow the user to pass: fig, _ = vba_choropleth('HOVAL', gdf)
plt.show() And obtain the same we'd get with: gdf.plot(column='HOVAL', scheme='quantiles') I think that'd make My only concern on this, on a second reflection, is whether we should do that in What do you think @slumnitz and others? |
Got it, @darribas ! Thanks for the reproducible example! Well, I think that what would make more sense, in this case, is your "swiss-army knife" suggestion, since I believe that a 'vba' mapping function should expect to receive a value for the alpha itself... that's just my humble opinion. In addition, we were thinking about building some kind of 'general' choropleth explorer interactively with ipywidgets taking into advantages the classification of mapclassify. Something that would look like this: In this case, I think this issue would be addressed in a certain way if we manage to add some feature like this, what do you think and others? |
Sounds great! I'd be game for leaving Just out of curiosity, how are you building the explorer in the image? Having the swiss-army knife would come in handy for that too, no? |
Yes, I agree with your first point! I think would make more sense to build this under |
In terms of the explorer graphic renan shared, i think that should stay in mapclassify as the intention originally, was to provide a simple interface to explore the classifiers visually and mimic colorbrewer. We repurposed it when building the old pysal.contrib.viz and I lost the original interface code since then. Of course that doesn't preculde doing a more comprehensive thing for splot. I just want to make sure the lightweight thing for mapclassify doesn't get lost in the shuffle. |
Yes, I agree the interactive from the screenshot fits in mapclassify better. What I was suggesting was a method that wraps around all the choropleth functionality we have between |
I like the idea of also including a |
One more from playing with this for a workshop this past week. It seems the function throws an error if alpha_mapclassify and rgb_mapclassify don't have a value (the default None don't seem to work). I picked this up from the example notebook, where everything is passed and it works great, but from the docs, it seems to imply that it'd be just fine by passing the variables. Is that the case? If so, happy to open up a separate issue.
referred to in #45
The text was updated successfully, but these errors were encountered: