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

Is it possible to concatenate repeated charts? #2180

Closed
taralloc opened this issue May 27, 2020 · 2 comments
Closed

Is it possible to concatenate repeated charts? #2180

taralloc opened this issue May 27, 2020 · 2 comments

Comments

@taralloc
Copy link

Is it possible to concatenate repeated charts? This code, for example, does not work:

import altair as alt
from vega_datasets import data

iris = data.iris.url

chart1 = alt.Chart(iris).mark_point().encode(
    alt.X(alt.repeat("column"), type='quantitative'),
    alt.Y(alt.repeat("row"), type='quantitative'),
    color='species:N'
).repeat(
    row=['petalLength', 'petalWidth'],
    column=['sepalLength', 'sepalWidth']
)
chart2 = alt.Chart(iris).mark_point().encode(
    alt.X(alt.repeat("column"), type='quantitative'),
    alt.Y(alt.repeat("row"), type='quantitative'),
    color='species:N'
).repeat(
    row=['petalWidth', 'petalLength'],
    column=['sepalWidth', 'sepalLength']
)

alt.hconcat(chart1,chart2).show()

because it throws this error

JavaScript Error: Duplicate scale or projection name: "child__row_petalWidthcolumn_sepalWidth_x".

@joelostblom
Copy link
Contributor

@taralloc I am going through Altair issues to find those that have been resolved and can be closed. Since this is something that needs to be fixed in Vega-Lite rather than in Altair, would you be able to close this issue or add a comment if there is something you don't think is resolved yet on the Altair side of things?

The relevant vegalite issues are vega/vega-lite#5261 and vega/vega-lite#4680 (although they are not exactly what you are asking here, I reading them and then opening a new Vega-Lite issue)

@taralloc
Copy link
Author

OK, I'll close this issue. What I wanted to do is still not possible, but it is due to vega-lite.

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

2 participants