前節と同様に, y 方向に座標値が等間隔な場合にも, y を指定するか わりに rundef を指定します. 次のプログラム u1d2 では, usspnt, uumrk, uulin の各ルーチンで y を未定義値と しています. ここでは usspnt ルーチンを使ってウインドウを決め, ビュー ポートの設定は初期値に頼りますので, grstrf ルーチンの前に uspfit を呼んでいることを再確認しておきましょう. なお, 変換メソッド(元関数)番号を 3として, 片対数座標にしています.
# u1d2.rb
require "narray"
require "numru/dcl"
include NumRu
include Math
nmax = 50
ymin = 0.0
ymax = 50.0
x1 = NArray.sfloat(nmax+1)
x2 = NArray.sfloat(nmax+1)
#-- data ----
iseed = 0
for n in 0..nmax
  y = ymin + (ymax-ymin)*n/nmax
  x1[n] = 10.0*(exp(-y/20))**2 * exp((rand(iseed)-0.5)*2)**2
  x2[n] = 10.0*(exp(-y/20))**2
end
rundef = DCL::glrget('RUNDEF')
#-- graph ----
iws = (ARGV[0] || (puts ' WORKSTATION ID (I)  ? ;'; DCL::sgpwsn; gets)).to_i
DCL::gropn iws
DCL::grfrm
DCL::grswnd(rundef, rundef, ymin, ymax)
DCL::usspnt(x1, rundef)
DCL::usspnt(x2, rundef)
DCL::grstrn(3)
DCL::uspfit
DCL::grstrf
DCL::ussttl('MIXING RATIO', 'ppmv', 'HEIGHT', 'km')
DCL::usdaxs
DCL::uusmkt(2)
DCL::uumrk(x1, rundef)
DCL::uulin(x2, rundef)
DCL::grcls
   
program u1d2      
