|
From: Benjamin R. <ben...@ou...> - 2012-08-03 02:32:51
|
On Thursday, August 2, 2012, surfcast23 wrote: > > Okay thank you! The Matlab code I am basing this on takes arrays of > different > shapes with different sized elements ie > x = 1 512 > y = 101 1 > and I guess automatically makes the the same shape. Can you point me in the > direction of documentation that will explain how I can do this in Python? > > Ok, I just double-checked the source for plot_wireframe(). It does not perform any broadcasting (which I consider to be a bug). Until it is fixed, you will have to do the broadcasting yourself: X= np.ones((1, 45)) Y= np.zeros((32, 1)) x, y = np.broadcast_arrays(X, Y) Which produces x and y with the same shapes, and their values duplicated in the direction the array was "expanded". Pass those into plot_wireframe(). Ben Root |