Earlier quoted context omitted.
Curious what other approach you would take to do exploratory data analysis? It's so natural to me I can't think of another way that would be practical to achieve the same workflow.
emacs org mode can do this but is not tied to just python. Anyway, something like this works: #+BEGIN_SRC python :results file import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt fn = 'my_fig.png' plt.plot([1, 2, 3, 2.5, 2.8]) plt.savefig('my_fig.png', dpi=50) return fn #+END_SRC #+RESULTS: [[file:my_fig.png]]
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
plt.plot([1, 2, 3, 2.5, 2.8])
Alright, saving the figure at 50 dpi first
plt.savefig('my_fig.png', dpi=50)
Trying a bit more DPI to see if that makes a difference
plt.savefig('my_fig2.png', dpi=150)
Oh, wrong numbers, forgot that the fourth datapoint was going to signify 100, going back to 50 dpi as well
plt.plot([1, 2, 3, 100, 2.3])
plt.savefig('my_fig4.png', dpi=50)
It seems like your example misses the interactivity.