# 3D plot experiments

4 messages
Open this post in threaded view
|

## 3D plot experiments

 Hi, I have written some code which generates 3D plots, this was inspired by the 3D axes code posted recently.  The basic idea is that 2D Artist elements have their 'draw' method subverted to generate the projected 3D coordinates. The plot is interactive and allows panning and tilting of the graph by pressing and holding mouse-2. I am new to this list, and was wondering where I should post the code (it consists of two modules). This example code here generates the attached png: def run1():      delta = 0.025      x = y = p.arange(-3.0, 3.0, delta)      X, Y = p.meshgrid(x,y)      Z1 = p.bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)      Z2 = p.bivariate_normal(X, Y, 1.5, 0.5, 1, 1)      Z = Z2-Z1      X = X * 10      Y = Y * 10      Z = Z * 500      fig = p.figure()      ax = mplot3d.Axes3D(fig)      ax.plot_surface(X,Y,Z, div=10)      ax.set_xlabel('X')      ax.set_ylabel('Y')      ax.set_zlabel('Z')      fig.add_axes(ax)      p.savefig("surface.png", dpi=40)      p.show() surface.png (60K) Download Attachment
Open this post in threaded view
|

## Re: 3D plot experiments

 >>>>> "John" == John Porter <[hidden email]> writes:     John>      fig = p.figure() ax = mplot3d.Axes3D(fig) Very nice screenshot!! -- did you intend to the mplot3d module so we could test ourselves? JDH ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf_______________________________________________ Matplotlib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/matplotlib-users