CUDA
C/C++    Fortran   

Visualizing data

Matrix Interface: Surface plot of 2D data.

    array a(seq(10));
    a = tile(a,1,10);

    //a = 10 columns, each containing numbers 0-9
    surface(a);
Parameters:
[in]X2D matrix with which to draw simple surface plot

handle surface (const af::array &X)

Matrix Interface: Visualize 2D velocity field with an array of arrows

   array a(seq(10));

   //create arrows along the diagonal
   //the arrows rotate around the unit circle
   arrows(a,a, cos(a), sin(a));
Parameters:
[in]X0,Y0coordinates of points from which to draw
[in]X1,Y1coordinates of points to which to draw

handle arrows (const af::array &X0, const af::array &Y0, const af::array &X1, const af::array &Y1)

Matrix Interface: Visualize 1D data as a line plot

Parameters:
[in]Xmatrix containing data to be visualized
[in]linestyleoptional string indicating desired characteristics of plot

handle plot2 (const af::array &X)
handle plot2 (const af::array &X, const char *linestyle)

Matrix Interface: Visualize 2D data as a line plot

Parameters:
[in]Xmatrix containing horizontal data to be visualized
[in]Ymatrix containing vertical data to be visualized
[in]linestyleoptional string indicating desired characteristics of plot

handle plot2 (const array &X, const array &Y)
handle plot2 (const array &X, const array &Y, const char *linestyle)

Matrix Interface: Visualize 3D data as scatter plot

   array a(seq(10));
   array b = a + randu(10);

   plot3(a,b,a);
Parameters:
[in]Xmatrix containing X data to be visualized
[in]Ymatrix containing Y data to be visualized
[in]Zmatrix containing Z data to be visualized

handle plot3 (const af::array &X, const af::array &Y, const af::array &Z)

Matrix Interface: Visualize 3D data volume

   array a( seq( 0, 0.1, 1 ) );
   a = tile(a, 1, 10, 10);

   //a is symmetric in the y and z dimensions and increases along the x dimension
   volume(a);
Parameters:
[in]X3D array to be volume rendered

handle volume (const af::array &X)

Matrix Interface: Visualize 2D data as single scale image

If 3D and last dimension is three (3), it is treated as a color image with red, green, blue channels.
   array a(seq(10));
   a = tile(a,1,10);
   a += a.T();

   image(a);
Parameters:
[in]X2D matrix to be visualized
Note:
Automatically scales palette based on min/max values

handle image (const af::array &X)

Display a figure window

handle fig (const char *key, const char *val=NULL)

Create figure with tiled layout.

handle fig (const char *key, int nx, int ny, int i)

Display the current figure with given geometry

Parameters:
[in]xThe horizontal position of the upper left corner of the figure
[in]yThe vertical position of the upper left corner of the figure
[in]wThe width of the figure
[in]hThe height of the figure

handle fig (int x, int y, int w, int h)

Function Documentation

handle af::surface ( const af::array X)
handle af::arrows ( const af::array X0,
const af::array Y0,
const af::array X1,
const af::array Y1 
)
handle af::plot2 ( const af::array X,
const char *  linestyle 
)
handle af::plot2 ( const array &  X,
const array &  Y 
)
handle af::plot2 ( const array &  X,
const array &  Y,
const char *  linestyle 
)
handle af::volume ( const af::array X)
handle af::fig ( const char *  key,
int  nx,
int  ny,
int  i 
)
handle af::fig ( int  x,
int  y,
int  w,
int  h 
)