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

hconcat of more than 2 mark_geoshape() causes projection error #962

Closed
sidravi1 opened this issue Jun 22, 2018 · 3 comments
Closed

hconcat of more than 2 mark_geoshape() causes projection error #962

sidravi1 opened this issue Jun 22, 2018 · 3 comments

Comments

@sidravi1
Copy link

Hi,

This is using the US population, engineers, hurricane data in the examples.

import altair as alt
from vega_datasets import data

states = alt.topo_feature(data.us_10m.url, 'states')
pop_eng_hur = data.population_engineers_hurricanes.url

variable_list = ['population', 'engineers', 'hurricanes']

base = alt.Chart(states).mark_geoshape().transform_lookup(
    lookup='id',
    from_=alt.LookupData(pop_eng_hur, 'id', variable_list)
).properties(
    width=100,
    height=100
)

row_chart = [] 
for field in variable_list: 
    field = field+":Q"
    row_chart.append(base.encode(
        color=alt.Color(field,legend=None),
    ).project(
        type='albersUsa'
    ))
    
alt.hconcat(*row_chart, resolve = alt.Resolve(scale=alt.LegendResolveMap(color=alt.ResolveMode('independent'))))

The output looks like this:

image

It works fine when I use .repeat() but I want to be able to arrange the plots as a grid (3 x 3) of plots and want to be able to customize it.

Looks like a vegalite problem to me since the json generated looks consistent for all the sub-maps. Has this been noticed and if so, is there an issue I can track?

@jakevdp
Copy link
Collaborator

jakevdp commented Jun 22, 2018

Thanks – this is a known issue in Vega-Lite: see vega/vega-lite#3544

@sidravi1
Copy link
Author

Thank you. I'll track that issue.

@joelostblom
Copy link
Contributor

@sidravi1 I am going through Altair issues to find those that have been resolved and can be closed. It looks to me like this issue has been solved in the latest version of Altair so I am closing it, but please feel free to reopen and add a comment if there is something you don't think is resolved yet.

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

No branches or pull requests

3 participants