I find matlab's behavior wrt contour groups bizarre and inconsistent
and so am asking for help in how people think that this feature
should be implemented. The issue is that at the moment matlab uses
two different fashions to represent contours depending on what
function created them. The first representation is a set of patch
much as Octave currently uses, and was the only means of
representing contours in matlab V6. This format is still used by all
3D contouring like contour3, meshc, surfc even in matlab 2008a. The
second means is a "contourgroup" hggroup that encapsulates the
patches in a single object with callbacks to alter them.
I see no reason not to have everything as a contourgroup, and the
only change to a contourgroup to support 3D contouring would be an
additional pair of properties like
addproperty ("zlevel", hg, "double", 0);
addproperty ("zlevelmode", hg, "radio", "{none}|level|manual",
"none");
where if zlevelmode is "none" we have a 2D plot, if its "level" the
contours are plotted as the Z value of the contour itself an if
"manual" then "zlevel" can be used to force a particular contour Z
value.
I hesitate to make a change like this as I imagine that the reason
the 3D contouring is not a contourgroup in matlab is purely that is
was a dropped feature in the rush to a release and hasn't since been
addressed by mathworks. So I fully believe that contour3, meshc and
surfc will eventually also use contour groups instead of a set of
patches in a future version of matlab. Therefore any changes we make
here are certainly going to be matlab incompatible, and so that
makes me hesitate to do this.
However, if we choose to keep the 3D contours in Octave to be
compatible with current versions of matlab there is likely to be
significant code duplication in any changes I make.
So, what do people think we should go for
1) Full matlab compatibility, accept the inconsistency of 2D vs 3D
contouring and the code duplication in Octave, or
2) A matlab incompatible change that allows contourgroups to also
work for 3D contours?
I have a preference for 2) as it'll probably be simpler in the end..
Cheers
David