|
From: Ethan A M. <merritt@u.washington.edu> - 2009-02-16 19:09:09
|
On Monday 16 February 2009, Petr Mikulik wrote: > > > User/script writes in a portable and elegant way: > > > set term screen title 'hello' > > > set term screen 4 > > > set term screen 5 size 400,400 > > > > set macros > > screen = GPVAL_TERM > > ... > > set term @screen title 'hello' > > set term @screen 4 > > set term @screen 5 size 400,400 > > Good idea. That's actually the solution working in both gnuplot 4.2 and 4.3. > > > Another possibility is to have the "set term" command accept > > the terminal name as a string. > > screen = "x11" > > set term screen 5 size 400,400 > > Cool, your patch (committed to cvs) works fine. > However, I think that the keyword should have preference, not string > variables: > > gnuplot> gif='figure.gif' > gnuplot> set out gif > gnuplot> set term gif > ^ > unknown or ambiguous terminal type; type just 'set terminal' for a list OK. Done. > or with "po" variable (abbreviation of "postscript"). The string is passed to exactly the same routine for checking against the list of terminal names. The rules for matching are the same as they have always been. > I think it may be useful to define > GPVAL_TERM_DEFAULT > to the default startup terminal name, i.e. the same as the default "pushed" > terminal. Then we will have e.g. > GNUTERM = "wxt" > GPVAL_TERM_DEFAULT = "x11" > GPVAL_TERM = "postscript" > Then, external programs (Octave) could use either > set macros; screen=GPVAL_TERM > set term @screen ...options... > on 4.2 or > set term GPVAL_TERM_DEFAULT ...options... > on 4.3. By the way, the use of macros is nice for another reason: Suppose you set the environmental variable GNUTERM to setenv GNUTERM "post eps color solid size 5in, 3in" When you enter gnuplot, the terminal will just be "post". But if you immediately say set macros set term @GNUTERM then you will get all of the requested terminal properties also. This can be quite nice for scripting. -- Ethan A Merritt |