This HTML automatically generated with rman for NEMO
Table of Contents

Name

yapp - simple scripting interface to yapp

Synopsis

yapp [parameter=value]

Description

YAPP (Yet Another Plotting Package) is the plotting interface for most NEMO programs. The yapp= program keyword (see getparam(3NEMO) and nemo(1NEMO) ) controls how the selected yapp library uses it for graphics output. For example for the yapp_ps driver it designates the PS filename, which usually defaults to yapp.ps but can be changed
      yapp=fig2.ps
and with the versatile yapp_pgplot interface the output can be redirected to a larger number of interactive and non-interacive devices, e.g.
    yapp=3/xs
    yapp=fig4.ps/ps
    yapp=color.ps/cps

However to write scripts in a portable way (semi-automatically switching devices) and incrementing figure numbers in case there are more than one, can be a bit challenging.

Parameters

The following parameters are recognized in order; they may be given in any order if the keyword is also given. Use --help to confirm this man page is up to date.
name=
Override for yapp= system keyword (*** = default)
layout=
Optional layout file []

Csh Examples

In the case of a yapp device that can switch between graphics output, here is an awkward csh-example (csh does not have functions) with the PGPLOT_YAPP driver , how to auto-increment your output devices:
#  before the script starts, assign two variables and initialize the $yapp
set yapps = yapp%d.ps/vcps    # yapp printf string (%d/xs, yapp%d.ps/vcps)
set yappn = 1                 # first yapp number
set yapp  = ‘printf $yapps $yappn‘ ; @ yappn++   # increment counter
#  call you program that needs the yapp=$yapp argument
#  but follow it with the incrementor line
tabplot .... yapp=$yapp
set yapp=‘printf $yapps $yappn‘ ; @ yappn++
So each time a new figure is made, the set yapp= line needs to be cloned. Awkward. Lets see how this works in (BA)SH:

Sh Examples

Life in bash is simpler, since it allows functions, although they don’t return values, they simply need to echo something. For example this function can deal with YAPP_PGPLOT and YAPP_PS:
yapp() {
  if test $yapp = "xs"; then
     echo $1/$yapp
  elif test $yapp = "_ps"; then
     echo fig$1.ps
  else
     echo fig$1.$yapp/$yapp
  fi
}
with this definition your code can simply do things like
   yapp=xs                 # pick ’xs’, ’ps’, ’png’, ’_ps’
   echo yapp=$(yapp 11)    # this should diplay a nice yapp= formatted
line

See Also

printf(1) , yapp(3NEMO) , yapp(5NEMO) , yapp_query(8NEMO) , layout(5NEMO)

Files

$NEMO/src/tutor/main/main.sh

Author

Peter Teuben

Update History


03-Jul-19    Created        PJT
27-dec-2019    added bash example    PJT
14-jul-2021    example        PJT


Table of Contents