Plotting Analysis Objects


The data in an AO can be plotted using the iplot method.

The iplot method provides an advanced plotting interface for AOs which tries to make good use of all the information contained within the input AOs. For example, if the xunits and yunits fields of the input AOs are set, these labels are used on the plot labels.

In addition, iplot can be configured using a input plist. The following examples show some of the possible ways to use iplot

    >> a1 = ao(plist('tsfcn', 'sin(2*pi*0.3*t) + randn(size(t))', 'fs', 10, 'nsecs', 20))
    ----------- ao 01: a1 -----------
 
           name:  None
           data: (0,0.887479404587351) (0.1,-0.449797172615395) (0.2,0.479022102390939) ...
                 -------- tsdata 01 ------------
              
                     fs:  10
                      x:  [200 1], double
                      y:  [200 1], double
                     dx:  [0 0], double
                     dy:  [0 0], double
                 xunits:  [s]
                 yunits:  []
                  nsecs:  20
                     t0:  1970-01-01 00:00:00.000
                 -------------------------------
                  
           hist:  ao / ao / SId: fromTSfcn ... $-->$Id: ao ... S
        mdlfile:  empty
    description:  
           UUID:  67d31c2f-8ee5-42ba-a96b-cfb288ecc9ea
    ---------------------------------

    >> a1.data
    -------- tsdata 01 ------------
 
        fs:  10
         x:  [200 1], double
         y:  [200 1], double
        dx:  [0 0], double
        dy:  [0 0], double
    xunits:  [s]
    yunits:  []
     nsecs:  20
        t0:  1970-01-01 00:00:00.000
    -------------------------------

Creates a time-series AO. If we look at the data object contained in this AO, we see that the xunits are set to the defaults of seconds [s].

If we plot this object with iplot we see these units reflected in the x and y axis labels.

    >> iplot(a1)
AO iplot eg1

We also see that the time-origin of the data (t0 field of the tsdata class) is displayed as the plot title.



©LTP Team