Graphics-PLplot

 view release on metacpan or  search on metacpan

PLplot.xs  view on Meta::CPAN



void
c_plaxes( x0, y0, xopt, xtick, nxsub, yopt, ytick, nysub )
  PLFLT x0
  PLFLT y0
  char * xopt
  PLFLT xtick
  PLINT nxsub
  char * yopt
  PLFLT ytick
  PLINT nysub

void
c_plbin( x, y, center )
  PLFLT * x
  PLFLT * y
  PLINT center
 CODE:
  c_plbin( ix_x, x, y, center);

void
c_plbop()
 ALIAS:
  plpage = 1

void
c_plbox(xopt, xtick, nxsub, yopt, ytick, nysub)
  char * xopt
  PLFLT xtick
  PLINT nxsub
  char * yopt
  PLFLT ytick
  PLINT nysub

void
c_plbox3( xopt, xlabel, xtick, nxsub, yopt, ylabel, ytick, nysub, zopt, zlabel, ztick, nzsub)
  char * xopt
  char * xlabel
  PLFLT xtick
  PLINT nxsub
  char * yopt
  char * ylabel
  PLFLT ytick
  PLINT nysub
  char * zopt
  char * zlabel
  PLFLT ztick
  PLINT nzsub

# ($wx, $wy, $window ) = plcalc_world( $rx, $ry );

void
c_plcalc_world( rx, ry)
  PLFLT rx
  PLFLT ry
 PREINIT:
  PLFLT wx;
  PLFLT wy;
  PLINT window;
 PPCODE:
  c_plcalc_world( rx, ry, &wx, &wy, &window );
  XPUSHs( sv_2mortal(newSVnv(wx)));
  XPUSHs( sv_2mortal(newSVnv(wy)));
  XPUSHs( sv_2mortal(newSViv(window)));


void
c_plclear()


void
c_plcol0( color )
  PLINT color
 ALIAS:
  plcol = 1

void
c_plcol1( color )
  PLFLT color

# plcont XXXXX

# plcpstrm

void
c_plcpstrm( iplsr, flags)
  PLINT iplsr
  PLINT flags


# plend

void
c_plend()

void
c_plend1()

# plenv

void
c_plenv( xmin, xmax, ymin, ymax, just, axis )
  PLFLT xmin
  PLFLT xmax
  PLFLT ymin
  PLFLT ymax
  PLINT just
  PLINT axis

void
c_plenv0( xmin, xmax, ymin, ymax, just, axis )
  PLFLT xmin
  PLFLT xmax
  PLFLT ymin
  PLFLT ymax
  PLINT just
  PLINT axis

void
c_pleop()

PLplot.xs  view on Meta::CPAN

  plclr = 1

void
c_plerrx( xmin, xmax, y )
  PLFLT * xmin
  PLFLT * xmax
  PLFLT * y
 CODE:
  c_plerrx( ix_y, xmin, xmax, y );


void
c_plerry( x, ymin, ymax )
  PLFLT * x
  PLFLT * ymin
  PLFLT * ymax
 CODE:
  c_plerry( ix_x, x, ymin, ymax );

void
c_plfamadv()

void
c_plfill( x, y )
  PLFLT * x
  PLFLT * y
 CODE:
  c_plfill( ix_x, x, y );

void
c_plfill3( x, y, z )
  PLFLT * x
  PLFLT * y
  PLFLT * z
 CODE:
  c_plfill3( ix_x, x, y, z );


# plflush

void
c_plflush()

# plfont

void
c_plfont( input )
  PLINT input

void
c_plfontld( set )
  PLINT set

# plgchr

void
c_plgchr()
 PREINIT:
  PLFLT p_def;
  PLFLT p_ht;
 PPCODE:
  c_plgchr( &p_def, &p_ht );
  XPUSHs( sv_2mortal(newSVnv(p_def)));
  XPUSHs( sv_2mortal(newSVnv(p_ht)));

void
c_plgcol0(icol0)
  PLINT icol0
 PREINIT:
  PLINT r;
  PLINT g;
  PLINT b;
 PPCODE:
  c_plgcol0( icol0, &r, &g, &b );
  XPUSHs( sv_2mortal(newSViv(r)));
  XPUSHs( sv_2mortal(newSViv(g)));
  XPUSHs( sv_2mortal(newSViv(b)));

void
c_plgcolbg()
 PREINIT:
  PLINT r;
  PLINT g;
  PLINT b;
 PPCODE:
  c_plgcolbg( &r, &g, &b );
  XPUSHs( sv_2mortal(newSViv(r)));
  XPUSHs( sv_2mortal(newSViv(g)));
  XPUSHs( sv_2mortal(newSViv(b)));

PLINT
plgcompression()
 CODE:
  plgcompression( &RETVAL );
 OUTPUT:
  RETVAL

