bugGNU Octave - Bugs: bug #43032, surfc does not make contours...

 
 

bug #43032: surfc does not make contours visible

Submitter:  None
Submitted:  Wed 20 Aug 2014 01:55:39 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Wont Fix Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 05 Feb 2019 07:37:35 PM UTC, comment #8: 

This bug is old, and even Matlab behavior has changed and doesn't work with the supplied code.  An answer for how to do this in Matlab is here (https://stackoverflow.com/questions/8054966/matlab-how-to-change-contourf-plots-location-on-z-axis#8055468).

The code works in Octave as well.  Alternatively, use


set (h(2), "zlevel", -8);


The equivalent property is a hidden one in Matlab called ContourZlevel.

Also, could use an hgtransform object.

Rik <rik5>
Group administrator
Fri 16 Dec 2016 06:53:52 PM UTC, comment #7: 

This issue is (at least partly) still present in Octave 4.2.0.

When I run the demo script (from comment #3), then I still do not see the contour lines in the plot. After adding the first code line from comment #4, I then see the contour lines. But they are not properly colored as in the Matlab figure (as in comment #3).

Hartmut <hardy>
Sun 24 Aug 2014 06:40:10 PM UTC, comment #6: 

Unfortunately, I think it is going to be a long while before the 4.2 release which would include the fix.  Release 4.0 is the upcoming release and it is  dedicated to the GUI.  The GUI will become the default interface and right now bug fixing is targeting the GUI, rather than the other parts of Octave.  I think perhaps 6 months to 4.0 and maybe 1.5 years to 4.2, unless there is an uptick in funding or volunteers.  The 4.2 release is going to showcase the classdef Object Oriented programming interface as its major new feature.

Rik <rik5>
Group administrator
Sun 24 Aug 2014 06:28:28 PM UTC, comment #5: 

So one can say, this problem is fixed more or less in octave 4.x. I am very excited for octave 4.
Do you have a clue when this will be (more or less) stable?
At least stable enough for debian testing or unstable?
regards,

Anonymous
Sun 24 Aug 2014 06:07:04 PM UTC, comment #4: 

Octave is still not 100% compatible with Matlab and it uses a different method for setting the Z-level for contours in a surfc plot.

After the surfc call in your script, instead of using a for loop to change the zdata, use


set (h(2), "zlevel", -8);


This works fine, but it requires running a development version of Octave (4.1.X) availble only if you build from Mercurial sources.  Alas, this fix is not available in the current stable release (3.8.2).

I can achieve something like it by hacking your script after the surfc call.


hc = h(2);
set (hc, 'zlevel', -8);
set (hc, 'zdata', get (hc, 'zdata') - 10*eps);


This sets the zlevel property manually and then changes the zdata every so slightly to force a refresh of the contours.

Rik <rik5>
Group administrator
Sun 24 Aug 2014 03:47:45 PM UTC, comment #3: 

Hi
first of all I have to apologize. The code example was incomplete.
Please find attached the full code and the Matlab result.

Here some links to the supposed behaviour:

http://www.mathworks.com/matlabcentral/newsreader/view_thread/54747
http://www.mathworks.com/matlabcentral/answers/11575-multilevel-contour-plots

file #31951)

Anonymous
Thu 21 Aug 2014 11:00:34 PM UTC, comment #2: 

Could you also upload the code segment as a file?  The input parser for the text box converted everything between two multiplication symbols to bold which makes it hard to understand.

Rik <rik5>
Group administrator
Thu 21 Aug 2014 12:56:23 PM UTC, comment #1: 

I cannt use Matlab to test. Can you please show me what Matlab does here?

Jordi GutiƩrrez Hermoso <jordigh>
Group Member
Wed 20 Aug 2014 01:55:39 PM UTC, original submission:  

E.g. the following code:

[x,y]=meshgrid([-10:0.1:10],[-10:0.1:10]); z = exp(1-0.05*(x-1).^2-0.2*(y+2).^2)+sin(x).^2.*sin(y).^2.*exp(0.05*(1-x.^2-y.^2)).*y.^2;
surfc(x,y,z,'EdgeColor','none');

shows the contour plots directly under the function. So one can not see them. The plot in MATLAB is first shifted and then the contour plots are at the bottom.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #31950:  plotting.png added by None (30KiB - image/png)
file #31951:  plottingExample.m added by None (277B - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by hardy (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by jordigh (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-02-05 rik5 StatusConfirmed Wont Fix
        Open/ClosedOpen Closed
    2018-04-27 mtmiller Carbon-CopyRemoved 80942 -
    2018-04-27 mtmiller Release3.8.0 dev
    2014-08-24 rik5 Item GroupInaccurate Result Matlab Compatibility
        StatusNeed Info Confirmed
    2014-08-24 None Attached File- Added plotting.png, #31950
        Attached File- Added plottingExample.m, #31951
    2014-08-21 jordigh StatusNone Need Info
        Summary behavior of surfc surfc does not make contours visible

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code