question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

facet_wrap in altair?

See original GitHub issue

I’d like to suggest the equivalent of ggplot2’s facet_wrap in altair.

Right now, it’s possible to have facets plot in a single column (.facet(row) or in a single column (.facet(column), or even as a grid, but often, it’s useful to just lay out a ribbon of charts one after another (not necessarily mapping a column or row to variables in the data frame) using more than one column/row. In other words, those that line up in a single column/row don’t mean anything in particular.

I asked this question on SO first to see if there was already a way to do this in altair, but it seems rather involved (i.e. not as slick as facet_wrap):

https://stackoverflow.com/a/50166485/2320823

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
jakevdpcommented, Dec 17, 2019

This is now part of Altair as of version 3.0. For example:

import altair as alt
from vega_datasets import data

source = data.population.url

alt.Chart(source).mark_area().encode(
    x='age:O',
    y=alt.Y('sum(people):Q', title='Population'),
    facet=alt.Facet('year:O', columns=5)
).properties(
    width=100,
    height=80
)

visualization - 2019-05-29T201526 047

4reactions
jakevdpcommented, Mar 20, 2019

FYI, vega-lite has added facet wrap: vega/vega-lite#4541

It will be part of the 3.0 release. Once that is out, we’ll make an Altair 3.0 release that will include facet wrap.

Read more comments on GitHub >

github_iconTop Results From Across the Web

multiple column/row facet wrap in altair
Creating a facet_wrap() style grid of plots · First, create a base Altair chart · Use transform_filter() to filter your data into multiple ......
Read more >
altair.Facet — Altair 4.2.0 documentation
Facet. Aggregation function for the field (e.g., "mean" , "sum" , "median" , "min" , "max" , "count" ).
Read more >
Python – multiple column/row facet wrap in altair – iTecNote
In ggplot2 , it's easy to create a faceted plot with facets that span both rows and columns. Is there a "slick" way...
Read more >
altair line up concatenated charts into a grid
I'd like to suggest the equivalent of ggplot2's facet_wrap in altair. Right now, it's possible to have facets plot in a single column...
Read more >
How to use to facet_wrap in ggplot2
facet_wrap creates small multiple charts in ggplot2 ... The small multiple chart is a chart where a data visualization is repeated in several ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found