char *
c_plgdev()
 PREINIT:
   char ver[80];
 CODE:
   RETVAL = ver;
   c_plgdev( RETVAL );
 OUTPUT:
   RETVAL

void
c_plgdidev()
 PREINIT:
  PLFLT p_mar;
  PLFLT p_aspect;
  PLFLT p_jx;
  PLFLT p_jy;
 PPCODE:
  c_plgdidev( &p_mar, &p_aspect, &p_jx, &p_jy );
  XPUSHs( sv_2mortal(newSVnv(p_mar)));
  XPUSHs( sv_2mortal(newSVnv(p_aspect)));
  XPUSHs( sv_2mortal(newSVnv(p_jx)));
  XPUSHs( sv_2mortal(newSVnv(p_jy)));

PLFLT
plgdiori()
 CODE:
  plgdiori( &RETVAL );
 OUTPUT:
  RETVAL

void
c_plgdiplt()
 PREINIT:
  PLFLT p_xmin;
  PLFLT p_ymin;
  PLFLT p_xmax;
  PLFLT p_ymax;
 PPCODE:
  c_plgdiplt( &p_xmin, &p_ymin, &p_xmax, &p_ymax );
  XPUSHs( sv_2mortal(newSVnv(p_xmin)));
  XPUSHs( sv_2mortal(newSVnv(p_ymin)));
  XPUSHs( sv_2mortal(newSVnv(p_xmax)));
  XPUSHs( sv_2mortal(newSVnv(p_ymax)));


void
c_plgfam()
 PREINIT:
  PLINT fam;
  PLINT num;
  PLINT bmax;
 PPCODE:
  c_plgfam( &fam, &num, &bmax );
  XPUSHs( sv_2mortal(newSViv(fam)));
  XPUSHs( sv_2mortal(newSViv(num)));
  XPUSHs( sv_2mortal(newSViv(bmax)));


char *
c_plgfnam()
 PREINIT:
   char ver[80];
 CODE:
   RETVAL = ver;
   c_plgfnam( RETVAL );
 OUTPUT:
   RETVAL

PLINT
c_plglevel()
 CODE:
   c_plglevel( &RETVAL );
 OUTPUT:
   RETVAL

void
c_plgpage()
 PREINIT:
  PLFLT xp;
  PLFLT yp;
  PLINT xleng;
  PLINT yleng;
  PLINT xoff;
  PLINT yoff;
 PPCODE:
  c_plgpage( &xp, &yp, &xleng, &yleng, &xoff, &yoff);
  XPUSHs( sv_2mortal(newSVnv(xp)));
  XPUSHs( sv_2mortal(newSVnv(yp)));
  XPUSHs( sv_2mortal(newSViv(xleng)));
  XPUSHs( sv_2mortal(newSViv(yleng)));
  XPUSHs( sv_2mortal(newSViv(xoff)));
  XPUSHs( sv_2mortal(newSViv(yoff)));

void
plgra()

#  plgriddata - XXXXX Not yet
#    Need to know what to do with the 1-D perl output array
#    How do we make it usable without PDL?


void
c_plgspa()
 PREINIT:
  PLFLT xmin;
  PLFLT ymin;
  PLFLT xmax;
  PLFLT ymax;
 PPCODE:
  c_plgspa( &xmin, &ymin, &xmax, &ymax );
  XPUSHs( sv_2mortal(newSVnv(xmin)));
  XPUSHs( sv_2mortal(newSVnv(ymin)));
  XPUSHs( sv_2mortal(newSVnv(xmax)));
  XPUSHs( sv_2mortal(newSVnv(ymax)));


PLINT
c_plgstrm()
 CODE:
   c_plgstrm( &RETVAL );
 OUTPUT:
   RETVAL


# plgvers

char *
c_plgver()
 PREINIT:
   char ver[80];
 CODE:
   RETVAL = ver;
   c_plgver( RETVAL );
 OUTPUT:
   RETVAL

# plgvpd
void
c_plgvpd()
 PREINIT:
  PLFLT p_xmin;
  PLFLT p_xmax;
  PLFLT p_ymin;
  PLFLT p_ymax;
 PPCODE:
  c_plgvpd( &p_xmin, &p_xmax, &p_ymin, &p_ymax );
  XPUSHs( sv_2mortal(newSVnv(p_xmin)));
  XPUSHs( sv_2mortal(newSVnv(p_xmax)));
  XPUSHs( sv_2mortal(newSVnv(p_ymin)));
  XPUSHs( sv_2mortal(newSVnv(p_ymax)));

