pcolor and "interp" [changeset-2]

Ben Abbott bpabbott at mac.com
Thu Sep 25 19:32:05 CDT 2008


On Sep 25, 2008, at 9:12 AM, Ben Abbott wrote:

> On Thursday, September 25, 2008, at 06:41AM, "Ben Abbott" <bpabbott at mac.com 
> > wrote:
>>
>> On Sep 25, 2008, at 4:25 AM, Kai Habel wrote:
>>
>>>
>>> -------- Original-Nachricht --------
>>>> Datum: Thu, 25 Sep 2008 10:00:22 +0200 (CEST)
>>>> Von: Petr Mikulik <mikulik at physics.muni.cz>
>>>> An: Kai Habel <kai.habel at gmx.de>
>>>> CC: Ben Abbott <bpabbott at mac.com>, Octave bugs list <bug-octave at octave.org
>>>>> , "John W. Eaton" <jwe at bevo.che.wisc.edu>
>>>> Betreff: Re: pcolor and "interp"
>>>
>>>>> I have played a bit with gnuplot and it seems the interpolation
>>>>> works
>>>>> only for zvalues (3rd column) and not cvalues (4th column).
>>>>
>>>> You are right. It seems nobody needed this feature until now. I've
>>>> put bug
>>>> report with the patch here:
>>>>
>>>> [ 2127845 ] interpolated pm3d surface colours
>>>> https://sourceforge.net/tracker/index.php?func=detail&aid=2127845&group_id=2055&atid=102055
>>>>
>>>> Please test the patch.
>>>>
>>>> ---
>>>> Petr Mikulik
>>>
>>> Thanks Petr,
>>>
>>> I wont be able to test this until next week. Can someone else give
>>> it a try?
>>>
>>> Kai
>>
>> I'll take a look.
>>
>> Ben
>
> I had some trouble with locally updating my gnuplot  to 4.2.4, so I  
> applied the patch to 4.2.3 instead.
>
> It works for me! (thanks Petr)
>
> I'll take another look at __go_draw_axes__.m to see what needs to be  
> done to properly use the color interpolation.
>
> Ben

As I'm not entirely familiar with why some of the gnuplot settings are  
in place I've made an effort to not modify any behavior unrelated to  
adding interpolation of colors for surface objects.

The reason the surf plots did not display correctly appears to be due  
to a conflict bewtween "depthorder" and "interplation" of colors. To  
resolve the conflict "depthorder" has been replaced by  
"scansautomatic" when interpolation of colors is in effect (I'm no  
expert, but this seemed like the proper choice. Although doing nothing  
looks the same in the examples I tried).

Petr Mikulik has provided patches to gnuplot for 4.2.4 and 4.3.x which  
fixes a "feature" where zdata and cdata were assumed synonymous. I've  
applied the patch to 4.2.3 with no problems.

	Compliments of Petr Mikulik
	[ 2127845 ] interpolated pm3d surface colours
	https://sourceforge.net/tracker/index.php?func=detail&aid=2127845&group_id=2055&atid=102055

For the Octave's purposes, if __gnuplot_version__ > 4.2 the attached  
assumes the patch is in place. To be clear, without the patch the  
color interpolation works for the special case of  
all(cdata(:)==zdata(:)).

I noticed there is a push to release gnuplot 4.3 ... it would be nice  
if this patch could be included ;-)

For __gnuplot_version__ <= 4.2 (and without the patch), the color  
interpolation now works for surf plots. Again, this is because  
all(cdata(:)==zdata(:)). For pcolor plots, viewed from above, the  
topology of the zdata is not seen. Thus the color interpolation can be  
added by telling gnuplot that the zdata = cdata. This is a reasonable  
solution for that special case. In the event the view is not directly  
overhead, then the illusion of color interpolation is disabled.

In order for the pcolor illusion to work, the zrange must be set such  
that the max limit exceeds the top of the cdata. Otherwise the data is  
clipped. As an alternative, if the zrange is not specified then no  
clipping takes place. This is the approach that was taken.

To test this the functionality

	> sombrero
	> shading interp

	> pcolor (peaks ())
	> shading interp

or just

	> demo __go_draw_axes__

Unfortunately, the illusion of the pcolor example is easily revealed  
by rotating the surface object with the mouse, but as changing the  
shading to "flat" or "faceted" returns flattened image, I'm inclined  
to go with it.

Is this acceptable?

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: changeset-__go_draw_axes__.txt
Url: https://www-old.cae.wisc.edu/pipermail/bug-octave/attachments/20080925/663de252/attachment.txt 
-------------- next part --------------





More information about the Bug-octave mailing list