vega / vega-lite

A concise grammar of interactive graphics, built on Vega.
https://vega.github.io/vega-lite/
BSD 3-Clause "New" or "Revised" License
4.69k stars 613 forks source link

Omitting axis labels on portions of Facet charts #9477

Open claysmyth opened 1 day ago

claysmyth commented 1 day ago

What is your suggestion?

It wold be amazing if the styling of Facets charts could be customized to only show axis labels on specified portions of the facet. This is a common technique in scientific manuscripts to clean up multi-panel figures and reduce clutter and redundancy.

To my understanding, it is quite difficult to have variable axis labeling (or remove axis entirely) from subcomponents of the Facet chart.

The screenshot below was developed using altair, but building each suplot individually and aggregating using a For loop. Note how the x-ticks are only on the bottom right plots, and the y-axis ticks are only on the top left plot, to minimize redundancy.

Image

Have you considered any alternative solutions?

Yes, you can build each subcomponent individually and create a faceted chart by combining the individual subcomponents with | or &. The suggestion is to simplify this approach.

joelostblom commented 1 day ago

Thanks for the suggestion! This type of change would need to happen in the underlying Vega-Lite library before it can be available in Altair so I have moved your issue over to that repo.

domoritz commented 20 hours ago

The workaround for now is to use concatenation rather than faceting. Vega-Lite would need some more optimizations to support these kinds of customizations conveniently.