user3556757
user3556757

Reputation: 3619

Rendering multiple altair charts in a single cell of a jupyter notebook

I see in the troubleshooting guide to Altair that:

'If you are working in a notebook environment, the chart is only displayed if the last line of the cell evaluates to a chart object'

I have a dictionary of several auto-generated altair charts. I want to show in one notebook cell, separately, all the charts I have created. I would like to do something like:

for k in graphs:
   graphs[k].show()   #or the equivalent of 'show this chart'

How can I do the equivalent of this? Currently I can only render a single chart in a cell by evaluating a single chart.

Upvotes: 5

Views: 902

Answers (1)

jakevdp
jakevdp

Reputation: 86463

Use chart.display():

for k in graphs:
   graphs[k].display() 

Upvotes: 7

Related Questions