bugGNU Octave - Bugs: bug #46546, gnuplot legend text aligns right...

 
 

bug #46546: gnuplot legend text aligns right by default

Submitter:  Cillian O'Driscoll <odrisci>
Submitted:  Thu 26 Nov 2015 03:53:58 PM UTC
   
 
Category:  Plotting with gnuplot Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  bpabbott
Originator Name:  Cillian O'Driscoll Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 18 Dec 2015 08:32:58 PM UTC, comment #2: 

I tested a second time. This is a minor change, so need pressing need for confirmation. I'll close the report. If there is a problem it can be reopened.

Ben Abbott <bpabbott>
Group Member
Thu 17 Dec 2015 11:00:54 PM UTC, comment #1: 

I've pushed the changeset with some minor edits.

http://hg.savannah.gnu.org/hgweb/octave/rev/8020eceafaf0

I've tested it with "demo legend", but will wait on futher tests/confirmation before closing.

Ben Abbott <bpabbott>
Group Member
Thu 26 Nov 2015 03:53:58 PM UTC, original submission:  

When attaching a legend to a plot using the gnuplot graphics_toolkit, the text is always right aligned, even if the option "right" is specified so that the text is to the right of the keys. In Matlab, and apparently with the FLTK graphics_toolkit, the text is left aligned when the text is to the right of the keys.

http://stackoverflow.com/questions/25017514/set-legend-texts-horizontalalignment-to-left-in-octave

Simple code to reproduce:


th = linspace( 0, 2*pi);
plot( th/pi, [ sin(th); cos(th) ] )
legend( 'Sin', 'Cos(\theta)', 'Location', 'EastOutside' )


This can be easily fixed using the attached patches (for v 4.0.0 and for the latest development branch, i.e. after the file _go_draw_axes_.m was renamed _gnuplot_draw_axes_.m). I'm not overly familiar with the Octave source, so apologies if the patch isn't up to scratch.

The above code snippet generates the attached sincos_bad.png. After applying the patch, the output generated is shown in sincos_good.png

Version information:


----------------------------------------------------------------------
GNU Octave Version: 4.0.0
GNU Octave License: GNU General Public License
Operating System: Darwin 14.5.0 Darwin Kernel Version 14.5.0: Tue Sep  1 21:23:09 PDT 2015; root:xnu-2782.50.1~1/RELEASE_X86_64 x86_64


Cillian O'Driscoll <odrisci>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #35561:  sincos_bad.png added by odrisci (31KiB - image/png)
file #35562:  octave_legend_align_4-0-0.patch added by odrisci (856B - application/octet-stream)
file #35563:  sincos_good.png added by odrisci (31KiB - image/png)
file #35564:  octave_legend_align.patch added by odrisci (861B - 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 bpabbott (Posted a comment)
  • -email is unavailable- added by odrisci (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 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-12-18 bpabbott StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2015-12-17 bpabbott StatusNone Ready For Test
        Assigned toNone bpabbott
        Release4.0.0 dev
        Operating SystemMac OS Any
    2015-11-26 odrisci Attached File- Added sincos_bad.png, #35561
        Attached File- Added octave_legend_align_4-0-0.patch, #35562
        Attached File- Added sincos_good.png, #35563
        Attached File- Added octave_legend_align.patch, #35564

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code