bugGNU Octave - Bugs: bug #49260, Differences in compare_plot_demos...

 
 

bug #49260: Differences in compare_plot_demos with gnuplot

Submitter:  Rik <rik5>
Submitted:  Mon 03 Oct 2016 08:53:31 PM UTC
   
 
Category:  Plotting with gnuplot Severity:  2 - Minor
Priority:  3 - Low Item Group:  Matlab Compatibility
Status:  Confirmed 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
   

Jump to the original submission

Sat 11 Feb 2023 07:03:08 PM UTC, comment #10: 

Given that gnuplot is no longer supported by Octave and this report is 6 years old, I am closing this report.

Rik <rik5>
Group administrator
Wed 13 Dec 2017 06:30:15 PM UTC, comment #9: 

The issue with demo #7 for scatter has been fixed by cset a9be96afb39e for bug #52624.

Reviewing the remaining differences yields a much smaller list.


FUNCTION    DEMO #      ISSUE

area        2           Superscript in legend is outside legend box

box         4           The property "boxstyle" = "back" is not implemented.

contour     3           The single contour is drawn with the last color in the
                        colormap rather than the intermediate value (~128).

contourf    3           The filled contour is drawn with the last color in the
                        colormap rather than the intermediate value.

fplot       1           The legend area is transparent, rather than having a
                        solid white background.  I think this has been reported
                        already.

legend      13          Large number of keys in legend causes overlap of X label

scatter     1           Plotted MarkerSize is smaller than for OpenGl/Matlab

slice       2           Fill color of mesh outside of central area is yellow,
                        rather than white or possibly transparent.

subplot     1           Titles and xlabels overlap



Rik <rik5>
Group administrator
Thu 06 Oct 2016 09:31:18 PM UTC, comment #8: 

I expanded the code to better see how scatter is getting a different color in gnuplot than in fltk.


close all
x = rand (1,1);
y = rand (1,1);
colors = rand (1,1);

graphics_toolkit gnuplot
scatter (x,y, [], colors, "filled")
colormap (rainbow (3));

title ("gnuplot");
graphics_toolkit fltk
figure
scatter (x,y, [], colors, "filled")
colormap (rainbow (3));
title ("fltk");


With only three colors in the colormap, gnuplot always chooses the last one while fltk always chooses the middle one.


Rik <rik5>
Group administrator
Thu 06 Oct 2016 09:20:19 PM UTC, comment #7: 

I expanded the code in the demo for autumn to better show how gnuplot is getting the Z-depth stacking wrong between the axes object and axes children.


close all
graphics_toolkit gnuplot
cmap = autumn (256);
h = rgbplot (cmap);
set (h, "linewidth", 5);
print -dpsc2 cmap.ps


As you can see in the attached Postscript file, the axes layer is either on top, or maybe it is being alpha blended with the line objects from rgbplot.

The second Postscript file is after doing


graphics_toolkit (1, "fltk")
print -dpsc2 cmap2.ps




