bugGNU Octave - Bugs: bug #44932, Add support for gnuplot xterm...


bug #44932: Add support for gnuplot xterm terminal type

Submitted by:  None
Submitted on:  Mon 27 Apr 2015 01:04:19 AM UTC  
Category:  Plotting with gnuplot Severity:  1 - Wish
Priority:  3 - Low Item Group:  Feature Request
Status:  Confirmed Assigned to:  None
Originator Name:  Aaron Jackson Originator Email:  -email is unavailable-
Open/Closed:  Open Release:  dev
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)

Sat 19 Dec 2015 01:18:14 AM UTC, comment #10:

No. I Octave still hangs. I have no problem with other gnuplot terminals.

Ben Abbott <bpabbott>
Project Member
Sat 19 Dec 2015 01:08:17 AM UTC, comment #9:


plot (rand (3))
pause (10)
plot (rand (3))

work for you?
If so, this looks like the age old timing glitch
in the plot code. I thought that this had been
dealt with a while ago, but maybe not in the gnuplot

Michael Godfrey <godfrey>
Project Member
Sat 19 Dec 2015 12:37:53 AM UTC, comment #8:


When I try your patch my octave gets hung up with by

If I insert a "close all" between the two plot commands, then everything works. I'm running Gnuplot v5 on Mac OS X.

Do you see the same behavior? If so, we may need some more effort to improve the user friendliness.

Ben Abbott <bpabbott>
Project Member
Tue 28 Apr 2015 11:09:14 AM UTC, comment #7:

Silly me - I realised it was a race condition. Attached is a fairly clean patch.

(file #33822)

Aaron Jackson <aaronjackson>
Tue 28 Apr 2015 10:35:38 AM UTC, comment #6:

Attached is the patch. Thanks for your help Mike.

(file #33820)

Aaron Jackson <aaronjackson>
Tue 28 Apr 2015 12:52:03 AM UTC, comment #5:

You might as well post your patch here on this bug report so others interested can find it in the most relevant place. Even if it is not ideal and not suitable for inclusion in Octave yet. Someone else may be able to find a different way to make it work.

Mike Miller <mtmiller>
Project Administrator
Mon 27 Apr 2015 05:41:43 PM UTC, comment #4:

So I managed to get it to work, but the patch is not particularly nice.

When gnuplot is set to xterm, it will not output to a file in the same way as it would when set to dumb. This means I am forced to get the output from popen2, which stops working after the first read. The only way I could get it to work repeatedly is to SIGTERM gnuplot and set _plot_stream_ to [].

This works fine until you put it in a loop. The rapid forking and terminating of gnuplot seems to cause errors.

I do not think my patch is worthy of a merge, but I am happy to share if people want it.

Mon 27 Apr 2015 01:39:46 PM UTC, comment #3:

Ok, I see what you're talking about now. I agree, this does not work, and there is probably some scripting support needed in the gnuplot m-files to support this terminal type. I now see there are some special cases for the "dumb" type, where the plot goes to stdout, it is actually written to a file, read back and then printed to the terminal. It probably needs something similar for "xterm" or any other terminal types where the plot data is expected to come over stdout back to the terminal that Octave is running on. Please feel free to provide a patch to make this work if you are interested in seeing support for this added to Octave.

Mike Miller <mtmiller>
Project Administrator
Mon 27 Apr 2015 10:18:50 AM UTC, comment #2:

Setting GNUTERM to dumb works fine, if you set it to xterm, it would just spew out the data which xterm will parse.

It should be as simple as setenv('GNUTERM', 'xterm') - if you are using an xterm, the tektronix plot will appear in a new window.

I tried to make this work by adding xterm to the list in output_to_screen, in _gnuplot_drawnow_.m, although this should not be necessary. I am assuming there is another issue somewhere.

Mon 27 Apr 2015 01:42:16 AM UTC, comment #1:

Thanks for your bug report. What have you tried to make this work? I am not familiar with the plotting mode you are talking about in gnuplot, so how do you make it work with gnuplot? You'll have to give some more details on what you did and what doesn't work as expected. Do you have to "set term" to a specific terminal mode? If so, just set the GNUTERM environment variable in Octave to do the same. Octave should respect whatever GNUTERM is set to. If I `setenv GNUTERM dumb`, I get ascii-art plots as I expect.

Mike Miller <mtmiller>
Project Administrator
Mon 27 Apr 2015 01:04:19 AM UTC, original submission:

I use GNU Plot over SSH in an xterm, as plots will appear nicely using the tektronix mode without the need for X forwarding.

Am I right in thinking the same should be happening when in GNU Octave? No window appears.



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

Attach Files:

Attached Files
file #33822:  xtermfix.diff added by aaronjackson (2KiB - text/x-patch)
file #33820:  xtermfix.diff added by aaronjackson (2KiB - text/x-patch)


Depends on the following items: None found

   bug dependencies.


Carbon-Copy List
  • -email is unavailable- added by godfrey (Posted a comment)
  • -email is unavailable- added by bpabbott (Posted a comment)
  • -email is unavailable- added by aaronjackson (Updated the item)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by None (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 11 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-24 mtmiller Dependencies- => bugs #49333 is dependent
    2015-04-28 aaronjackson Attached File- => Added xtermfix.diff, #33822
    2015-04-28 aaronjackson Attached File- => Added xtermfix.diff, #33820
    2015-04-27 mtmiller Severity3 - Normal => 1 - Wish
        Priority5 - Normal => 3 - Low
        Item GroupIncorrect Result => Feature Request
        StatusNeed Info => Confirmed
        Release3.8.1 => dev
        Summaryxterm plotting => Add support for gnuplot xterm terminal type
    2015-04-27 mtmiller Item GroupNone => Incorrect Result
        StatusNone => Need Info

    Back to the top

    Powered by Savane 3.3