bugGNU Octave - Bugs: bug #35144, gnuplot doesn't render the trisurf...

 
 

bug #35144: gnuplot doesn't render the trisurf mesh

Submitter:  marco atzeri <matzeri>
Submitted:  Wed 21 Dec 2011 11:29:13 AM UTC
   
 
Category:  Plotting with gnuplot Severity:  3 - Normal
Priority:  3 - Low Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 18 Nov 2016 05:45:28 AM UTC, comment #19: 

This has been fixed somewhere in the last five years.  I did 'demo trisurf' with 4.2.0.

Rik <rik5>
Group administrator
Thu 06 Jun 2013 06:34:49 AM UTC, comment #18: 

I don't know when I'll have time to get back to this, so I'm removing myself as assignee.

Ben Abbott <bpabbott>
Group Member
Wed 28 Dec 2011 09:30:41 PM UTC, comment #17: 

Update: After some more testing, I've conclude the last several changeset won't function properly. They use gnuplot commands like


<snip>
<\snip>
set style line 1 default;
set style line 1 linecolor rgb "#00FF00" linetype 1 linewidth 2;
set style line 2 default;
set style line 2 linecolor rgb "#FF0000" linetype 3 linewidth 1;
<snip>
<\snip>
set pm3d depthorder hidden3d 1
splot "-" using 1:2:3:4 title "" with pm3d;
set pm3d depthorder hidden3d 2
splot "-" using 1:2:3:4 title "" with pm3d;
<snip>
<\snip>


The result is that the last splot erases the prior results. I had used this approach to allow different line styles to be used for draw the mesh associated the trisurf patch object.

For now, I don't see how gnuplot can render different meshed surfaces with differing lines used for the edges.

If I don't come up with something in the next few days, i plan to close this report and open a new one with a bit more detail on the problem.


Ben Abbott <bpabbott>
Group Member
Tue 27 Dec 2011 07:56:43 PM UTC, comment #16: 

I've attached a fifth changeset. This one has not yet been pushed.

To test, try


demo trisurf


The demos with facecolor == flat should have a visible mesh.


