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)
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  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().
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.
On 08/01/2010 07:35 AM, Benjamin Root wrote:
On Sun, Aug 1, 2010 at 9:55 AM, Tom Arens <takker@…380… > <mailto:takker@…380…>> wrote: