bugGNU Octave - Bugs: bug #43890, gnuplot patch coloring not...

 
 

bug #43890: gnuplot patch coloring not identical to FLTK or Matlab

Submitter:  Rik <rik5>
Submitted:  Fri 26 Dec 2014 03:47:22 AM UTC
   
 
Category:  Plotting with gnuplot Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Works For Me Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 10 Jun 2015 10:41:50 PM UTC, comment #3: 

You're right.  This problem seems to have gone away.  Closing report.

Rik <rik5>
Group administrator
Tue 09 Jun 2015 05:14:44 PM UTC, comment #2: 

Does this problem still exist?  I am using Octave and gnuplot repository development versions and have run your examples.  The color scheme looks the same in all cases of jet(N), which matches the Qt plot version and your screen capture.

Dan Sebald <sebald>
Wed 31 Dec 2014 06:33:54 PM UTC, comment #1: 

I can get a second patch to turn a different color by using a differently sized colormap.


colormap (jet (11));


Also, for low values of the colormap size the cyan patch alternates between the correct color and the wrong color.

N = 4, 6, 9  are bad
N = 5, 7, 8, 10 are good


Rik <rik5>
Group administrator
Fri 26 Dec 2014 03:47:22 AM UTC, original submission:  

The patch colors are not always correct.  Here is one example:


graphics_toolkit gnuplot
demo ("patch", 6);
colormap (jet (4));
view (318, 75);


I've attached screen snapshots of the results under both gnuplot and FLTK.  You can't use print to produce the images because the print version from gnuplot is correct.

Octave is doing something very tricky with the colormap that it sends to gnuplot.  The code to modify will be in _go_draw_axes_.m.  The snapshot I took has a colorbar from gnuplot because I commented out this line in _go_draw_axes_.m:


#  fputs (plot_stream, "unset colorbox;\n");


As one can see, the colormap is doubled (8 entries) rather than the 4 that it would normally have.

The code immediately before this line is adding extra entries to the cmap for an unknown reason.  See below.


cmap = [cmap; addedcmap];
cmap_sz = cmap_sz + rows (addedcmap);

if (length (cmap) > 0)
  fprintf (plot_stream,
           "set palette positive color model RGB maxcolors %i;\n",
           cmap_sz);
  fprintf (plot_stream,
           "set palette file \"-\" binary record=%d using 1:2:3:4;\n",
           cmap_sz);
  fwrite (plot_stream, [1:cmap_sz; cmap.'], "float32");
  fwrite (plot_stream, "\n");
endif



Rik <rik5>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #32714:  demo6_gnuplot.png added by rik5 (44KiB - image/png)
file #32715:  demo6_fltk.png added by rik5 (17KiB - image/png)

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by sebald (Posted a comment)
  • -email is unavailable- added by avinoam
  • -email is unavailable- added by rik5 (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-06-10 rik5 StatusNone Works For Me
        Open/ClosedOpen Closed
    2014-12-26 rik5 Dependencies- Depends on bugs #34523
    2014-12-26 avinoam Carbon-Copy- Added avinoam
    2014-12-26 rik5 Attached File- Added demo6_gnuplot.png, #32714
        Attached File- Added demo6_fltk.png, #32715

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code