Bug for combined plot of pcolor and contour
David Bateman
adb014 at gmail.com
Thu Dec 13 17:20:22 CST 2007
Kai Habel wrote:
> John W. Eaton schrieb:
>> On 13-Dec-2007, Kai Habel wrote:
>>
>> | With a today's checkout I see the following problem:
>> |
>> | octave:19> [x,y,z]=peaks(10);
>> | octave:20> pcolor(x,y,z);shading flat;hold on
>> | octave:21> contour(x,y,z,'k')
>> | line 10026: 2D plots cannot color by Z value; please use splot
>> | instead
>> |
>> |
>> | gnuplot> -3 -3 0 6.67128029671744e-05 -2.33333333333333 -3 0
>> | 0.00126982402106582 -1.66666666666667 -3 0 0.00529256169959581 -1 -3 0
>> | -0.0298708013732747 -0.333333333333333 -3 0 -0.180932327666405
>> | 0.333333333333333 -3 0 -0.24653656063106 1 -3 0 -0.109959383327874
>> | 1.66666666666667 -3 0 -0.0167978249291278 2.33333333333333 -3 0
>> | -0.000808320501125711 3 -3 0 -5.86418787258953e-06
>> | ^
>> | line 10026: invalid command
>>
>> Did this work in any previous version of Octave?
>>
>> jwe
>>
>>
> Hmm, good question. Before I have implemented contourf, I think I have
> seen examples using the combination above. But I do not remember if this
> was with a pcolor function from octave-forge or octplot. I don't know.
>
> Kai
I think the attached patch sort of addresses this. At least the surface
and the contour patches are plotted. However, there is a remaining issue
in that the contours are there but gnuplot always puts the pm3d colored
surface on top. Petr, do you have the key to fixing this?
To prove that the plots are there I ran
[x,y,z]=peaks(10);
h1 = pcolor(x,y,z);shading flat;hold on;
[clev,h2] = countor(x,y,z,5);
for i = 1:length(h2)
set (h2(i), "zdata", ones (size(get (h2(i), "xdata"))), "edgecolor",
"black");
endfor
You can then see the contours when you rotate the plot or when you do
set (h1, "facecolor", "none");
Kai, note that you can't currently pass "k" to contour, as additional
arguments aren't treated..
D.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch4
Url: https://www.cae.wisc.edu/pipermail/bug-octave/attachments/20071214/a3c2c6ca/attachment-0001.ksh
More information about the Bug-octave
mailing list