On 08/01/2010 07:35 AM, Benjamin Root wrote: > On Sun, Aug 1, 2010 at 9:55 AM, Tom Arens <tak...@gmx.de > <mailto:tak...@gmx.de>> wrote: > > Hello everyone, > > does anybody know why the contour3D function has a fixed set of levels? > > contour3D(X, Y, Z, levels=10, **kwargs) > > I want to plot only one line for one level. With "contourf" it works: > > > > from mpl_toolkits.mplot3d import axes3d > import matplotlib.pyplot as plt > > fig = plt.figure() > ax = axes3d.Axes3D(fig) > X, Y, Z = axes3d.get_test_data(0.05) > cset = ax.contourf(X, Y, Z, 0) # doesn't work with contour > ax.clabel(cset, fontsize=9, inline=1) > > plt.show() > > > > Many greetings, > Tom > > > Hmm, interesting. Looking at the contour3d call signature, it appears > that 'levels' was put into the call signature to basically remove that > keyword argument from the kwargs that get passed down to the 2-d version > of contour. It is never used in the body of contour3d(). > > I would guess that this is might be a remnant of some original code that > actually used the levels parameter. Simply removing levels=0 from the > call signature seems to fix it (and passing [0] to levels as well since > it expects a sequence). > > As a matter of consistency, I think the call signature should be changed > to better match the call signature for contourf3d() and for the 2-d > version of contour().
Ben, Good idea, go ahead. The contourf3d docstring can also be modified to match your change to the contour3d docstring. I would consider all this as bug-fixing, so it can go in branch and trunk. Thanks. Eric > > Ben Root > ------------------------------------------------------------------------------ The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://p.sf.net/sfu/dev2dev-palm _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users