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

'map_join' fails when map arg is dict: 'map_id' aesthetic is required to show data on map #130

Closed
alshan opened this issue May 5, 2020 · 0 comments
Assignees

Comments

@alshan
Copy link
Collaborator

alshan commented May 5, 2020

UK = {
    'lon': [-2.598046, -2.378320, -2.466210, -3.169335, -1.938867, 
            -0.576562, -0.312890, 0.873632, 0.082617, -2.598046], 
    'lat': [51.030349, 51.797754, 53.945750, 54.561879, 55.193929, 
            53.816229, 52.924809, 52.525588, 51.113188, 51.030349]
}
Germany = {
    'lon': [7.685156, 9.926367, 13.661718, 14.101171, 11.464453, 
            12.870703, 8.564062, 8.651953, 6.806250, 6.938085, 7.685156], 
    'lat': [53.294124, 54.049078, 53.608160, 51.305902, 50.221916, 
            48.679365, 48.007575, 49.485266, 50.024691, 51.552493, 53.294124]
}
France = {
    'lon': [-2.246484, 2.367773, 7.245703, 5.268164, 6.586523, 
            2.895117, 2.279882, -0.532617, -0.356835, -2.246484], 
    'lat': [48.095702, 50.586036, 48.795295, 46.365136, 44.169607, 
            43.663114, 43.088157, 43.631315, 46.516550, 48.095702]
}
polygons = dict(
    lon = UK['lon'] + Germany['lon'] + France['lon'],
    lat = UK['lat'] + Germany['lat'] + France['lat'],
    country = ['UK' for _ in UK['lon']] + ['Germany' for _ in Germany['lon']] + ['France' for _ in France['lon']]
)

population = dict(
    Country = ["UK", "Germany", "France"],
    Population = [66.65e6, 83.02e6, 66.99e6]
)

ggplot() + geom_polygon(aes(fill='Population'), data=population, map=polygons, map_join=['Country','country'], alpha=0.3)

The same issue occurs when using livemap like:

ggplot() + geom_livemap() + geom_polygon(aes(fill='Population'), data=population, map=polygons, map_join=['Country','country'], alpha=0.3)

And another thing: this error message ('map_id' aesthetic is required to show data on map) is obsolete - we have switched to map_join parameter - please update the error message.

alshan added a commit that referenced this issue May 8, 2020
IKupriyanov-HORIS added a commit that referenced this issue May 15, 2020
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

No branches or pull requests

2 participants