void
c_plgvpw()
 PREINIT:
  PLFLT p_xmin;
  PLFLT p_xmax;
  PLFLT p_ymin;
  PLFLT p_ymax;
 PPCODE:
  c_plgvpw( &p_xmin, &p_xmax, &p_ymin, &p_ymax );
  XPUSHs( sv_2mortal(newSVnv(p_xmin)));
  XPUSHs( sv_2mortal(newSVnv(p_xmax)));
  XPUSHs( sv_2mortal(newSVnv(p_ymin)));
  XPUSHs( sv_2mortal(newSVnv(p_ymax)));

void
c_plgxax()
 PREINIT:
  PLINT digmax;
  PLINT digits;
 PPCODE:
  c_plgxax( &digmax, &digits );
  XPUSHs( sv_2mortal(newSViv(digmax)));
  XPUSHs( sv_2mortal(newSViv(digits)));

void
c_plgyax()
 PREINIT:
  PLINT digmax;
  PLINT digits;
 PPCODE:
  c_plgyax( &digmax, &digits );
  XPUSHs( sv_2mortal(newSViv(digmax)));
  XPUSHs( sv_2mortal(newSViv(digits)));

void
c_plgzax()
 PREINIT:
  PLINT digmax;
  PLINT digits;
 PPCODE:
  c_plgzax( &digmax, &digits );
  XPUSHs( sv_2mortal(newSViv(digmax)));
  XPUSHs( sv_2mortal(newSViv(digits)));



void
c_plhist( data, datmin, datmax, nbin, oldwin )
  PLFLT * data
  PLFLT datmin
  PLFLT datmax
  PLINT nbin
  PLINT oldwin
 CODE:
  c_plhist( ix_data, data, datmin, datmax, nbin, oldwin);


# plhls is now deprecated

# plimage - takes 2D perl array [see PGPLOT::pgimag]
# You should be using PDL instead
#  Currently do not determine nx and ny from data

