octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: contour implementation


From: Rik
Subject: Re: contour implementation
Date: Sun, 28 Jul 2013 15:08:06 -0700

On 07/25/2013 02:06 PM, Michael Goffioul wrote:
On Thu, Jul 25, 2013 at 4:58 PM, Catalin Codreanu <address@hidden> wrote:
2013/7/25 Rik <address@hidden>:
> 7/25/13
>
> Could someone run the following %!demo block code in Matlab?
>
> clf;
> colormap ('default');
> [~,~,Z] = peaks();
> [Fx, Fy] = gradient (Z);
> surfc (Z, Fx+Fy)
> shading interp
>
> What does this do to the contour lines underneath the surface object?
>
> In Octave it messes up the contour lines because the contours are patch
> objects bundled up into an hggroup.  I'm wondering if we shouldn't limit
> the shading command to apply to just the passed in object and one level of
> children.

Is there a reason to implement the contour lines with patch objects (compatibility maybe)? Maybe they should be implemented with regular lines?
7/28/13

Michael,

I think to be truly compatible we *would* need to implement contours occasionally with line objects rather than patch objects.  The thing is, Matlab itself implements contours using both base objects.  From the sketchy clues in the documentation it appears that when a linespec is given as input the contours are rendered as lines, but otherwise they are rendered as patches.  Patches are nice because they automatically update when the colormap is changed.  For line objects we would need to add a listener.  We already have code for doing things both ways in contour.m (patches) and __ezplot__.m (line objects).  I've got other bits of Octave I want to work on so I think I will leave this alone and just hack shading() to not affect contours.

--Rik

Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]