Re: [Matplotlib-users] bisecting triangulation

2013-07-02 Thread zetah
On вторник, 02 јули 2013 at 11:04 AM, Ian Thomas wrote: > >You need to use a matplotlib.tri.Triangulation (your use of triplot does >this for you behind the scenes anyway), something like: > >import matplotlib.tri as mtri >triang = mtri.Triangulation(xpoints, ypoints) > >Now triang.triangles is an

[Matplotlib-users] bisecting triangulation

2013-07-01 Thread zetah
Hi, I have set of points in a plane and make triplot: subplot(121) plot(points[:,0], points[:,1], 'o') title('Set of points') subplot(122) triplot(points[:,0], points[:,1]) title('Triangulation') result: http://i.imgur.com/1LG4fxC.png Does anyone know how to extract just

[Matplotlib-users] Single colorbar for two overlaid contourf plots

2013-06-13 Thread zetah
Hi, in this example: import numpy as np import matplotlib.pyplot as plt arr = np.random.random((10, 10)) plt.contourf(arr, 10) plt.contourf(arr, 10, cmap='coolwarm', levels=np.arange(0, 1, .2), alpha=.5) plt.colorbar() plt.show()

Re: [Matplotlib-users] Using colorbar in animation

2013-05-29 Thread zetah
I got a revelation - as colorbar wasn't changing with animation iteration I put it in init() function and draw the first frame there. Voila :) -- Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET G

[Matplotlib-users] Using colorbar in animation

2013-05-29 Thread zetah
Hi, I'm stacked again, sorry, but I couldn't find any pointers with my google. In my filled contour animation I thought to use colorbar instead complicating with contour labeling, which just makes animation too full. So after reading the docs, I used something like this simplified code: ===

Re: [Matplotlib-users] Animation module: every loop takes more and more time

2013-05-29 Thread zetah
Benjamin Root wrote: >The init() function only happens once. So, each call to >ax.contourf() just >simply adds more contours on top of the previous (you just don't >see them >because you don't have masked regions or transparency). I would >suggest >doing an ax.cla() in the animate() function b

[Matplotlib-users] Animation module: every loop takes more and more time

2013-05-29 Thread zetah
Please consider this small script: import numpy as np import matplotlib.pyplot as plt from matplotlib import animation from time import time def init(): return ax.cla() def animate(i): global t r = np.random.random(10)

Re: [Matplotlib-users] Memory usage when plotting sequental figures

2013-05-28 Thread zetah
Albert Kottke wrote: > >I had this problem as well. I think my solution was to tell the >garbage collector to collect. > >import gc >import numpy as np >import matplotlib.pyplot as plt > >def draw_fig(arr, fn): >fig = plt.figure() >ax = fig.add_subplot(111) >ax.contourf(arr) >plt.s

Re: [Matplotlib-users] Memory usage when plotting sequental figures

2013-05-28 Thread zetah
"zetah" wrote: > >Eric Firing wrote: >> >>plt.close(fig) # that should take care of it > >Thanks for your quick reply. > >I tried before posting `plt.close()` and it didn't work, but also >`plt.close(fig)` doesn't change memo

Re: [Matplotlib-users] Memory usage when plotting sequental figures

2013-05-28 Thread zetah
Eric Firing wrote: > >plt.close(fig) # that should take care of it Thanks for your quick reply. I tried before posting `plt.close()` and it didn't work, but also `plt.close(fig)` doesn't change memory pumping with every loop. BTW, I'm on Windows with Matplotlib 1.2.1 -

[Matplotlib-users] Memory usage when plotting sequental figures

2013-05-28 Thread zetah
Hi, if I use something like this: == import numpy as np import matplotlib.pyplot as plt def draw_fig(arr, fn): fig = plt.figure() ax = fig.add_subplot(111) ax.contourf(arr) plt.savefig(fn) if __name__ == '__main__': for i i