[Matplotlib-users] Where is transform.xy_tup?

2010-06-09 Thread Jon Olav Vik
I'm trying to make a big plot with smaller insets. I would like to specify the new axis rectangle in terms of data coordinates from the original plot. This page mentions an .xy_tup() method of Transform objects: http://www.scipy.org/Cookbook/Matplotlib/Transformations?highlight=%28xy_tup%29 ...b

Re: [Matplotlib-users] imshow seems to fail on some (int16?) arrays

2010-05-06 Thread Jon Olav Vik
Jon Olav Vik writes: > Antony Lee writes: > It happens that this array has dtype=int16, and imshow's doc says that > it only accepts float arrays Having looked at the example you sent me, I think what you want is .astype(): a = np.array([[24695, 19052, 0], [24565,

Re: [Matplotlib-users] Some questions about mplot3D

2010-05-06 Thread Jon Olav Vik
Pau writes: > I am trying to generate a 3d-plot > I have two functions that depend on two free parameters, > T_g = (5./512.) * Light_c**5 * a**4 / (Grav_G**3 * m**3) > T_d = 3.e4 * sqrt(a**3/ (Grav_G * m**2.)) > These are given in units of time, so that I would like axis y to be > "time", runni

Re: [Matplotlib-users] imshow seems to fail on some (int16?) arrays

2010-05-06 Thread Jon Olav Vik
Antony Lee writes: > I'm trying to plot a grayscale (nonzero) array as an image -- so it's basically plt.imshow(array).  However, this pops up (after plt.show()) a completely black image.  It happens that this array has dtype=int16, and imshow's doc says that it only accepts float arrays, th

Re: [Matplotlib-users] Speaking of 'many' ... line collections? (was: Put many graphs...)

2010-03-30 Thread Jon Olav Vik
David Carmean writes: > At what point is a line Collection useful? More efficient for adding or manipulating many lines in one go. It saved my life (some hours of it, anyway) the other day: http://article.gmane.org/gmane.comp.python.matplotlib.general/22149 --

Re: [Matplotlib-users] Alpha compositing of ~60000 line p lots takes forever

2010-03-16 Thread Jon Olav Vik
Jae-Joon Lee writes: > If you're plotting lots of lines, do not use plot but use > LineCollection instead. > > http://matplotlib.sourceforge.net/examples/api/collections_demo.html > > http://matplotlib.sourceforge.net/api/ collections_api.html#matplotlib.collections.LineCollection > > Here is

[Matplotlib-users] Alpha compositing of ~60000 line p lots takes forever

2010-03-16 Thread Jon Olav Vik
I want to overlay many line plots using alpha transparency. However, plotting them in Matplotlib takes about O(n**2) time, and I think I may be running into memory limitations as well. As a simple benchmark, I used IPython to run alco.ipy (below), which runs alco.py for an increasing number of