Passing data by direct assignments

This example shows how a SCAN GQE is created by the create() method and how the data are manipulated.

#!/usr/bin/perl

use Spectra; 
use GQE; 

cls();
 
$size = 100;

#
# create a SCAN t1 and ...
#
$t1 = SCAN->create( name => "t1",
                    start => 0, 
                    stop => 10, 
                    np => $size) or 
  die " Failed to create t1 "; 
#
# ... set the y-values to sinus() ...
#
for $i (0 .. ($size - 1))
{
    $t1->{y}[$i] = sin( $t1->{x}[$i]);
}
#
# ... and write it to a file (t1.fio).
#
$ret = $t1->write( noconfirm => "yes"); 

$t1->set( at => "(2,2,3)", colour => "red"); 

Spectra::autoscale(); 
Spectra::display(); 
#
# cleanup
#
$t1->delete();