bugGNU Octave - Bugs: bug #41283, Legend doesn't pick up linewidth


bug #41283: Legend doesn't pick up linewidth

Submitted by:  Joachim Wiesemann <jwiesemann>
Submitted on:  Mon 20 Jan 2014 09:25:36 AM UTC  
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  jwiesemann Open/Closed:  Closed
Release:  dev Operating System:  Any

Add a New Comment (Rich Markup)

You are not logged in

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


Mon 03 Feb 2014 05:57:21 AM UTC, comment #3: 

I applied your patch to the development branch here (http://hg.savannah.gnu.org/hgweb/octave/rev/be3702a2eb8a).  I ended up restricting the maximum size of the line width in the legend so that it wouldn't overflow the visual area available.

Rik <rik5>
Project Administrator
Tue 21 Jan 2014 09:57:21 PM UTC, comment #2: 

As remarked in comment #1, gnuplot already has some support for changing the lengend linewidth when the plotted line is thick.  However, I notice that it doesn't actually use the linewidth of the line.  I set the linewidth to 8 and the plotted line was huge, but the legend linewidth was the same as when the linewidth was 3.

Not that we have to slavishly follow Matlab, but what do they do in this regard?  If the linewidth is set to something huge, say 20, does the legend linewidth actually match the line?

Rik <rik5>
Project Administrator
Mon 20 Jan 2014 02:20:59 PM UTC, comment #1: 

Thanks for your report. The example you posted shows that the line width is set correctly for gnuplot but not for the default FLTK plotting backend. Also affects the development version.

Mike Miller <mtmiller>
Project Administrator
Mon 20 Jan 2014 09:25:36 AM UTC, original submission:  

The legend of a plot picks up color and linestyle of each line, It ignores line width.

t = (0 : 0.01 : 1)';
y1 = sin( 2*pi*t );
y2 = 0.6*sin( 2*pi*t+pi/3 );

plot( t, y1, "linewidth", 3, "color", "blue"  );
plot( t, y2, "color", "black" );
legend( "y1", "y2" );

When using linewidth to differentiate lines the legend has to pick it up, too. On high resolution displays it's difficult to distinguish eg. black and blue line. Increasing linewidth helps, except for the current legend. See example above.

Attached patch for current dev will fix this bug.

Joachim Wiesemann <jwiesemann>


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

Attach Files:

Attached Files
file #30315:  Legend_with_linewidth.patch added by jwiesemann (4KiB - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


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

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

    Only project members can vote.




    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-02-03 rik5 StatusPatch Submitted => Fixed
        Open/ClosedOpen => Closed
    2014-01-20 mtmiller CategoryPlotting => Plotting with OpenGL
        Item GroupInaccurate Result => Incorrect Result
        StatusNone => Patch Submitted
        Release3.6.4 => dev
        Operating SystemMicrosoft Windows => Any
    2014-01-20 jwiesemann Attached File- => Added Legend_with_linewidth.patch, #30315

    Back to the top

    Powered by Savane 3.5