(file #24683)

Ben Abbott <bpabbott>
Group Member
Mon 26 Dec 2011 12:36:35 AM UTC, comment #15: 

Trimesh renders the mesh, but trisurf does not (neither lines nor markers).


figure (1)
demo trisurf 2
figure (2)
demo trimesh 1


One approach which renders lines is to make the change below to the gnuplot plot-stream.


-  set pm3d depthorder
+ set style line 7 lc rgb "#000000" lw 0.5 lt 1
+ set pm3d depthorder hidden3d 7


Unfortunately, this isn't a general solution, but I thought it best to document it here.

Ben Abbott <bpabbott>
Group Member
Sun 25 Dec 2011 07:45:55 PM UTC, comment #14: 

I did some more testing of the edgecolor. Apparently, the line associated with gnuplot's 3D patches works differently.


demo trisurf 2
h = findobj (gca, "type", "patch");
set (h, "linewidth", 10)


The result is a blackline drawn around the visible perimeter of the image.

I'm not sure how this can easily be fixed.

Ben Abbott <bpabbott>
Group Member
Sun 25 Dec 2011 07:03:11 PM UTC, comment #13: 

I've attached a fourth attempt, and pushed it.

http://hg.savannah.gnu.org/hgweb/octave/rev/5be545210fe3

This one fixes the rendered facecolors and color limits.

I ran the plot demos for both gnuplot and fltk, and didn't notice any regressions.

Note: I noticed that when using gnuplot, the edgecolor isn't working correctly. I'll look at that next. I'm not sure if a fix for the edgecolor belongs in stable or default. If anyone has an opinion, let me know.

(file #24665)

Ben Abbott <bpabbott>
Group Member
Fri 23 Dec 2011 09:55:01 PM UTC, comment #12: 

I noticed that the trisurf implementation set the facevertexcdata directly. This resulted in an empty cdata property and prevented the patch color from being taken into account when climmode == auto.

The third changeset I'm attaching switches to using the {x,y,z,c}data inputs when calling patch(). This fixed the clim problem but also reveals that the fltk backend doesn't handle patches correctly.

I've added a new demo (first one). Typing "demo trisurf 1" produces the same result as does ML. The fltk backend result is messed up.


(file #24657)

Ben Abbott <bpabbott>
Group Member
Fri 23 Dec 2011 08:32:58 PM UTC, comment #11: 

Re-titling bug report to remaining open issue.

Rik <rik5>
Group administrator
Thu 22 Dec 2011 06:46:51 PM UTC, comment #10: 

Rik,

I had noticed a slight difference as well. I'll make a note to myself to look into this a bit deeper next week ... I have to week off from the normal grind :-)

I'll have to study the ML docs to see what the best approximation is for the gnuplot backend.

For reference, I've attached the results I get using ML R2011b.

(file #24651)

Ben Abbott <bpabbott>
Group Member
Thu 22 Dec 2011 06:17:45 PM UTC, comment #9: 

Thanks Ben! 

All four demos run in gnuplot now for me as well using tip (14095:595ee644fa6f).  I'm writing now only to report that there is a slight difference in the resulting plots.  For the FLTK plot both the mesh and the surface are drawn.  For the gnuplot version it appears that perhaps only the surface is drawn.

To get an idea of what I mean, try "demo ("surf", 1)" which is the 2-D version.  It shows both mesh and surface for either toolkit.

This may be another limitation of gnuplot.  I tried increasing the edgewidth to 3 and the edgecolor property to [1 0 1] (hot pink) and I can see that some of the mesh is being drawn.

Rik <rik5>
Group administrator
Thu 22 Dec 2011 04:07:32 PM UTC, comment #8: 

all four example are now fine.


marco atzeri <matzeri>
Thu 22 Dec 2011 03:41:35 PM UTC, comment #7: 

Second attempt is attached.

(file #24650)

Ben Abbott <bpabbott>
Group Member
Thu 22 Dec 2011 03:29:25 PM UTC, comment #6: 

first two work. but the third example fails:


/usr/local/share/octave/3.5.90+/m/plot/trisurf.m example 3:
 clf
 x = rand (100, 1);
 y = rand (100, 1);
 z = x.^2 + y.^2;
 tri = delaunay (x, y);
 trisurf (tri, x, y, z, "facecolor", "interp");

error: _go_draw_axes_: subscript indices must be either positive integers or logicals
error: called from:
error:   /pub/hg/octave_build/../octave/scripts/plot/private/__go_draw_axes__.m at line 759, column 37
error:   /pub/hg/octave_build/../octave/scripts/plot/private/__go_draw_figure__.m at line 167, column 19
error:   /pub/hg/octave_build/../octave/scripts/plot/__gnuplot_drawnow__.m at line 86, column 5
error: input: reading user-input failed!
error:   /pub/hg/octave_build/../octave/scripts/testfun/demo.m at line 119, column 7

marco atzeri <matzeri>
Thu 22 Dec 2011 03:17:04 PM UTC, comment #5: 

I had improperly linked qhull in my earlier build. The result was no error, and no plot. I've corrected that and now see the error.

Proposed changeset is attached.

(file #24649)

Ben Abbott <bpabbott>
Group Member
Thu 22 Dec 2011 01:47:54 PM UTC, comment #4: 

both. With gnuplot, I get the error and no plot

octave:1> demo /usr/local/share/octave/3.5.90+/m/plot/trisurf.m
/usr/local/share/octave/3.5.90+/m/plot/trisurf.m example 1:
 clf
 old_state = rand ("state");
 restore_state = onCleanup (@() rand ("state", old_state));
 rand ("state", 10);
 N = 10;
 x = 3 - 6 * rand (N, N);
 y = 3 - 6 * rand (N, N);
 z = peaks (x, y);
 tri = delaunay (x(:), y(:));
 trisurf (tri, x(:), y(:), z(:));

error: _go_draw_axes_: operator *: nonconformant arguments (op1 is 0x0, op2 is 3x1)
error: called from:
error:   /usr/local/share/octave/3.5.90+/m/plot/private/__go_draw_axes__.m at line 701, column 30
error:   /usr/local/share/octave/3.5.90+/m/plot/private/__go_draw_figure__.m at line 167, column 19
error:   /usr/local/share/octave/3.5.90+/m/plot/__gnuplot_drawnow__.m at line 86, column 5
error: input: reading user-input failed!
error:   /usr/local/share/octave/3.5.90+/m/testfun/demo.m at line 119, column 7

The error arises from trisurf call

marco atzeri <matzeri>
Thu 22 Dec 2011 01:20:54 PM UTC, comment #3: 

Marco, by "fail" do you mean you get the error, or that you don't get the graphic intended?

Ben Abbott <bpabbott>
Group Member
Thu 22 Dec 2011 10:48:11 AM UTC, comment #2: 

it fails on gnuplot and pass on fltk on cygwin

marco atzeri <matzeri>
Thu 22 Dec 2011 12:13:17 AM UTC, comment #1: 

I'm not seeing a crash with the stable branch.


$ hg tip
changeset:   14086:41511cce0488
branch:      stable
tag:         tip
user:        Rik <octave@nomad.inbox5.com>
date:        Wed Dec 21 10:12:40 2011 -0800
summary:     test: Fix 2nd demo for slice() (bug #35143)


Ben Abbott <bpabbott>
Group Member
Wed 21 Dec 2011 11:29:13 AM UTC, original submission:  

all the trisurf demos fail with
----------------------------------------------------------------
error: _go_draw_axes_: operator *: nonconformant arguments (op1 is 0x0, op2 is 3x1)
error: called from:
error:   /usr/local/share/octave/3.5.90+/m/plot/private/__go_draw_axes__.m at line 701, column 30
error:   /usr/local/share/octave/3.5.90+/m/plot/private/__go_draw_figure__.m at line 167, column 19
error:   /usr/local/share/octave/3.5.90+/m/plot/__gnuplot_drawnow__.m at line 86, column 5
---------------------------------------------------------------

a more general trisurf bug, or side effect of something else ?

marco atzeri <matzeri>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #24683:  changeset.patch added by bpabbott (12KiB - application/octet-stream - fifth changeset)
file #24665:  changeset.patch added by bpabbott (3KiB - application/octet-stream - fourth changeset)
file #24657:  changeset.patch added by bpabbott (2KiB - application/octet-stream - third changeset)
file #24651:  trisurf_demos.pdf added by bpabbott (269KiB - application/pdf - trisurf demos using ML R2011b)
file #24650:  changeset.patch added by bpabbott (2KiB - application/octet-stream - second attempt)
file #24649:  changeset.patch added by bpabbott (1KiB - application/octet-stream - first attempt)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by bpabbott (Posted a comment)
  • -email is unavailable- added by matzeri (Submitted the item)
  •  

    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 20 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-18 rik5 StatusPostponed Fixed
        Open/ClosedOpen Closed
    2016-02-28 mtmiller Priority5 - Normal 3 - Low
        StatusNone Postponed
    2013-06-06 bpabbott StatusFixed None
        Assigned tobpabbott None
    2011-12-27 bpabbott Attached File- Added changeset.patch, #24683
    2011-12-26 bpabbott Summarytrisurf plots differently in gnuplot and FLTK gnuplot doesn't render the trisurf mesh
    2011-12-25 bpabbott Attached File- Added changeset.patch, #24665
        StatusIn Progress Fixed
    2011-12-23 bpabbott Attached File- Added changeset.patch, #24657
    2011-12-23 rik5 StatusReady For Test In Progress
    2011-12-23 rik5 Summarytrisurf.m demo failure trisurf plots differently in gnuplot and FLTK
    2011-12-22 bpabbott Attached File- Added trisurf_demos.pdf, #24651
    2011-12-22 bpabbott Attached File- Added changeset.patch, #24650
    2011-12-22 bpabbott Attached File- Added changeset.patch, #24649
        StatusWorks For Me Ready For Test
        Assigned toNone bpabbott
        Operating SystemMicrosoft Windows Any
    2011-12-22 bpabbott StatusNone Works For Me

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code