After letting it sit, I'm not sure that my patch above is a good idea anymore. While it would be useful, it also adds substantial complexity to ob-python. For now, I think I prefer to keep ob-python leaner, so am going to hold off on this. An alternative approach is to have the user handle graphics and dataframes via noweb or header arguments. I've added a couple examples on worg, demonstrating how to use noweb to insert boilerplate code for handling matplotlib figures and pandas dataframes [0,1]. Additionally, I'm attaching a small patch to make it easier to handle graphics/dataframes via the :return header argument, as an alternative to noweb. The patch includes a couple examples in ORG-NEWS illustrating this. I'll wait a week or so for comments before merging this new, more limited patch into master. [0] https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-python.html [1] worg commit 59e320ad Cheers, Jack