void
c_plimage( pdata,xmin, xmax, ymin, ymax, zmin, zmax, Dxmin, Dxmax, Dymin, Dymax, ...)
  PLFLT2D * pdata
  PLFLT xmin
  PLFLT xmax
  PLFLT ymin
  PLFLT ymax
  PLFLT zmin
  PLFLT zmax
  PLFLT Dxmin
  PLFLT Dxmax
  PLFLT Dymin
  PLFLT Dymax
 PREINIT:
  PLFLT ** data;
  int i;
  int j;
  int k = 0;
 CODE:
  /* Allow two additional optional arguments */
  if (items < 11 || items > 13)
        Perl_croak(aTHX_ "Usage: Graphics::PLplot::plimage(pdata, xmin, xmax, ymin, ymax, zmin, zmax, Dxmin, Dxmax, Dymin,Dymax,[nx,ny]");

  /* Read optional arguments */
  if (items > 11)
    nx_pdata = (PLINT)SvIV(ST(11));
  if (items > 12)
    ny_pdata = (PLINT)SvIV(ST(12));

  /* this is incredibly inefficient since we go from a 2D perl array
     to some C memory to some more C memory. Needs tidying up a lot.
     May as well just support a serialised 1D perl array */
  plAlloc2dGrid(&data, nx_pdata, ny_pdata);
  for (i = 0; i < nx_pdata; i++) {
    for (j = 0; j < ny_pdata; j++) {
      data[i][j] = pdata[k];
      k++;

PLplot.xs  view on Meta::CPAN

  PLFLT xmax
  PLFLT ymin
  PLFLT ymax
  PLFLT aspect


void
c_plvpor( xmin, xmax, ymin, ymax )
  PLFLT xmin
  PLFLT xmax
  PLFLT ymin
  PLFLT ymax

void
c_plvsta()

void
c_plw3d(basex,basey,height,xmin,xmax,ymin,ymax,zmin,zmax,alt,az )
  PLFLT basex
  PLFLT basey
  PLFLT height
  PLFLT xmin
  PLFLT xmax
  PLFLT ymin
  PLFLT ymax
  PLFLT zmin
  PLFLT zmax
  PLFLT alt
  PLFLT az

void
c_plwid( width )
  PLINT width

void
c_plwind( xmin, xmax, ymin, ymax )
  PLFLT xmin
  PLFLT xmax
  PLFLT ymin
  PLFLT ymax

bool
c_plxormod( mode )
  bool mode
 PREINIT:
  PLINT status;
 CODE:
  c_plxormod( (PLINT)mode, &status);
  RETVAL = status;
 OUTPUT:
  RETVAL

### The C specific routines

void
plgFileDevs()
 PREINIT:
  char ** menustr;
  char ** devname;
  int ndev;
 PPCODE:
  /* Guess at largest number of drivers !! */
  menustr = get_mortalspace( 1024, 'v');
  devname = get_mortalspace( 1024, 'v');
  plgFileDevs(&menustr, &devname, &ndev);
  XPUSHs( newRV_noinc( (SV*)unpack1Dchar( menustr, ndev) ));
  XPUSHs( newRV_noinc( (SV*)unpack1Dchar( devname, ndev) ));

void
plgDevs()
 PREINIT:
  char ** menustr;
  char ** devname;
  int ndev;
 PPCODE:
  /* Guess at largest number of drivers !! */
  menustr = get_mortalspace( 1024, 'v');
  devname = get_mortalspace( 1024, 'v');
  plgDevs(&menustr, &devname, &ndev);
  XPUSHs( newRV_noinc( (SV*)unpack1Dchar( menustr, ndev) ));
  XPUSHs( newRV_noinc( (SV*)unpack1Dchar( devname, ndev) ));

## plsKeyEH - XXXXX not yet

## plsButtonEH - XXXXX not yet

## plsbobH     - XXXXX not yet

## plseopH     - XXXXX not yet

## plsError    - XXXXX not yet decided

## plsexit     - XXXXX not yet

## plsabort    - XXXXX not yet


## plClearOpts

void
plClearOpts()

void
plResetOpts()


# Returns status and all the unprocessed contents of @ARGV in ref to array

void
plParseOpts( argv, mode )
  char ** argv
  PLINT mode
 PREINIT:
  int status;
 PPCODE:
  /* $ARGV[0] is not the program name in perl */
  status = plParseOpts( &ix_argv, argv, mode | PL_PARSE_NOPROGRAM );
  XPUSHs( sv_2mortal(newSViv(status) ));  
  XPUSHs( newRV_noinc( (SV*)unpack1Dchar( argv, ix_argv) ));


# plMergeOpts should be done by perl GetOpt::Long



void
plSetUsage( program_string, usage_string )
  char * program_string
  char * usage_string

void
plOptUsage()

# This may cause problems since perl may well attempt to close
# this file itself

FILE *
plgfile()
 CODE:
  plgfile(&RETVAL);
 OUTPUT:
  RETVAL

void
plsfile( file )
  FILE * file

char
plgesc()
 CODE:
   plgesc(&RETVAL);
 OUTPUT:
   RETVAL

# Not really much need for plFindName or plFindCommand etc

# plGetCursor - return list of keyword value pairs
#  If not translation to world coordinates is possible, they
#  are not returned in the list

void
plGetCursor()
 PREINIT:
   PLGraphicsIn gin;
   int status;
 PPCODE:
  status = plGetCursor( &gin );
  XPUSHs(sv_2mortal(newSVpv( "dX", 0 )));
  XPUSHs(sv_2mortal(newSVnv( gin.dX )));
  XPUSHs(sv_2mortal(newSVpv( "dY", 0 )));
  XPUSHs(sv_2mortal(newSVnv( gin.dY )));
  XPUSHs(sv_2mortal(newSVpv( "pX", 0 )));
  XPUSHs(sv_2mortal(newSVnv( gin.pX )));
  XPUSHs(sv_2mortal(newSVpv( "pY", 0 )));
  XPUSHs(sv_2mortal(newSVnv( gin.pY )));
  if (status == 1 ) {
    XPUSHs(sv_2mortal(newSVpv( "wX", 0 )));
    XPUSHs(sv_2mortal(newSVnv( gin.wX )));
    XPUSHs(sv_2mortal(newSVpv( "wY", 0 )));
    XPUSHs(sv_2mortal(newSVnv( gin.wY )));
    XPUSHs(sv_2mortal(newSVpv( "subwindow", 0 )));
    XPUSHs(sv_2mortal(newSViv( gin.subwindow )));
  }
  XPUSHs(sv_2mortal(newSVpv( "state", 0 )));
  XPUSHs(sv_2mortal(newSVuv( gin.state )));
  XPUSHs(sv_2mortal(newSVpv( "keysym", 0 )));
  XPUSHs(sv_2mortal(newSVuv( gin.keysym )));
  XPUSHs(sv_2mortal(newSVpv( "button", 0 )));
  XPUSHs(sv_2mortal(newSVuv( gin.button )));
  XPUSHs(sv_2mortal(newSVpv( "string", 0 )));
  XPUSHs(sv_2mortal(newSVpv( gin.string, 0 )));

char*
plP_getinitdriverlist()
  PREINIT:
    char buffer[1024];
  CODE:
    RETVAL = buffer;
    plP_getinitdriverlist( buffer );
  OUTPUT:
    RETVAL

bool
plP_checkdriverinit(list)
  char * list


### PRIVATE ROUTINES that should not be exported

PLFLT
plstrl( string )
  char * string


MODULE = Graphics::PLplot  PACKAGE = Graphics::PLplot PREFIX = PL_

int
PL_PARSE_FULL()
 PROTOTYPE:
 CODE:
  RETVAL = PL_PARSE_FULL;
 OUTPUT:
  RETVAL

int
PL_PARSE_QUIET()



( run in 1.772 second using v1.01-cache-2.11-cpan-5511b514fd6 )