(file #38679, file #38680)

Rik <rik5>
Group administrator
Thu 06 Oct 2016 09:11:13 PM UTC, comment #6: 

Since it was uncertain whether this will be the final bug fix for the error legend I pushed the cset to default (http://hg.savannah.gnu.org/hgweb/octave/rev/54332b6ddeb6).

Rik <rik5>
Group administrator
Thu 06 Oct 2016 05:37:13 PM UTC, comment #5: 

I've attached a changeset for the errorbar multiple legend entry problem, one of the bigger issues.  The patch is actually not real big, but I shifted a big hunk of conditional code two spaces left which comes out jumbled.  The key entries are constructed using phantom data.

The 'boxxyerrorbars' (i.e., error boxes) has no point type (see 'demo errorbar 5'), but the 'xyerrorbars' (i.e., error bars) does have a point type even though the demo does not activate it.  I attempted adding a point type to error boxes, but confusion about documentation lead to object actually just being a 'boxxy', (i.e., a conventional box with x and y dimensions):

https://sourceforge.net/p/gnuplot/bugs/1864/

but I don't think that will happen.

So, this patch is a first step toward a satisfactory, but not complete solution I suggest applying.  After that, since Octave goes to the lengths of defining a legend in terms of elementary plot objects, I will attempt some kind of hybrid that draws the legend along the lines of how current axes drawing is handled but make sure the text portion comes out reasonably balanced in terms of legend border.  My intuition is that may not come out perfectly, hence the reason for applying this patch as an intermediate step.

(file #38677)

Dan Sebald <sebald>
Tue 04 Oct 2016 08:56:38 PM UTC, comment #4: 

OK, I think I know what is going on.  The error bars were removed:


Changeset:
10597 (ba346313bdc1) __go_draw_axes__.m: Remove gnuplot errorbar code.


I'm guessing because Octave plotting routines should take control of drawing the error bars rather than have gnuplot do so.  I think what we should do for the key in this case is not add any entries for the lines, but instead draw some phantom lines having maybe only a NAN entry and be of the proper error bar style.  Otherwise, there is no way to get a proper error bar key entry.

Dan Sebald <sebald>
Tue 04 Oct 2016 08:43:56 PM UTC, comment #3: 

FUNCTION    DEMO #      ISSUE
errorbar    3,4         Four keys in legend rather than two

Hmm, it's as if the code that set the variable 'errbars' is missing, deleted or something.  All I see is an initialization:


        usingclause{data_idx} = sprintf ("record=%d", numel (obj.xdata));
        errbars = "";


but nothing after that.  I would think that errbars should be assigned things like "xerr", "yerr", "boxxy", etc.

http://gnuplot.sourceforge.net/demo_5.1/mgr.html

Tortoise HG has a convenient history search.  Unfortunately, I can't COPY the table it creates and PASTE here.  So, I will just list the changesets that have this type of line


                errbars = "xyerrorbars";


They are:

11655
10597
10549
7541

The first couple (7541 and 10549) look like the addition of "xyerrorbars" and then a move of "xyerrorbars".  The third (10597) looks like a removal of "xyerrorbars" by one user and then putting them back in place by another user.  Could it be that some type of patch/branch wasn't merged properly or someone didn't realize they were working with an older file?

Dan Sebald <sebald>
Mon 03 Oct 2016 09:09:02 PM UTC, comment #2: 

For the problems with the '@' character, if the "interpreter" property is set to "none" then they disappear.  In the code, Octave replaces '@' with '\@', but this regexprep no longer works.  Apparently, the replacement pattern now has to be '\\@'


if (enhanced)
  str = regexprep (str, '(?<!\\)@', '\@');
endif


I made that change here http://hg.savannah.gnu.org/hgweb/octave/rev/2bca08793651.

Rik <rik5>
Group administrator
Mon 03 Oct 2016 08:54:37 PM UTC, comment #1: 

@Dan: I added you as a CC for this report, but don't feel obligated to work on this immediately.

Rik <rik5>
Group administrator
Mon 03 Oct 2016 08:53:31 PM UTC, original submission:  

I ran dump_plot_demos today (10/31/16) to determine the state of the gnuplot toolkit.  I don't think any of these are critical to the 4.2 release, but it would be good to address them, particularly the regressions, at some point.


FUNCTION    DEMO #      ISSUE
errorbar    3,4         Four keys in legend rather than two

ezsurfc     1           Title too low

area        2           Superscript in title is truncated by position onscreen

autumn      1           Lines which appear directly on an axis are not shown.
                        This should be controlled by the axis "layer" property.
                        The default is "bottom" which means user drawn lines
                        should appear above the axes lines.
                        All of the demos which use rgbplot tend to have this problem.

axis        3           "axis off" still shows box around axis

axis        9           X and Y axis lines appear in color, rather than black.
                        This is associated with using a different "origin" than
                        the default.  It is probably using the next linestyle
                        or something like that.

box         4           The property "boxstyle" = "back" is not implemented.

contour     3           The single contour is drawn with the last color in the
                        colormap rather than the intermediate value (~128).

contourf    3           The filled contour is drawn with the last color in the
                        colormap rather than the intermediate value.

fplot       1           The legend tag is transparent, rather than having a
                        solid white background.  I think this has been reported
                        already.

fplot       3           Legend text which uses '@' has that character deleted
                        and the spacing of the following characters is messed
                        up.  There is special code to deal with the '@' char
                        in __gnuplot_draw_axes__.m, but it seems to be failing.
                        This is a regression from 4.0.3.

legend      9           "legend hide" does not hide legend.  This is a
                        regression from 4.0.3.

legend      11          Greek text causes alignment of text to be off.

legend      13          Large number of keys in legend causes overlap of X label

legend      18          Color patch missing from legend key for surface object

legend      26          Legend not contained within axes box

legend      31          Long key text extends outside legend box

mesh        4           Title within axes box

scatter     1           Plotted MarkerSize is smaller than for OpenGl/Matlab

scatter     7           For the case of Random Color: 1 Point, the single point
                        is in yellow (max of colormap) rather than a greenish
                        color.

slice       2           Fill color of mesh outside of central area is yellow,
                        rather than white or possibly transparent.

subplot     1           Titles and xlabels overlap



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 #38679:  cmap.ps added by rik5 (185KiB - application/postscript)
file #38680:  cmap2.ps added by rik5 (168KiB - application/postscript)

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

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

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

    Date Changed by Updated Field Previous Value => Replaced by
    2023-02-11 rik5 Open/ClosedOpen Closed
    2017-12-13 rik5 Summarygnuplot picks different color for patch when colormap is small Differences in compare_plot_demos with gnuplot
    2016-11-16 rik5 Severity3 - Normal 2 - Minor
        Priority5 - Normal 3 - Low
        StatusNone Confirmed
        Summarygnuplot visual differences to OpenGL toolkit gnuplot picks different color for patch when colormap is small
    2016-10-14 rik5 Dependencies- bugs #49341 is dependent
    2016-10-06 rik5 Attached File- Added cmap.ps, #38679
        Attached File- Added cmap2.ps, #38680
    2016-10-06 sebald Attached File- Added octave-gnuplot_key_errorbar_bug49260-djs2016oct06.patch, #38677
    2016-10-03 rik5 Carbon-Copy- Added sebald

    Back to the top

    Powered by Savane 3.14-3b9d.
    Corresponding source code