bugGNU Octave - Bugs: bug #46496, Problems with legend background...


bug #46496: Problems with legend background and labels spacing (gnuplot)

Submitter:  Mauro Santos <msantos>
Submitted:  Sun 22 Nov 2015 02:21:46 PM UTC
Category:  Plotting with gnuplot Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * 4.0.0 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Wed 12 Oct 2016 12:25:18 PM UTC, comment #3: 

I observe the same thing on Cygwin with Octave 4.0.1 and gnuplot 5.0 patchlevel 3. Same also on Ubuntu LTS 16 with Octave 4.0.0 and gnuplot4 (to not get black plots).

Using gnluplot. The problem is apparent when using print "test.png" as line spacing becomes 2.5 rows, the default fontsize when plotting .png is for some reason 20 but only 10 for .svg. So problem does not show up on .svg unless fontsize is changed like -F:20.

I came to the same conclusion as the original poster, it seems very odd. (also; it is also a bit odd that font size always doubles from requested size when plotting .png compared to .svg).

Petter <petos>
Tue 24 Nov 2015 06:51:45 AM UTC, comment #2: 

The cause of extra space is in line 1784 of

 spc = s / 10 * 1.25;

when font size is 16, the space is 2 instead of 1.25. The line

 spc = 1.25;

fix the extra space for gnuplot 4.6.7, but I do not know
what's happen in other versions of gnuplot. There is explanation in the code:

  ## The gnuplot default font size is 10, and default spacing is 1.25.
  ## gnuplot has a concept of a figure global font, and sizes everything
  ## appropriate to that, including the legend spacing.
  ## This means that if an alternative size is used, gnuplot will use an
  ## inappropriate spacing in the legend by default.
  ## FIXME: Are fractional spacing specifications allowed?  Or should this
  ##        number be rounded?

Avinoam Kalma <avinoam>
Group Member
Sun 22 Nov 2015 02:27:12 PM UTC, comment #1: 


Thanks for your bug report. You are describing two separate problems. The first is gnuplot specific so I'll change the category. The second (invisible legend background) is fixed in the current dev version of Octave so lets forget about it.

Pantxo Diribarne <pantxo>
Group Member
Sun 22 Nov 2015 02:21:46 PM UTC, original submission:  

With octave 4 I'm seeing what seems to be incorrect label spacing when using the gnuplot graphics toolkit and increasing the font size, see o3g4.eps (octave 3, gnuplot 4) vs o4g4.eps (octave 4, gnuplot 4). I suppose the label spacing should not increase when increasing the font size, as is the case with octave 3

I have not tested this with gnuplot 5 as I'm seeing the problem described here in https://savannah.gnu.org/bugs/?42838

If using the fltk graphics toolkit I'm seeing a problem with the legend background, with octave 4 the background is transparent, which seems to be incorrect, see o3f1.eps (octave 3, fltk 1) vs o4f1.eps (octave 3, fltk 1).

Attached is the targz with pnd and eps files and the script (legend_test) that I have used to generate the plots.

The test was done with:
octave 3.8.2 and 4.0.0
gnuplot 4.6.6
fltk 1.3.3

Mauro Santos <msantos>


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

Attach Files:

Attached Files
file #35520:  legend_test.tar.gz added by msantos (212KiB - application/gzip)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by petos (Posted a comment)
  • -email is unavailable- added by avinoam (Posted a comment)
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by msantos (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-12-22 rik5 SummaryProblems with legend background and labels spacing Problems with legend background and labels spacing (gnuplot)
    2015-11-22 pantxo CategoryPlotting Plotting with gnuplot
    2015-11-22 msantos Attached File- Added legend_test.tar.gz, #35520

    Back to the top

    Powered by Savane 3.12.
    Corresponding source code