help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

drawnow terminal type


From: Paul Kienzle
Subject: drawnow terminal type
Date: Sat, 14 Jul 2007 16:53:44 -0400


On Jul 14, 2007, at 3:12 PM, Owen Densmore wrote:

Just to quickly catch up on the workaround which comments out this line:
    cmd = sprintf ("%s -title \"Figure %d\"", cmd, h);

.. I just looked at the gnuplot manuals, both an earlier 3.7 manual, and the current 4.2 manual. The statement on command-line processing sez: "Any command-line arguments are assumed to be names of files containing gnuplot commands, with the exception of standard X11 arguments, which are processed first. Each file is loaded with the load command, in the order specified. gnuplot exits after the last file is processed. When no load files are named, gnuplot enters into an interactive mode. The special filename "-" is used to denote standard input. See "help batch/interactive" for more details." (Note: this is not quite correct .. -h for help, and -V for version are also allowed.)

Thus the -title portion is presumably an X11 argument, and thus explains the failure I experienced.

If I'm right, this should only be invoked with X11:
  if (! isempty (h) && gnuplot_use_title_option ())
    cmd = sprintf ("%s -title \"Figure %d\"", cmd, h);
  endif

So I poked around a bit to see why octave presumed I was using X11. Answer? .. I had the DISPLAY variable set to :0.0! Not sure why, possibly due to earlier stunts, or use of ssh with the -X option.

Unsetting DISPLAY made the /usr/local version of octave work perfectly, calling gnuplot with its default aquaterm. (Note that the /usr/local octave has an empty drawnow.m, thus the plotting protocol is handled in some other way.)

Using the MacOSX version, however, I ended up getting text/dumb plotting rather than gnuplot/aquaterm usage! That is apparently due to the lines:
    elseif (isunix () && isempty (getenv ("DISPLAY")))
      fprintf (plot_stream, "set terminal dumb\n;");
.. and hence I now understand the suggestions here to modify this if .. endif section to be better for the Mac.

Whew!

I'm dubious that checking the DISPLAY is the right way to go.

Does this seem like I've grasped the details here? I'm an absolute newbie with octave! Thanks a billion for all the help, by the way.

The details are right. One other thing to note is that X11 allows setting of the terminal type via

        set term x11 -title "Figure 3"

so it could be handled like the others.

Please try the attached drawnow.m.

It first checks GNUTERM, then checks DISPLAY then defaults to 'windows' if not unix or 'aqua' if unix. This should cover everybody except those trying to set the terminal in ~/.gnuplot.

Note I may have a typo in the script --- the box I'm sitting at does not have octave 2.9.12 installed so I can't test it myself. I also haven't tested on 3.x versions of gnuplot.

        - Paul


Attachment: drawnow.m
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]