help-octave
[Top][All Lists]
Advanced

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

Re: How do you get "indexed contour" / thick contour at intervals among


From: Ben Abbott
Subject: Re: How do you get "indexed contour" / thick contour at intervals among thin contours?
Date: Mon, 26 Aug 2013 07:56:44 -0400

On Aug 26, 2013, at 5:15 AM, rmt1 wrote:

> I've kept researching and reverse engineering this from other help forum
> solutions, in this case,
> http://octave.1599824.n4.nabble.com/contour-plot-still-need-help-td1628551.html#a1628552.
> My code now does provide a bolded contour to mark intervals in addition to
> fine-lined smaller intervals. Problem is the bolded contour does not match
> up in value with those divisions of 60 in the contourf(X,Y,Z,60). How do I
> force the 60 to match the v vector?
> 
> core=2.0;increment=0.1;
> load XYZ;x=XYZ(:,1);y=XYZ(:,2);z=XYZ(:,3);
> [X,Y]=meshgrid(-core:increment:core,-core:increment:core);
> Z=griddata(x,y,z,X,Y);
> v=[-3.00:0.1:+3.00];
> hold on;
> [C,h]=contourf(X,Y,Z,60);
> [c,h]=contour(X,Y,Z,v,'LineWidth',2.0,'k-');
> clabel (c, h, v, "fontsize", 12);
> 
> <http://octave.1599824.n4.nabble.com/file/n4656808/contourproblem2.jpg> 

The call to contour() places a second plot over the first (the first one 
includes the number of levels).

Try ...

        [C, h] = contourf (X, Y, Z, 60);
        [c, h] = contour (X, Y, Z, 60, "LineWidth", 2.0, "k-");

... or ...

        v = linspace (-3, 3, 60);
        [C, h] = contourf (X, Y, Z, v);
        [c, h] = contour (X, Y, Z, v, "LineWidth", 2.0, "k-");

Ben



reply via email to

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