Hi,
Long-time lurker, first time poster...
In my data exploration, I used to for-loop over a list of columns in a pandas dataframe and produce a simple graph for each column, and also display some stats run on each column. When I used the previous version of Altair, I used to loop and use the display method on a chart to get all the charts to display.
for colname in colList:
c = alt.Chart(data=ag).mark_bar().encode(y='Source', x=colname, color='Source')
c.display()
print(getstats(colname))
However, in 2.0, that's no longer an available method. When i run this without the c.display(), I don't get any charts displayed. I don't want to vconcat because I want to display the stats interleaved. There's much I don't understand about rendering.
Any guidance is much appreciated!
Vinod
Hi Vinod,
The display() method is no longer in Altair because the system by which charts are rendered has been completely reworked since v1.
But you can get this behavior using the IPython.display.display() function; e.g.
from IPython.display import display
display(chart1)
display(chart2)
That works beautifully. Thanks for your answer and more generally for building these tools!
Most helpful comment
Hi Vinod,
The
display()method is no longer in Altair because the system by which charts are rendered has been completely reworked since v1.But you can get this behavior using the
IPython.display.display()function; e.g.