-
Notifications
You must be signed in to change notification settings - Fork 782
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
added example from vega-lite: one dot per zipcode #516
Conversation
You could get around that by passing the data url rather than the dataframe, I think: replace |
Also, I think it looks a bit better with |
Also I think the plot is more impressive if you leave off the background states and only plot the points. |
@jakevdp I went ahead and put the .url after the data as you suggested and it works, but why? |
Is there a way to make this layered plot interactive, |
per the comments on this merge request.
@eitanlees , thanks for catching that, |
The maximum lines issue is because if you make a chart with a dataframe, it actually embeds the data within the plot spec, which is then included in the notebook. (you can see this by calling By contrast, if you specify the data by url, the dataset itself is not embedded in the spec, only the URL reference to the dataset: the dataset is then downloaded at render time, which is much more efficient in terms of displaying plots in the notebook. This large dataframe thing presents some real usability issues (it's easy to accidentally make gigantic notebooks, particularly when building multiple plots). There are potential solutions down the line—vega-lite has the concept of datastores with named datasets that we may be able to take advantage of—but for now we've found that raising an error if the dataset is too big is the best way to keep users from accidentally shooting themselves in the foot. |
Not yet: vega/vega-lite#3306 |
Looks good. It would be simpler to put the |
per Jake's comment
|
||
states = alt.UrlData(data.us_10m.url, | ||
format=alt.TopoDataFormat(type='topojson', | ||
feature='states')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
states data is not used anymore
Thanks! |
Note,
I had to have the row in here:
zipcodes = zipcodes[5000:10000]
to limit the amount of data or I get the error:
MaxRowsError: The number of rows in your dataset is greater than the max of 5000
and searching in the repo I don't see a way to temporarily lift that restriction.