## matplotlib-devel

 [matplotlib-devel] Proposal for a new example of a polar 3d plot From: Jeff Klukas - 2010-03-18 19:51:23 Attachments: polar3d_demo.py Attached and also pasted below is an example which creates a 3d figure using polar coordinates rather than the x and y. The solution was created by Armin Moser when I posted a question to the users list. There are currently no examples of polar coordinates in 3D available. Any objections to adding this to mpl_examples/mplot3d? Thanks, Jeff || Jeff Klukas, Research Assistant, Physics || University of Wisconsin -- Madison || jeff.klukas@... | jeffyklukas@... | jeffklukas@... || http://www.hep.wisc.edu/~jklukas/ ---------------------------------------- import matplotlib.pyplot as plt import numpy as np from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm fig = plt.figure() ax = Axes3D(fig) # create supporting points in polar coordinates r = np.linspace(0, 1.25, 50) phi = np.linspace(0, 2*np.pi, 50) R, PHI = np.meshgrid(r,phi) # transform them to cartesian system X,Y = R * np.cos(PHI), R * np.sin(PHI) Z = ((R**2 - 1)**2) ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet) ax.set_zlim3d(0, 1) ax.set_xlabel(r'$\phi_\mathrm{real}$') ax.set_ylabel(r'$\phi_\mathrm{im}$') ax.set_zlabel(r'$V(\phi)$') ax.set_xticks([]) plt.show() ---------------------------------------- 

## Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks