bugGNU Octave - Bugs: bug #35439, fltk printed png is restricted by...


bug #35439: fltk printed png is restricted by display size

Submitted by:  Ben Abbott <bpabbott>
Submitted on:  Thu Feb 2 19:53:36 2012  
Category: Plotting with OpenGLSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Ben AbbottOpen/Closed: Closed
Release: devOperating System: Any

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

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


(Jump to the original submission Jump to the original submission)

Fri Nov 18 05:50:24 2016, comment #11:

The original examples work for me in Linux with 4.2.0. Closing report.

Rik <rik5>
Project Administrator
Fri Dec 14 13:15:44 2012, comment #10:

If this is another example of the long-standing timing
problem in fltk it might be better to change the summary
to show this, and somehow try to track down the source
of this problem. I have tried to isolate the problem,
but have not succeeded.

It is a serious defect that printed plots continue to be
rendered incorrectly.

Michael Godfrey <godfrey>
Project Member
Fri Dec 14 11:41:35 2012, comment #9:

No, I was too quick to draw a conclusion. The resizing command works with heights bigger than the displays height only when the figure spreads over more than one workspaces. So this may be indeed a separate bug related to a fltk restriction. Probably there will be some workaround, but I am not very experienced in fltk.

Konstantinos Poulios <logari81>
Project Member
Fri Dec 14 11:22:14 2012, comment #8:

I do not agree that this is a restriction of fltk/gl2ps.

If I comment out the setting of position in print.m:

% set (opts.figure, "position", fpos);

I can print the attached file with:

fpos = get (gcf, "position");
set (gcf, "position", [fpos(1),fpos(2),fpos(3),2000])
print('-dpng', '/tmp/test.png')

Actually I suspect that this issue is just another manifestation of a race condition between fltk and octave, as I have described it in detail here:


Other manifestations of this fundamental bug are random output sizes depending e.g. if print is issued interactively or in a script or if "waits" and "drawnows" are added in the code.

(file #27094)

Konstantinos Poulios <logari81>
Project Member
Fri Feb 17 23:41:10 2012, comment #7:

A future toolkit, such as Qt, may fix this so, I've modified the status to "Postponed"

Ben Abbott <bpabbott>
Project Member
Fri Feb 17 01:45:48 2012, comment #6:

Changing the summary to better describe the problem.

Ben Abbott <bpabbott>
Project Member
Tue Feb 14 19:01:00 2012, comment #5:

I ran the script on both MacOS 10.7.3 and Ubuntu 10.04. Nothing is garbled for me.

Ben Abbott <bpabbott>
Project Member
Tue Feb 14 17:02:50 2012, comment #4:

For me this is now all garbled (using your script with octave version 8de863b7126b tip). See attached.

(file #25063, file #25064, file #25065, file #25066)

Muhali <muhali>
Tue Feb 14 02:01:49 2012, comment #3:

I looked at this again. The problem for me is that my fltk window size is limited by my display. So when the print() command requests a window height of 1200 it is truncated.

To confirm I modified my script.

Both gnuplot and fltk give equivalent results.

I'm marking this as "won't fix" because this is a limitation imposed by the combination of fltk and gl2ps.

Ben Abbott <bpabbott>
Project Member
Mon Feb 13 22:47:33 2012, comment #2:

The interesting thing is that all depends on whether the commands are issued interactively (_i) or as the script (_s). I attach 4 files here only one of which gives the expected result, namely bar_s.png. Please note the slight difference at the bottom corner of foo.

(file #25056, file #25057, file #25058, file #25059)

Muhali <muhali>
Thu Feb 2 20:13:59 2012, comment #1:

I'll updated my sources.

Gnuplot still works correctly, but now neither fltk plot is correct. The results are essentially the same, but the plot has retained the default aspect ratio.

Ben Abbott <bpabbott>
Project Member
Thu Feb 2 19:53:36 2012, original submission:

Using gnuplot, the example below gives me two plots what are each the correct size.

With fltk, the first is correct, but the 2nd is not. For me on MacOS X, the 2nd produces a sombrero with the proper aspect ratio, but it only fills the UL quadrant of 900 × 886 plot. The size should be 900 x 1200.

I'm running the default branch, and my tip is

Ben Abbott <bpabbott>
Project Member


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

Attach File(s):

Attached Files
file #27094:  test.png added by logari81 (12kB - image/png - print higher than the display)
file #25063:  foo-fltk.png added by muhali (256kB - image/png)
file #25064:  bar-fltk.png added by muhali (245B - image/png)
file #25065:  foo-gnuplot.png added by muhali (168kB - image/png)
file #25066:  bar-gnuplot.png added by muhali (1kB - image/png)
file #25056:  foo_i.png added by muhali (252kB - image/png)
file #25057:  bar_i.png added by muhali (89kB - image/png)
file #25058:  foo_s.png added by muhali (265kB - image/png)
file #25059:  bar_s.png added by muhali (90kB - image/png)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by godfrey (Posted a comment)
  • -unavailable- added by logari81 (Updated the item)
  • -unavailable- added by bpabbott (Submitted the item)

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

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 16 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri Nov 18 05:50:24 2016rik5StatusPostponed=>Fixed
    Fri Dec 14 11:41:35 2012logari81StatusConfirmed=>Postponed
    Fri Dec 14 11:22:14 2012logari81Attached File-=>Added test.png, #27094
    Fri Feb 17 23:41:10 2012bpabbottStatusWont Fix=>Postponed
    Fri Feb 17 01:45:48 2012bpabbottSummaryfltk printed png is the wrong size=>fltk printed png is restricted by display size
    Tue Feb 14 17:02:50 2012muhaliAttached File-=>Added foo-fltk.png, #25063
      Attached File-=>Added bar-fltk.png, #25064
      Attached File-=>Added foo-gnuplot.png, #25065
      Attached File-=>Added bar-gnuplot.png, #25066
    Tue Feb 14 02:01:49 2012bpabbottStatusNone=>Wont Fix
    Mon Feb 13 22:47:33 2012muhaliAttached File-=>Added foo_i.png, #25056
      Attached File-=>Added bar_i.png, #25057
      Attached File-=>Added foo_s.png, #25058
      Attached File-=>Added bar_s.png, #25059

    Back to the top

    Powered by Savane 3.1-cleanup1