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
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
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()
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
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:
===
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
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)
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
"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
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
-
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
11 matches
Mail list logo