Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

## matplotlib-users

 [Matplotlib-users] Surface Plot From: Ted Kord - 2010-02-06 21:09:49 Attachments: Message as HTML ```Hi I'd like to generate a surface plot using mplot3d. However, Z is not a function of X and/or Y. It's just a set of scalar values. So, the following doesn't work: X = np.arange(2, 102, 2) Y = np.arange(0, 15.15, 0.15) X, Y = np.meshgrid(X, Y) Z = f[2] ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet) Is there a way that I can do this? Thank you. Ted ```
 [Matplotlib-users] Surface Plot From: Ted Kord - 2010-02-06 21:05:33 Attachments: Message as HTML ```Hi I'd like to generate a surface plot using mplot3d. However, Z is not a function of X and/or Y. It's just a set of scalar values. So, the following doesn't work: X = np.arange(2, 102, 2) Y = np.arange(0, 15.15, 0.15) X, Y = np.meshgrid(X, Y) Z = f[2] ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet) Is there a way that I can do this? Thank you. Ted ```
 Re: [Matplotlib-users] Surface Plot From: - 2010-02-08 17:37:21 ```Hey Ted, I don't quite understand how you're getting the Z data below. But if you have 3D data in X, Y, and Z 1D-arrays, the griddata function should work for you. http://matplotlib.sourceforge.net/api/mlab_api.html#matplotlib.mlab.griddata HTH, -paul ------------------------------------- From: Ted Kord [mailto:teddy.kord@...] Sent: Saturday, February 06, 2010 1:05 PM To: matplotlib-users@... Subject: [Matplotlib-users] Surface Plot Hi I'd like to generate a surface plot using mplot3d. However, Z is not a function of X and/or Y. It's just a set of scalar values. So, the following doesn't work: X = np.arange(2, 102, 2) Y = np.arange(0, 15.15, 0.15) X, Y = np.meshgrid(X, Y) Z = f[2] ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet)  Is there a way that I can do this? Thank you. Ted ```
 Re: [Matplotlib-users] Surface Plot From: Ted Kord - 2010-02-08 18:21:15 Attachments: Message as HTML ```Hi Paul This helped immensely. Thanks. Ted ```
 Re: [Matplotlib-users] Surface Plot From: Ted Kord - 2010-02-08 20:00:14 Attachments: Message as HTML ```On 8 February 2010 17:37, wrote: > Hey Ted, > > I don't quite understand how you're getting the Z data below. But if you > have 3D data in X, Y, and Z 1D-arrays, the griddata function should work for > you. > > http://matplotlib.sourceforge.net/api/mlab_api.html#matplotlib.mlab.griddata > > HTH, > -paul > > Hi Paul Is there a way to colour the output? For some reason, the final output is in a single colour even though I've specified cm.jet for the colour map. Regards Ted ```
 Re: [Matplotlib-users] Surface Plot From: - 2010-02-08 21:41:56 Attachments: Message as HTML ```Ted, How does this example run for you? http://matplotlib.sourceforge.net/examples/pylab_examples/griddata_demo.html From: Ted Kord [mailto:teddy.kord@...] Sent: Monday, February 08, 2010 12:00 PM To: Paul Hobson Cc: matplotlib-users@... Subject: Re: [Matplotlib-users] Surface Plot On 8 February 2010 17:37, > wrote: Hey Ted, I don't quite understand how you're getting the Z data below. But if you have 3D data in X, Y, and Z 1D-arrays, the griddata function should work for you. http://matplotlib.sourceforge.net/api/mlab_api.html#matplotlib.mlab.griddata HTH, -paul Hi Paul Is there a way to colour the output? For some reason, the final output is in a single colour even though I've specified cm.jet for the colour map. Regards Ted ```
 Re: [Matplotlib-users] Surface Plot From: Ted Kord - 2010-02-09 20:40:29 Attachments: Message as HTML ```Paul The example works fine and was quite instructive. Thx. Ted On 8 February 2010 21:41, wrote: > Ted, > > > > How does this example run for you? > > > http://matplotlib.sourceforge.net/examples/pylab_examples/griddata_demo.html > > > > *From:* Ted Kord [mailto:teddy.kord@...] > *Sent:* Monday, February 08, 2010 12:00 PM > *To:* Paul Hobson > *Cc:* matplotlib-users@... > *Subject:* Re: [Matplotlib-users] Surface Plot > > > > On 8 February 2010 17:37, wrote: > > Hey Ted, > > I don't quite understand how you're getting the Z data below. But if you > have 3D data in X, Y, and Z 1D-arrays, the griddata function should work for > you. > > http://matplotlib.sourceforge.net/api/mlab_api.html#matplotlib.mlab.griddata > > HTH, > -paul > > > > Hi Paul > > > > Is there a way to colour the output? For some reason, the final output is > in a single colour even though I've specified cm.jet for the colour map. > > > > Regards > > > > Ted > > > ```