Hi,
I have a question: Is there a way with matplotlib to see influence of
code changes on the plot without explicitly recompiling?
My workflow looks like this: I'm writing single files for plots in
Eclipse with pydev. I normally copy/paste sections from previous
figures. I don't want to do this in ipython, because even though I might
end up with a nice figure, there is no clean way to maintain the code
for later recompilation.
So what I do:
1) Compile => matplotlib plot opens
2) adjust code (for example spacing, plot-range...)
3) Compile
But every time a new plot opens. So is there a way of getting the plot
into the same window every time? And it would be even nicer if I could
just change a number in the code, and the plot updates by itself.
Hi,
I have a question: Is there a way with matplotlib to see influence of
code changes on the plot without explicitly recompiling?
Hello
Using bpython is a nice trick to achieve this :
Bootstrap in bpython :
http://bpaste.net/show/31823/
once sastified either F8 to share, or Ctrl+S to save
once wanting to make a new session, make a minimal file with all you need and
bpyton -i bootstrap.py
bpython -i => interactive you are given the conctrol back once the
file is loaded.
use :
plt.show() once and only once to show the canvas.
plt.clf() : clear figure
plt.interactive(True) : dont let python tk (or whatever GUI fw you
use) take the focus
plt.draw() to refresh the canvas
Ctrl+R if you made a mistake, it will delete last line
advantages :
* completion ;
* help is included
* saving make stuff faster;