`Only chart objects can be used in ConcatChart` error when `concat` subcharts
See original GitHub issueAs per https://github.com/altair-viz/altair/issues/1925#issuecomment-669238407 when I try to horizontally alt.concat(three_subcharts)
, Altair raises ValueError: Only chart objects can be used in ConcatChart
. I find this error confusing, because each of the three subcharts do individually plot correctly.
Code:
brush = alt.selection(type='interval', resolve='global')
three_subcharts = []
hyperparams = [('Learning Rate', "log"), ('L2 Penalty', "log"), ('Dropout', "linear")]
for hyperparam, scaling in hyperparams:
color = alt.condition(brush, alt.ColorValue('red'), alt.ColorValue('gray'))
chart = alt.Chart(data).mark_circle().encode(
alt.X(hyperparam, type='quantitative', scale=alt.Scale(type=scaling)),
alt.Y("Score", type='quantitative'),
row=alt.Row("Metric", type='nominal'),
color=color,
tooltip=['Learning Rate', 'L2 Penalty', 'Dropout']
).add_selection(
brush
)
three_subcharts.append(chart)
print(three_subcharts) # prints: [alt.Chart(...), alt.Chart(...), alt.Chart(...)] (each plots correctly as well)
alt.concat(three_subcharts) # ValueError: Only chart objects can be used in ConcatChart.
Data is in long format:
Dropout | Learning Rate | L2 Penalty | Metric | Score |
---|
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
altair.ConcatChart — Altair 4.2.0 documentation
A chart with horizontally-concatenated facets Mapping(required=[concat]) ... only the specified width and height values for the sub-view will be used.
Read more >altair.ConcatChart — Altair 4.1.0 documentation
A chart with horizontally-concatenated facets Mapping(required=[concat]) ... This object is completely ignored by Vega and Vega-Lite and can be used for ...
Read more >altair line up concatenated charts into a grid - You.com
The columns argument can be similarly specified for concatenated charts in alt.concat() and repeated charts alt.Chart.repeat() . Open side panel.
Read more >Denotational Translation Validation The Harvard ... - CORE
with all of these positive results, translation validators that can be applied real-world compilers have not been available.
Read more >lstdrvrs.dtx - CTAN
It is just what I % remember of the past. % \begin{macrocode} \lst@definelanguage[R/2 4.3]{ABAP}[R/2 5.0]{ABAP}% {deletekeywords={function,importing ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
alt.concat
does not accept a single argument containing a sequence; it accepts multiple arguments each of which is a chart. Try this instead:or, equivalently,
Thanks for the update @joelostblom!