bugGNU Octave - Bugs: bug #56731, gnuplot uses multiplot mode (qt...


bug #56731: gnuplot uses multiplot mode (qt driver) by default in GUI but chooses a driver without multiplot in CLI

Submitted by:  Petr Mikulik <mikulik>
Submitted on:  Thu 08 Aug 2019 09:41:35 AM UTC  
Category:  Plotting with gnuplot Severity:  2 - Minor
Priority:  3 - Low Item Group:  Other
Status:  Invalid Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  5.1.0 Operating System:  GNU/Linux

Add a New Comment (Rich Markup)

You are not logged in

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


( Jump to the original submission)

Thu 22 Aug 2019 03:03:54 PM UTC, comment #6: 

Well, I reported this issue to figure out whether this unclosed multiplot is a bug or not. Now I see that it is an internal way how to plot correctly using all gnuplot terminals (in this case qt).

I figured it out when using an older script for a special histogram plot which sends gnuplot commands to the drawing stream directly. Sending "unset multiplot" does not hurt.

This feature is not seen during a standard use of Octave.

Thus, it is not a bug and this request can be closed.

Petr Mikulik <mikulik>
Wed 21 Aug 2019 07:21:22 PM UTC, comment #5: 

I don't know.  That was my last question as well.  Is there any example where the displayed or printed output is different based on this setting (and not the gnuplot terminal setting which will create a difference)?

Rik <rik5>
Project Administrator
Wed 21 Aug 2019 06:08:14 PM UTC, comment #4: 

Yeah, my point is from the point of view of a user who doesn't use gnuplot directly, who only uses Octave drawing and plotting functions, is there any bug caused by this difference?

Mike Miller <mtmiller>
Project Administrator
Wed 21 Aug 2019 02:52:43 AM UTC, comment #3: 

I suppose the issue is that this option is not configurable.  If the user chooses a particular terminal that Octave considers buggy then it will unset multiplot mode to prevent flicker.  There is no override by the user.

On the other hand, if there is no example where the displayed or printed output is different then who cares?

Rik <rik5>
Project Administrator
Tue 20 Aug 2019 08:11:43 PM UTC, comment #2: 

Does the use of multiplot mode or not affect any Octave drawing functions? Or does this only affect users who know how to use gnuplot directly?

From what I've read and understand here so far, this is not a bug, but simply a default configuration that the user ultimately has the option to override if needed.

Mike Miller <mtmiller>
Project Administrator
Thu 08 Aug 2019 03:54:51 PM UTC, comment #1: 

The issue is that some of the gnuplot backends don't work as well as others.  See this code in _gnuplot_drawnow_.m

  ## Work around the gnuplot feature of growing the x11 window and
  ## flickering window (x11, windows, & wxt) when the mouse and
  ## multiplot are set in gnuplot.
  fputs (plot_stream, "unset multiplot;\n");
  flickering_terms = {"x11", "windows", "wxt", "dumb"};
  if (! any (strcmp (term, flickering_terms))
      || have_non_legend_axes (h)
      || numel (findall (h, "type", "image")) > 0)
    fprintf (plot_stream, "%s\n", term_str);
    if (nargin == 5)
      if (! isempty (file))
        fprintf (plot_stream, "set output '%s';\n", file);
    fputs (plot_stream, "set multiplot;\n");
  elseif (any (strcmp (term, flickering_terms)))
    fprintf (plot_stream, "%s\n", term_str);
    if (nargin == 5)
      if (! isempty (file))
        fprintf (plot_stream, "set output '%s';\n", file);
  if (! __gnuplot_has_feature__ ("dashtype"))
    fprintf (plot_stream, "set termoption dashed\n");
  ## gnuplot will pick up the GNUTERM environment variable itself
  ## so no need to set the terminal type if not also setting the
  ## figure title, enhanced mode, or position.

Try setting the environment variable GNUTERM to your desired backend before starting either the CLI or GUI version of Octave.  If you choose the qt backend you will find that multiplot is set in the CLI as well.  Sample session

~/wip/Projects_Mine/octave-stable: setenv GNUTERM qt
~/wip/Projects_Mine/octave-stable: octave-5.1.0 -f -q --no-gui

octave:1> graphics_toolkit gnuplot
octave:2> f = gcf();
octave:3> drawnow();
octave:4> stream = get(f, '__plot_stream__');
octave:5> fprintf(stream, 'show multiplot;\n');
octave:6> fflush(stream);
octave:7> multiplot mode is on

Rik <rik5>
Project Administrator
Thu 08 Aug 2019 09:41:35 AM UTC, original submission:  

When gnuplot is selected as the graphics toolkit, then gnuplot is set to multiplot mode in GUI-Octave while to normal non-multiplot mode in CLI-Octave. Thus some drawing scripts relying on gnuplot work well in CLI-Octave while they are broken in the GUI-Octave. I think the multiplot mode should be off in both cases.


graphics_toolkit gnuplot
graw('show multiplot;\n');

When running Octave as "octave" or "octave-cli", then it shows

    multiplot mode is off

while "octave --gui" shows

    multiplot mode is on

Example code with graw() expanded:

graphics_toolkit gnuplot
f = gcf();
stream = get(f, '__plot_stream__');
fprintf(stream, 'show multiplot;\n');

Petr Mikulik <mikulik>


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

Attach Files:

No files currently attached


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

    Date Changed by Updated Field Previous Value => Replaced by
    2019-08-22 rik5 StatusNeed Info => Invalid
        Open/ClosedOpen => Closed
    2019-08-20 mtmiller StatusNone => Need Info
    2019-08-08 rik5 Severity3 - Normal => 2 - Minor
        Priority5 - Normal => 3 - Low
        Item GroupRegression => Other
        Summarygnuplot set to multiplot mode in GUI Octave => gnuplot uses multiplot mode (qt driver) by default in GUI but chooses a driver without multiplot in CLI

    Back to the top

    Powered by Savane 3.5