Bug for combined plot of pcolor and contour
John W. Eaton
jwe at bevo.che.wisc.edu
Fri Dec 14 11:32:16 CST 2007
On 14-Dec-2007, David Bateman wrote:
| 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");
I applied this patch and checked it in.
Thanks,
jwe
More information about the Bug-octave
mailing list