bugGNU Octave - Bugs: bug #44567, Qt graphics toolkit displays twice...

 
 

bug #44567: Qt graphics toolkit displays twice when opening a new figure via plot or image.

Submitted by:  Dan Sebald <sebald>
Submitted on:  Wed 18 Mar 2015 07:06:28 AM UTC  
 
Category: Plotting with OpenGLSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Performance
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 19 Mar 2015 05:58:16 PM UTC, comment #4:

The code in comment #3 works for me. I don't get a doubly drawn figure.

Rik <rik5>
Project Administrator
Thu 19 Mar 2015 05:59:06 AM UTC, comment #3:

I just tried this example from https://savannah.gnu.org/bugs/?44526:

and the first time the sombrero appears there are back-to-back displays, once in 2D, then in 3D.

Maybe something has changed regarding holding off display inside a function until an appropriate time like pause().

Dan Sebald <sebald>
Thu 19 Mar 2015 05:40:13 AM UTC, comment #2:

Much better.

The reason I thought it happened with plot as well is that I tried the example from bug https://savannah.gnu.org/bugs/?44564

and noticed that the plot is shown twice. But that is because there is an axis() command that follows the plot:

I tried changing the spy.m code so that there is only one draw, e.g., passing properties into plot(), placing axis() before plot(). Maybe changing a figure property so that drawing is not done immediately. Couldn't find anything, but it sure seems like such a technique should be possible.

Dan Sebald <sebald>
Wed 18 Mar 2015 06:34:18 PM UTC, comment #1:

The root cause is in image.m.

The image is drawn by _go_image_ which apparently uses automatic scaling of the axes limits. This is appropriate for ordinary data plots, but not for images where the axis should just contain the object. So, the next thing the m-file does is apply 'axis (hax, "tight")', but only if it is a new figure (do_new).

Incidentally, I get a doubly drawn image with both the FLTK and Qt toolkits.

I pushed a cset to fix this http://hg.savannah.gnu.org/hgweb/octave/rev/2e7497ff2535.

Using test code:

I find the previous implementation took 3.4 second while the new one takes 0.6 seconds.

I didn't see any problems with other image demos so I don't think it impacted the correctness of the function.

Rik <rik5>
Project Administrator
Wed 18 Mar 2015 07:06:28 AM UTC, original submission:

When an integrated Qt plot() or image() is done, the display occurs twice when the figure window is created initiated by the command. This does not happen in gnuplot or FLTK graphics toolkits.

Try the following after just starting Octave or making sure that all plot windows are closed:

and watch for the repeated display of the image--once as a smaller image then followed by the image at the correct size.

Try again with the plot window still open:

and the image only is displayed once.

Close all windows or exit and re-enter Octave. Now try (individual commands with wait a between or copied simultaneous):

and the image only is drawn once.

Dan Sebald <sebald>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

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 sebald (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 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 18 Mar 2015 06:34:18 PM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1