bugGNU Octave - Bugs: bug #45593, Color problem with patch ()

 
 

bug #45593: Color problem with patch ()

Submitted by:  Julien Bect <jbect>
Submitted on:  Tue 21 Jul 2015 05:11:49 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Regression
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: 4.0.0Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Thu 23 Jul 2015 07:55:52 PM UTC, comment #8:

I changed Octave to pass all fields in the face/vertex structure through to the underlying patch command. See http://hg.savannah.gnu.org/hgweb/octave/rev/85dcbed19753. The change was made on the stable branch and will be part of the 4.0.1 bug fix release.

Rik <rik5>
Project Administrator
Thu 23 Jul 2015 11:19:23 AM UTC, comment #7:

> I notice that you are trying to set the facecolor property
> inside the structure. That syntax isn't accepted according
> to the Matlab documentation, but it might be undocumented
> behavior.


Hello Rik,

You right, this is undocumented behaviour. And the other syntaxes that you propose are ok.

However, since this undocumented behaviour was also supported by Octave 3.8.x, perhaps would it be better to keep supporting it if we can ? i.e., accept any valid property of a patch object as field in the structure ?

Concerning your Matlab question, I get the following with R2012b:

The rectangles are black in the first two cases, and green in the thrid case.

Julien Bect <jbect>
Wed 22 Jul 2015 08:54:13 PM UTC, comment #6:

@Julien: This doesn't seem as bad as I first thought. The problem is that the 'facecolor' attribute is being set to [0 0 0] (black). If you change the 'facecolor' attribute to 'flat' the correct coloring is restored.

There are still a number of questions however. The test script uses the structure syntax for supplying the faces and vertices.

I notice that you are trying to set the facecolor property inside the structure. That syntax isn't accepted according to the Matlab documentation, but it might be undocumented behavior.

Here are a couple examples of syntax that works in Octave:

Do you have access to Matlab? I'd like to try and see what is going on here.

Rik <rik5>
Project Administrator
Tue 21 Jul 2015 08:17:03 AM UTC, comment #5:

Thank you.

Julien Bect <jbect>
Tue 21 Jul 2015 08:07:08 AM UTC, comment #4:

A new report was filed for the gnuplot issue.

Avinoam Kalma <avinoam>
Project Member
Tue 21 Jul 2015 06:51:49 AM UTC, comment #3:

@Avinoam Kalm, Dan Sebald: this gnuplot error seems to be unrelated with the original purpose of this bug report.

Indeed, this error message disappears if you simply remove the unused third column in the coord matrix (see attached script).

And then gnuplot behaves exactly like Qt and FLTK: the rectangles have the correct size but not are all black.

Please keep this bug report focused on the patch/color issue, and open another bug report to discuss the issue about gnuplot and 3-D patches.

(file #34477)

Julien Bect <jbect>
Tue 21 Jul 2015 06:34:40 AM UTC, comment #2:

The following code is what complains and the pm3d style of gnuplot is used:

If one were to write the above to use triangulation of polygons, it would be possible to use pm3d. However, a more straightforward approach might be to use gnuplot's polygon object. As an example:

Dan Sebald <sebald>
Tue 21 Jul 2015 05:25:12 AM UTC, comment #1:

Using gnuplot as graphics_toolkit, I get

Avinoam Kalma <avinoam>
Project Member
Tue 21 Jul 2015 05:11:49 AM UTC, original submission:

The attached script demonstrates a regression between Octave 3.8.2 and Octave 4.0.0 with the patch function.

The corrected behaviour (also observed in Matlab R2012b) is to produce a patch of color-filled rectangles. See patches_octave382_fltk.eps.

In Octave 4.0.0, both with Qt and FTLK as graphic toolkits, the rectangles are black. See patches_octave400_fltk.eps and patches_octave400_qt.eps.

Julien Bect <jbect>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #34477:  script_patch_problem_2.m added by jbect (693B - text/x-objcsrc)
file #34473:  script_patch_problem.m added by jbect (765B - text/x-objcsrc)
file #34474:  patches_octave382_fltk.eps added by jbect (11KiB - application/postscript)
file #34475:  patches_octave400_fltk.eps added by jbect (10KiB - application/postscript)
file #34476:  patches_octave400_qt.eps added by jbect (10KiB - application/postscript)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by sebald (Posted a comment)
  • -unavailable- added by avinoam (Posted a comment)
  • -unavailable- added by jbect (Submitted the item)
  • -unavailable- added by jbect
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 23 Jul 2015 07:55:52 PM UTCrik5StatusIn Progress=>Fixed
      Open/ClosedOpen=>Closed
    Wed 22 Jul 2015 08:54:13 PM UTCrik5StatusNone=>In Progress
    Tue 21 Jul 2015 06:51:49 AM UTCjbectAttached File-=>Added script_patch_problem_2.m, #34477
    Tue 21 Jul 2015 05:11:49 AM UTCjbectAttached File-=>Added script_patch_problem.m, #34473
      Attached File-=>Added patches_octave382_fltk.eps, #34474
      Attached File-=>Added patches_octave400_fltk.eps, #34475
      Attached File-=>Added patches_octave400_qt.eps, #34476
      Carbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1