• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

plplot.d

Go to the documentation of this file.
00001 // Converted to D from plplot_d.h by htod
00002 module plplot;
00003 
00004 private import std.string;
00005 
00006 // improved D interface
00007 
00008 // certain functions must be declared as C functions so that PLplot
00009 // can handle them
00010 extern ( C ) {
00011 alias PLINT function( PLFLT, PLFLT ) def_func;
00012 alias void function( PLINT, PLFLT*, PLFLT* ) fill_func;
00013 alias void function( PLFLT, PLFLT, PLFLT*, PLFLT*, PLPointer ) pltr_func;
00014 alias void function( PLINT, PLFLT*, PLFLT* ) mapform_func;
00015 }
00016 
00017 // D definition of PLcGrid and PLcGrid2
00018 struct PLcGrid
00019 {
00020     PLFLT[] xg;
00021     PLFLT[] yg;
00022     PLFLT[] zg;
00023 }
00024 struct PLcGrid2
00025 {
00026     PLFLT[][] xg;
00027     PLFLT[][] yg;
00028     PLFLT[][] zg;
00029 }
00030 
00031 // helper function to convert D dynamic arrays in C dynamic arrays
00032 private PLFLT** convert_array( PLFLT[][] a )
00033 {
00034     if ( !a )
00035         return null;
00036 
00037     size_t nx = a.length;
00038     size_t ny = a[0].length;
00039 
00040     PLFLT  ** c_a = ( new PLFLT *[nx] ).ptr;
00041     for ( size_t i = 0; i < nx; i++ )
00042     {
00043         assert( ny == a[i].length, "convert_array(): Array must be 2 dimensional!" );
00044         c_a[i] = a[i].ptr;
00045     }
00046 
00047     return c_a;
00048 }
00049 
00050 // Process options list using current options info.
00051 int plparseopts( char[][] args, PLINT mode )
00052 {
00053     char*[] c_args = new char*[args.length];
00054     foreach ( size_t i, char[] arg; args )
00055         c_args[i] = toStringz( arg );
00056     int argc = c_args.length;
00057     return c_plparseopts( &argc, cast(char**) c_args, mode );
00058 }
00059 
00060 // simple arrow plotter.
00061 void plvect( PLFLT[][] u, PLFLT[][] v, PLFLT scale, pltr_func pltr = null, PLPointer pltr_data = null )
00062 {
00063     PLINT nx = u.length;
00064     PLINT ny = u[0].length;
00065     assert( nx == v.length, "plvect(): Arrays must be of same length!" );
00066     assert( ny == v[0].length, "plvect(): Arrays must be of same length!" );
00067 
00068     c_plvect( convert_array( u ), convert_array( v ), nx, ny, scale, pltr, pltr_data );
00069 }
00070 
00071 void plvect( PLFLT[][] u, PLFLT[][] v, PLFLT scale, ref PLcGrid cgrid )
00072 {
00073     PLINT nx = u.length;
00074     PLINT ny = u[0].length;
00075     assert( nx == v.length, "plvect(): Arrays must be of same length!" );
00076     assert( ny == v[0].length, "plvect(): Arrays must be of same length!" );
00077 
00078     c_PLcGrid c;
00079     c.xg = cgrid.xg.ptr;
00080     c.nx = cgrid.xg.length;
00081     c.yg = cgrid.yg.ptr;
00082     c.ny = cgrid.yg.length;
00083     c.zg = cgrid.zg.ptr;
00084     c.nz = cgrid.zg.length;
00085 
00086     c_plvect( convert_array( u ), convert_array( v ), nx, ny, scale, &pltr1, &c );
00087 }
00088 
00089 void plvect( PLFLT[][] u, PLFLT[][] v, PLFLT scale, ref PLcGrid2 cgrid2 )
00090 {
00091     PLINT nx = u.length;
00092     PLINT ny = u[0].length;
00093     assert( nx == v.length, "plvect(): Arrays must be of same length!" );
00094     assert( ny == v[0].length, "plvect(): Arrays must be of same length!" );
00095 
00096     c_PLcGrid2 c2;
00097     c2.xg = convert_array( cgrid2.xg );
00098     c2.yg = convert_array( cgrid2.yg );
00099     c2.zg = convert_array( cgrid2.zg );
00100     c2.nx = cgrid2.xg.length;
00101     c2.ny = cgrid2.xg[0].length;
00102     if ( cgrid2.yg )
00103     {
00104         assert( c2.nx == cgrid2.yg.length, "plcont(): Arrays must be of same length!" );
00105         assert( c2.ny == cgrid2.yg[0].length, "plcont(): Arrays must be of same length!" );
00106     }
00107     if ( cgrid2.zg )
00108     {
00109         assert( c2.nx == cgrid2.zg.length, "plcont(): Arrays must be of same length!" );
00110         assert( c2.ny == cgrid2.zg[0].length, "plcont(): Arrays must be of same length!" );
00111     }
00112 
00113     c_plvect( convert_array( u ), convert_array( v ), nx, ny, scale, &pltr2, &c2 );
00114 }
00115 
00116 void plsvect( PLFLT[] arrowx, PLFLT[] arrowy, PLBOOL fill )
00117 {
00118     PLINT npts = arrowx.length;
00119     assert( npts == arrowy.length, "plsvect(): Arrays must be of same length!" );
00120     c_plsvect( arrowx.ptr, arrowy.ptr, npts, fill );
00121 }
00122 
00123 // This functions similarly to plbox() except that the origin of the axes
00124 // is placed at the user-specified point (x0, y0).
00125 void plaxes( PLFLT x0, PLFLT y0, string xopt, PLFLT xtick, PLINT nxsub,
00126              string yopt, PLFLT ytick, PLINT nysub )
00127 {
00128     c_plaxes( x0, y0, toStringz( xopt ), xtick, nxsub, toStringz( yopt ), ytick, nysub );
00129 }
00130 
00131 // Plot a histogram using x to store data values and y to store frequencies
00132 void plbin( PLFLT[] x, PLFLT[] y, PLINT opt )
00133 {
00134     PLINT nbin = x.length;
00135     assert( nbin == y.length, "plbin(): Arrays must be of same length!" );
00136     c_plbin( nbin, x.ptr, y.ptr, opt );
00137 }
00138 
00139 // This draws a box around the current viewport.
00140 void plbox( string xopt, PLFLT xtick, PLINT nxsub, string yopt, PLFLT ytick, PLINT nysub )
00141 {
00142     c_plbox( toStringz( xopt ), xtick, nxsub, toStringz( yopt ), ytick, nysub );
00143 }
00144 
00145 // This is the 3-d analogue of plbox().
00146 void plbox3( string xopt, string xlabel, PLFLT xtick, PLINT nsubx,
00147              string yopt, string ylabel, PLFLT ytick, PLINT nsuby,
00148              string zopt, string zlabel, PLFLT ztick, PLINT nsubz )
00149 {
00150     c_plbox3( toStringz( xopt ), toStringz( xlabel ), xtick, nsubx,
00151         toStringz( yopt ), toStringz( ylabel ), ytick, nsuby,
00152         toStringz( zopt ), toStringz( zlabel ), ztick, nsubz );
00153 }
00154 
00155 // Draws a contour plot from data in f(nx,ny).  Is just a front-end to
00156 // plfcont, with a particular choice for f2eval and f2eval_data.
00157 //
00158 void plcont( PLFLT[][] f, PLINT kx, PLINT lx, PLINT ky, PLINT ly, PLFLT[] clevel,
00159              pltr_func pltr, PLPointer pltr_data = null )
00160 {
00161     PLINT nx = f.length;
00162     PLINT ny = f[0].length;
00163 
00164     c_plcont( convert_array( f ), nx, ny, kx, lx, ky, ly, clevel.ptr, clevel.length,
00165         pltr, pltr_data );
00166 }
00167 
00168 void plcont( PLFLT[][] f, PLINT kx, PLINT lx, PLINT ky, PLINT ly, PLFLT[] clevel,
00169              ref PLcGrid cgrid )
00170 {
00171     PLINT     nx = f.length;
00172     PLINT     ny = f[0].length;
00173 
00174     c_PLcGrid c;
00175     c.xg = cgrid.xg.ptr;
00176     c.nx = cgrid.xg.length;
00177     c.yg = cgrid.yg.ptr;
00178     c.ny = cgrid.yg.length;
00179     c.zg = cgrid.zg.ptr;
00180     c.nz = cgrid.zg.length;
00181 
00182     c_plcont( convert_array( f ), nx, ny, kx, lx, ky, ly, clevel.ptr, clevel.length,
00183         &pltr1, &c );
00184 }
00185 
00186 void plcont( PLFLT[][] f, PLINT kx, PLINT lx, PLINT ky, PLINT ly, PLFLT[] clevel,
00187              ref PLcGrid2 cgrid2 )
00188 {
00189     PLINT      nx = f.length;
00190     PLINT      ny = f[0].length;
00191 
00192     c_PLcGrid2 c2;
00193     c2.xg = convert_array( cgrid2.xg );
00194     c2.yg = convert_array( cgrid2.yg );
00195     c2.zg = convert_array( cgrid2.zg );
00196     c2.nx = cgrid2.xg.length;
00197     c2.ny = cgrid2.xg[0].length;
00198     if ( cgrid2.yg )
00199     {
00200         assert( c2.nx == cgrid2.yg.length, "plcont(): Arrays must be of same length!" );
00201         assert( c2.ny == cgrid2.yg[0].length, "plcont(): Arrays must be of same length!" );
00202     }
00203     if ( cgrid2.zg )
00204     {
00205         assert( c2.nx == cgrid2.zg.length, "plcont(): Arrays must be of same length!" );
00206         assert( c2.ny == cgrid2.zg[0].length, "plcont(): Arrays must be of same length!" );
00207     }
00208 
00209     c_plcont( convert_array( f ), nx, ny, kx, lx, ky, ly, clevel.ptr, clevel.length,
00210         &pltr2, &c2 );
00211 }
00212 
00213 // Draws a contour plot using the function evaluator f2eval and data stored
00214 // by way of the f2eval_data pointer.  This allows arbitrary organizations
00215 // of 2d array data to be used.
00216 //
00217 //void  plfcont(PLFLT  function(PLINT , PLINT , PLPointer )f2eval, PLPointer f2eval_data, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky, PLINT ly, PLFLT *clevel, PLINT nlevel, void  function(PLFLT , PLFLT , PLFLT *, PLFLT *, PLPointer )pltr, PLPointer pltr_data);
00218 
00219 // Plot horizontal error bars (xmin(i),y(i)) to (xmax(i),y(i))
00220 void plerrx( PLFLT[] xmin, PLFLT[] xmax, PLFLT[] y )
00221 {
00222     PLINT n = y.length;
00223     assert( n == xmin.length, "plerrx(): Arrays must be of same length!" );
00224     assert( n == xmax.length, "plerrx(): Arrays must be of same length!" );
00225     c_plerrx( n, xmin.ptr, xmax.ptr, y.ptr );
00226 }
00227 
00228 // Plot vertical error bars (x,ymin(i)) to (x(i),ymax(i))
00229 void plerry( PLFLT[] x, PLFLT[] ymin, PLFLT[] ymax )
00230 {
00231     PLINT n = x.length;
00232     assert( n == ymin.length, "plerry(): Arrays must be of same length!" );
00233     assert( n == ymax.length, "plerry(): Arrays must be of same length!" );
00234     c_plerry( n, x.ptr, ymin.ptr, ymax.ptr );
00235 }
00236 
00237 // Pattern fills the polygon bounded by the input points.
00238 void plfill( PLFLT[] x, PLFLT[] y )
00239 {
00240     PLINT n = x.length;
00241     assert( n == y.length, "plfill(): Arrays must be of same length!" );
00242     c_plfill( n, x.ptr, y.ptr );
00243 }
00244 
00245 // Pattern fills the 3d polygon bounded by the input points.
00246 void plfill3( PLFLT[] x, PLFLT[] y, PLFLT[] z )
00247 {
00248     PLINT n = x.length;
00249     assert( n == y.length, "plfill3(): Arrays must be of same length!" );
00250     assert( n == z.length, "plfill3(): Arrays must be of same length!" );
00251     c_plfill3( n, x.ptr, y.ptr, z.ptr );
00252 }
00253 
00254 // Get the current device (keyword) name
00255 void plgdev( out string p_dev )
00256 {
00257     p_dev.length = 1024;
00258     c_plgdev( p_dev.ptr );
00259     p_dev = toString( p_dev.ptr );
00260 }
00261 
00262 // Get the (current) output file name.  Must be preallocated to >80 bytes
00263 void plgfnam( out string fnam )
00264 {
00265     fnam.length = 1024;
00266     c_plgfnam( fnam.ptr );
00267     fnam = toString( fnam.ptr );
00268 }
00269 
00270 // Draw gradient in polygon.
00271 void plgradient( PLFLT[] x, PLFLT[] y, PLFLT angle )
00272 {
00273     PLINT n = x.length;
00274     assert( n == y.length, "plgradient(): Arrays must be of same length!" );
00275     c_plgradient( n, x.ptr, y.ptr, angle );
00276 }
00277 
00278 // grid irregularly sampled data
00279 void  plgriddata( PLFLT[] x, PLFLT[] y, PLFLT[] z, PLFLT[] xg, PLFLT[] yg, PLFLT[][] zg, PLINT type, PLFLT data )
00280 {
00281     PLINT npts = x.length;
00282     assert( npts == y.length, "plgriddata(): Arrays must be of same length!" );
00283     assert( npts == z.length, "plgriddata(): Arrays must be of same length!" );
00284 
00285     PLINT nxg = xg.length;
00286     PLINT nyg = yg.length;
00287     assert( nxg == zg.length, "plgriddata(): Arrays must be of same length!" );
00288     assert( nyg == zg[0].length, "plgriddata(): Arrays must be of same length!" );
00289 
00290     c_plgriddata( x.ptr, y.ptr, z.ptr, npts, xg.ptr, nxg, yg.ptr, nyg, convert_array( zg ), type, data );
00291 }
00292 
00293 // Get the current library version number
00294 void plgver( out string p_ver )
00295 {
00296     p_ver.length = 1024;
00297     c_plgver( p_ver.ptr );
00298     p_ver = toString( p_ver.ptr );
00299 }
00300 
00301 // Draws a histogram of n values of a variable in array data[0..n-1]
00302 void plhist( PLFLT[] data, PLFLT datmin, PLFLT datmax, PLINT nbin, PLINT opt )
00303 {
00304     c_plhist( data.length, data.ptr, datmin, datmax, nbin, opt );
00305 }
00306 
00307 // Simple routine for labelling graphs.
00308 void pllab( string xlabel, string ylabel, string tlabel )
00309 {
00310     c_pllab( toStringz( xlabel ), toStringz( ylabel ), toStringz( tlabel ) );
00311 }
00312 
00313 // Routine for drawing discrete line, symbol, or cmap0 legends
00314 void pllegend( PLFLT *p_legend_width, PLFLT *p_legend_height,
00315                PLINT opt, PLINT position, PLFLT x, PLFLT y, PLFLT plot_width,
00316                PLINT bg_color, PLINT bb_color, PLINT bb_style,
00317                PLINT nrow, PLINT ncolumn,
00318                PLINT[] opt_array,
00319                PLFLT text_offset, PLFLT text_scale, PLFLT text_spacing,
00320                PLFLT text_justification,
00321                PLINT[] text_colors, string[] text,
00322                PLINT[] box_colors, PLINT[] box_patterns,
00323                PLFLT[] box_scales, PLINT[] box_line_widths,
00324                PLINT[] line_colors, PLINT[] line_styles,
00325                PLINT[] line_widths,
00326                PLINT[] symbol_colors, PLFLT[] symbol_scales,
00327                PLINT[] symbol_numbers, string[] symbols )
00328 {
00329     PLINT   nlegend = opt_array.length;
00330     char*[] textz, symbolsz;
00331     textz.length    = nlegend;
00332     symbolsz.length = nlegend;
00333     for ( int i = 0; i < nlegend; i++ )
00334     {
00335         textz[i]    = toStringz( text[i] );
00336         symbolsz[i] = toStringz( symbols[i] );
00337     }
00338     assert( nlegend == text_colors.length, "pllegend(): Arrays must be of same length!" );
00339     assert( nlegend == text.length, "pllegend(): Arrays must be of same length!" );
00340     assert( nlegend == box_colors.length, "pllegend(): Arrays must be of same length!" );
00341     assert( nlegend == box_patterns.length, "pllegend(): Arrays must be of same length!" );
00342     assert( nlegend == box_scales.length, "pllegend(): Arrays must be of same length!" );
00343     assert( nlegend == box_line_widths.length, "pllegend(): Arrays must be of same length!" );
00344     assert( nlegend == line_colors.length, "pllegend(): Arrays must be of same length!" );
00345     assert( nlegend == line_styles.length, "pllegend(): Arrays must be of same length!" );
00346     assert( nlegend == line_widths.length, "pllegend(): Arrays must be of same length!" );
00347     assert( nlegend == symbol_colors.length, "pllegend(): Arrays must be of same length!" );
00348     assert( nlegend == symbol_scales.length, "pllegend(): Arrays must be of same length!" );
00349     assert( nlegend == symbol_numbers.length, "pllegend(): Arrays must be of same length!" );
00350     assert( nlegend == symbols.length, "pllegend(): Arrays must be of same length!" );
00351     c_pllegend( p_legend_width, p_legend_height,
00352         opt, position, x, y, plot_width,
00353         bg_color, bb_color, bb_style,
00354         nrow, ncolumn,
00355         nlegend, opt_array.ptr,
00356         text_offset, text_scale, text_spacing,
00357         text_justification,
00358         text_colors.ptr, textz.ptr,
00359         box_colors.ptr, box_patterns.ptr,
00360         box_scales.ptr, box_line_widths.ptr,
00361         line_colors.ptr, line_styles.ptr,
00362         line_widths.ptr,
00363         symbol_colors.ptr, symbol_scales.ptr,
00364         symbol_numbers.ptr, symbolsz.ptr );
00365 }
00366 
00367 // Draws line segments connecting a series of points.
00368 void plline( PLFLT[] x, PLFLT[] y )
00369 {
00370     PLINT n = x.length;
00371     assert( n == y.length, "plline(): Arrays must be of same length!" );
00372     c_plline( n, x.ptr, y.ptr );
00373 }
00374 
00375 // Draws a line in 3 space.
00376 void plline3( PLFLT[] x, PLFLT[] y, PLFLT[] z )
00377 {
00378     PLINT n = x.length;
00379     assert( n == y.length, "plline3(): Arrays must be of same length!" );
00380     assert( n == z.length, "plline3(): Arrays must be of same length!" );
00381     c_plline3( n, x.ptr, y.ptr, z.ptr );
00382 }
00383 
00384 // plot continental outline in world coordinates
00385 void plmap( mapform_func mapform, string type, PLFLT minlong, PLFLT maxlong,
00386             PLFLT minlat, PLFLT maxlat )
00387 {
00388     c_plmap( mapform, toStringz( type ), minlong, maxlong, minlat, maxlat );
00389 }
00390 
00391 // Plots a mesh representation of the function z[x][y].
00392 void plmesh( PLFLT[] x, PLFLT[] y, PLFLT[][] z, PLINT opt )
00393 {
00394     PLINT nx = z.length;
00395     PLINT ny = z[0].length;
00396 
00397     assert( nx == x.length, "plmesh(): Arrays must be of same length!" );
00398     assert( ny == y.length, "plmesh(): Arrays must be of same length!" );
00399 
00400     c_plmesh( x.ptr, y.ptr, convert_array( z ), nx, ny, opt );
00401 }
00402 
00403 // Plots a mesh representation of the function z[x][y] with contour
00404 void plmeshc( PLFLT[] x, PLFLT[] y, PLFLT[][] z, PLINT opt, PLFLT[] clevel )
00405 {
00406     PLINT nx = z.length;
00407     PLINT ny = z[0].length;
00408 
00409     assert( nx == x.length, "plmeshc(): Arrays must be of same length!" );
00410     assert( ny == y.length, "plmeshc(): Arrays must be of same length!" );
00411 
00412     c_plmeshc( x.ptr, y.ptr, convert_array( z ), nx, ny, opt, clevel.ptr, clevel.length );
00413 }
00414 
00415 // Prints out "text" at specified position relative to viewport
00416 void plmtex( string side, PLFLT disp, PLFLT pos, PLFLT just, string text )
00417 {
00418     c_plmtex( toStringz( side ), disp, pos, just, toStringz( text ) );
00419 }
00420 
00421 // Prints out "text" at specified position relative to viewport (3D)
00422 void plmtex3( string side, PLFLT disp, PLFLT pos, PLFLT just, string text )
00423 {
00424     c_plmtex3( toStringz( side ), disp, pos, just, toStringz( text ) );
00425 }
00426 
00427 // Plots a 3-d representation of the function z[x][y].
00428 void plot3d( PLFLT[] x, PLFLT[] y, PLFLT[][] z, PLINT opt, PLBOOL side )
00429 {
00430     PLINT nx = z.length;
00431     PLINT ny = z[0].length;
00432 
00433     assert( nx == x.length, "plot3d(): Arrays must be of same length!" );
00434     assert( ny == y.length, "plot3d(): Arrays must be of same length!" );
00435 
00436     c_plot3d( x.ptr, y.ptr, convert_array( z ), nx, ny, opt, side );
00437 }
00438 
00439 // Plots a 3-d representation of the function z[x][y] with contour.
00440 void plot3dc( PLFLT[] x, PLFLT[] y, PLFLT[][] z, PLINT opt, PLFLT[] clevel )
00441 {
00442     PLINT nx = z.length;
00443     PLINT ny = z[0].length;
00444 
00445     assert( nx == x.length, "plot3dc(): Arrays must be of same length!" );
00446     assert( ny == y.length, "plot3dc(): Arrays must be of same length!" );
00447 
00448     c_plot3dc( x.ptr, y.ptr, convert_array( z ), nx, ny, opt, clevel.ptr, clevel.length );
00449 }
00450 
00451 // Plots a 3-d representation of the function z[x][y] with contour and
00452 // y index limits.
00453 void plot3dcl( PLFLT[] x, PLFLT[] y, PLFLT[][] z, PLINT opt, PLFLT[] clevel,
00454                PLINT ixstart, PLINT ixn, PLINT[] indexymin, PLINT[] indexymax )
00455 {
00456     PLINT nx = z.length;
00457     PLINT ny = z[0].length;
00458 
00459     assert( nx == x.length, "plot3dcl(): Arrays must be of same length!" );
00460     assert( ny == y.length, "plot3dcl(): Arrays must be of same length!" );
00461 
00462     c_plot3dcl( x.ptr, y.ptr, convert_array( z ), nx, ny, opt, clevel.ptr, clevel.length,
00463         ixstart, ixn, indexymin.ptr, indexymax.ptr );
00464 }
00465 
00466 // Set fill pattern directly.
00467 void plpat( PLINT[] inc, PLINT[] del )
00468 {
00469     PLINT nlin = inc.length;
00470     assert( nlin == del.length, "plpat(): Arrays must be of same length!" );
00471     c_plpat( nlin, inc.ptr, del.ptr );
00472 }
00473 
00474 // Plots array y against x for n points using ASCII code "code".
00475 void plpoin( PLFLT[] x, PLFLT[] y, PLINT code )
00476 {
00477     PLINT n = x.length;
00478     assert( n == y.length, "plpoin(): Arrays must be of same length!" );
00479     c_plpoin( n, x.ptr, y.ptr, code );
00480 }
00481 
00482 // Draws a series of points in 3 space.
00483 void plpoin3( PLFLT[] x, PLFLT[] y, PLFLT[] z, PLINT code )
00484 {
00485     PLINT n = x.length;
00486     assert( n == y.length, "plpoin3(): Arrays must be of same length!" );
00487     assert( n == z.length, "plpoin3(): Arrays must be of same length!" );
00488     c_plpoin3( n, x.ptr, y.ptr, z.ptr, code );
00489 }
00490 
00491 // Plots array y against x for n points using (UTF-8) text string
00492 void plstring( PLFLT[] x, PLFLT[] y, string text )
00493 {
00494     PLINT n = x.length;
00495     assert( n == y.length, "plstring(): Arrays must be of same length!" );
00496     c_plstring( n, x.ptr, y.ptr, toStringz( text ) );
00497 }
00498 
00499 // Draws a series of points (described by [UTF8] text string) in 3 space.
00500 void plstring3( PLFLT[] x, PLFLT[] y, PLFLT[] z, string text )
00501 {
00502     PLINT n = x.length;
00503     assert( n == y.length, "plstring3(): Arrays must be of same length!" );
00504     assert( n == z.length, "plstring3(): Arrays must be of same length!" );
00505     c_plstring3( n, x.ptr, y.ptr, z.ptr, toStringz( text ) );
00506 }
00507 
00508 // Draws a polygon in 3 space.
00509 void plpoly3( PLFLT[] x, PLFLT[] y, PLFLT[] z, PLBOOL[] draw, PLBOOL ifcc )
00510 {
00511     PLINT n = x.length;
00512     assert( n == y.length, "plpoly3(): Arrays must be of same length!" );
00513     assert( n == z.length, "plpoly3(): Arrays must be of same length!" );
00514     assert( n - 1 == draw.length, "plpoly3(): Array draw must be of same length then other arrays minus 1!" );
00515     c_plpoly3( n, x.ptr, y.ptr, z.ptr, draw.ptr, ifcc );
00516 }
00517 
00518 // Prints out "text" at world cooordinate (x,y).
00519 void plptex( PLFLT x, PLFLT y, PLFLT dx, PLFLT dy, PLFLT just, string text )
00520 {
00521     c_plptex( x, y, dx, dy, just, toStringz( text ) );
00522 }
00523 
00524 // Prints out "text" at world cooordinate (x,y,z).
00525 void plptex3( PLFLT wx, PLFLT wy, PLFLT wz, PLFLT dx, PLFLT dy, PLFLT dz,
00526               PLFLT sx, PLFLT sy, PLFLT sz, PLFLT just, string text )
00527 {
00528     c_plptex3( wx, wy, wz, dx, dy, dz, sx, sy, sz, just, toStringz( text ) );
00529 }
00530 
00531 // Set the colors for color table 0 from a cmap0 file
00532 void plspal0( string filename )
00533 {
00534     c_plspal0( toStringz( filename ) );
00535 }
00536 
00537 // Set the colors for color table 1 from a cmap1 file
00538 void plspal1( string filename, PLBOOL interpolate )
00539 {
00540     c_plspal1( toStringz( filename ), interpolate );
00541 }
00542 
00543 // Set color map 0 colors by 8 bit RGB values
00544 void plscmap0( PLINT[] r, PLINT[] g, PLINT[] b )
00545 {
00546     PLINT ncol0 = r.length;
00547     assert( ncol0 == g.length, "plscmap0(): Arrays must be of same length!" );
00548     assert( ncol0 == b.length, "plscmap0(): Arrays must be of same length!" );
00549     c_plscmap0( r.ptr, g.ptr, b.ptr, ncol0 );
00550 }
00551 
00552 // Set color map 0 colors by 8 bit RGB values and alpha values
00553 void plscmap0a( PLINT[] r, PLINT[] g, PLINT[] b, PLFLT[] a )
00554 {
00555     PLINT ncol0 = r.length;
00556     assert( ncol0 == g.length, "plscmap0a(): Arrays must be of same length!" );
00557     assert( ncol0 == b.length, "plscmap0a(): Arrays must be of same length!" );
00558     assert( ncol0 == a.length, "plscmap0a(): Arrays must be of same length!" );
00559     c_plscmap0a( r.ptr, g.ptr, b.ptr, a.ptr, ncol0 );
00560 }
00561 
00562 // Set color map 1 colors by 8 bit RGB values
00563 void plscmap1( PLINT[] r, PLINT[] g, PLINT[] b )
00564 {
00565     PLINT ncol1 = r.length;
00566     assert( ncol1 == g.length, "plscmap1(): Arrays must be of same length!" );
00567     assert( ncol1 == b.length, "plscmap1(): Arrays must be of same length!" );
00568     c_plscmap1( r.ptr, g.ptr, b.ptr, ncol1 );
00569 }
00570 
00571 // Set color map 1 colors by 8 bit RGB and alpha values
00572 void plscmap1a( PLINT[] r, PLINT[] g, PLINT[] b, PLFLT[] a )
00573 {
00574     PLINT ncol1 = r.length;
00575     assert( ncol1 == g.length, "plscmap1a(): Arrays must be of same length!" );
00576     assert( ncol1 == b.length, "plscmap1a(): Arrays must be of same length!" );
00577     assert( ncol1 == a.length, "plscmap1a(): Arrays must be of same length!" );
00578     c_plscmap1a( r.ptr, g.ptr, b.ptr, a.ptr, ncol1 );
00579 }
00580 
00581 // Set color map 1 colors using a piece-wise linear relationship between
00582 // intensity [0,1] (cmap 1 index) and position in HLS or RGB color space.
00583 void plscmap1l( PLBOOL itype, PLFLT[] intensity, PLFLT[] coord1,
00584                 PLFLT[] coord2, PLFLT[] coord3, PLBOOL[] rev = null )
00585 {
00586     PLINT npts = intensity.length;
00587     assert( npts == coord1.length, "plscmap1l(): Arrays must be of same length!" );
00588     assert( npts == coord2.length, "plscmap1l(): Arrays must be of same length!" );
00589     assert( npts == coord3.length, "plscmap1l(): Arrays must be of same length!" );
00590     if ( rev != null )
00591     {
00592         assert( npts - 1 == rev.length, "plscmap1l(): Array rev must be of same length then other arrays minus 1!" );
00593         c_plscmap1l( itype, npts, intensity.ptr, coord1.ptr, coord2.ptr, coord3.ptr, rev.ptr );
00594     }
00595     else
00596         c_plscmap1l( itype, npts, intensity.ptr, coord1.ptr, coord2.ptr, coord3.ptr, null );
00597 }
00598 
00599 
00600 // Set color map 1 colors using a piece-wise linear relationship between
00601 // intensity [0,1] (cmap 1 index) and position in HLS or RGB color space.
00602 // Will also linear interpolate alpha values.
00603 void plscmap1la( PLBOOL itype, PLFLT[] intensity, PLFLT[] coord1,
00604                  PLFLT[] coord2, PLFLT[] coord3, PLFLT[] a, PLBOOL[] rev = null )
00605 {
00606     PLINT npts = intensity.length;
00607     assert( npts == coord1.length, "plscmap1la(): Arrays must be of same length!" );
00608     assert( npts == coord2.length, "plscmap1la(): Arrays must be of same length!" );
00609     assert( npts == coord3.length, "plscmap1la(): Arrays must be of same length!" );
00610     assert( npts == a.length, "plscmap1la(): Arrays must be of same length!" );
00611     if ( rev != null )
00612     {
00613         assert( npts - 1 == rev.length, "plscmap1la(): Array rev must be of same length then other arrays minus 1!" );
00614         c_plscmap1la( itype, npts, intensity.ptr, coord1.ptr, coord2.ptr, coord3.ptr, a.ptr, rev.ptr );
00615     }
00616     else
00617         c_plscmap1la( itype, npts, intensity.ptr, coord1.ptr, coord2.ptr, coord3.ptr, a.ptr, null );
00618 }
00619 
00620 // Set the device (keyword) name
00621 void plsdev( string devname )
00622 {
00623     c_plsdev( toStringz( devname ) );
00624 }
00625 
00626 // Set the output file name.
00627 void plsfnam( string fnam )
00628 {
00629     c_plsfnam( toStringz( fnam ) );
00630 }
00631 
00632 // Shade region.
00633 void plshade( PLFLT[][] a, def_func defined, PLFLT left, PLFLT right,
00634               PLFLT bottom, PLFLT top, PLFLT shade_min, PLFLT shade_max, PLINT sh_cmap,
00635               PLFLT sh_color, PLINT sh_width, PLINT min_color, PLINT min_width, PLINT max_color,
00636               PLINT max_width, PLBOOL rectangular,
00637               pltr_func pltr = null, PLPointer pltr_data = null )
00638 {
00639     PLINT nx = a.length;
00640     PLINT ny = a[0].length;
00641 
00642     c_plshade( convert_array( a ), nx, ny, defined, left, right, bottom, top, shade_min, shade_max, sh_cmap,
00643         sh_color, sh_width, min_color, min_width, max_color, max_width, &c_plfill,
00644         rectangular, pltr, pltr_data );
00645 }
00646 
00647 void plshades( PLFLT[][] a, def_func defined, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax,
00648                PLFLT[] clevel, PLINT fill_width, PLINT cont_color, PLINT cont_width,
00649                PLBOOL rectangular, pltr_func pltr = null, PLPointer pltr_data = null )
00650 {
00651     PLINT nx = a.length;
00652     PLINT ny = a[0].length;
00653 
00654     c_plshades( convert_array( a ), nx, ny, defined, xmin, xmax, ymin, ymax, clevel.ptr, clevel.length,
00655         fill_width, cont_color, cont_width, &c_plfill, rectangular, pltr, pltr_data );
00656 }
00657 
00658 void plshades( PLFLT[][] a, def_func defined, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax,
00659                PLFLT[] clevel, PLINT fill_width, PLINT cont_color, PLINT cont_width,
00660                PLBOOL rectangular, ref PLcGrid cgrid )
00661 {
00662     PLINT     nx = a.length;
00663     PLINT     ny = a[0].length;
00664 
00665     c_PLcGrid c;
00666     c.xg = cgrid.xg.ptr;
00667     c.nx = cgrid.xg.length;
00668     c.yg = cgrid.yg.ptr;
00669     c.ny = cgrid.yg.length;
00670     c.zg = cgrid.zg.ptr;
00671     c.nz = cgrid.zg.length;
00672 
00673     c_plshades( convert_array( a ), nx, ny, defined, xmin, xmax, ymin, ymax, clevel.ptr, clevel.length,
00674         fill_width, cont_color, cont_width, &c_plfill, rectangular, &pltr1, &c );
00675 }
00676 
00677 void plshades( PLFLT[][] a, def_func defined, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax,
00678                PLFLT[] clevel, PLINT fill_width, PLINT cont_color, PLINT cont_width,
00679                PLBOOL rectangular, ref PLcGrid2 cgrid2 )
00680 {
00681     PLINT      nx = a.length;
00682     PLINT      ny = a[0].length;
00683 
00684     c_PLcGrid2 c2;
00685     c2.xg = convert_array( cgrid2.xg );
00686     c2.yg = convert_array( cgrid2.yg );
00687     c2.zg = convert_array( cgrid2.zg );
00688     c2.nx = cgrid2.xg.length;
00689     c2.ny = cgrid2.xg[0].length;
00690     if ( cgrid2.yg )
00691     {
00692         assert( c2.nx == cgrid2.yg.length, "plcont(): Arrays must be of same length!" );
00693         assert( c2.ny == cgrid2.yg[0].length, "plcont(): Arrays must be of same length!" );
00694     }
00695     if ( cgrid2.zg )
00696     {
00697         assert( c2.nx == cgrid2.zg.length, "plcont(): Arrays must be of same length!" );
00698         assert( c2.ny == cgrid2.zg[0].length, "plcont(): Arrays must be of same length!" );
00699     }
00700 
00701     c_plshades( convert_array( a ), nx, ny, defined, xmin, xmax, ymin, ymax, clevel.ptr, clevel.length,
00702         fill_width, cont_color, cont_width, &c_plfill, rectangular, &pltr2, &c2 );
00703 }
00704 
00705 // Initialize PLplot, passing the device name and windows/page settings.
00706 void plstart( string devname, PLINT nx, PLINT ny )
00707 {
00708     c_plstart( toStringz( devname ), nx, ny );
00709 }
00710 
00711 // Create 1d stripchart
00712 void plstripc( PLINT* id, string xspec, string yspec, PLFLT xmin, PLFLT xmax, PLFLT xjump,
00713                PLFLT ymin, PLFLT ymax, PLFLT xlpos, PLFLT ylpos, PLBOOL y_ascl, PLBOOL acc,
00714                PLINT colbox, PLINT collab, PLINT[] colline, PLINT[] styline, string[] legline,
00715                string labx, string laby, string labtop )
00716 {
00717     assert( 4 == colline.length, "plstripc(): Arrays must be of length 4!" );
00718     assert( 4 == styline.length, "plstripc(): Arrays must be of length 4!" );
00719     assert( 4 == legline.length, "plstripc(): Arrays must be of length 4!" );
00720 
00721     char*[4] leglinez;
00722     for ( int i = 0; i < 4; i++ )
00723     {
00724         leglinez[i] = toStringz( legline[i] );
00725     }
00726 
00727     c_plstripc( id, toStringz( xspec ), toStringz( yspec ), xmin, xmax, xjump, ymin, ymax,
00728         xlpos, ylpos, y_ascl, acc, colbox, collab, colline.ptr, styline.ptr, leglinez.ptr,
00729         toStringz( labx ), toStringz( laby ), toStringz( labtop ) );
00730 }
00731 
00732 // plots a 2d image (or a matrix too large for plshade() )
00733 void plimagefr( PLFLT[][] idata, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax,
00734                 PLFLT zmin, PLFLT zmax, PLFLT valuemin, PLFLT valuemax,
00735                 pltr_func pltr = null, PLPointer pltr_data = null )
00736 {
00737     PLINT nx = idata.length;
00738     PLINT ny = idata[0].length;
00739 
00740     c_plimagefr( convert_array( idata ), nx, ny, xmin, xmax, ymin, ymax, zmin, zmax,
00741         valuemin, valuemax, pltr, pltr_data );
00742 }
00743 
00744 // plots a 2d image (or a matrix too large for plshade() )
00745 void plimagefr( PLFLT[][] idata, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax,
00746                 PLFLT zmin, PLFLT zmax, PLFLT valuemin, PLFLT valuemax, PLcGrid cgrid )
00747 {
00748     PLINT     nx = idata.length;
00749     PLINT     ny = idata[0].length;
00750 
00751     c_PLcGrid c;
00752     c.xg = cgrid.xg.ptr;
00753     c.nx = cgrid.xg.length;
00754     c.yg = cgrid.yg.ptr;
00755     c.ny = cgrid.yg.length;
00756     c.zg = cgrid.zg.ptr;
00757     c.nz = cgrid.zg.length;
00758 
00759     c_plimagefr( convert_array( idata ), nx, ny, xmin, xmax, ymin, ymax, zmin, zmax,
00760         valuemin, valuemax, &pltr1, &c );
00761 }
00762 
00763 // plots a 2d image (or a matrix too large for plshade() )
00764 void plimagefr( PLFLT[][] idata, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax,
00765                 PLFLT zmin, PLFLT zmax, PLFLT valuemin, PLFLT valuemax, PLcGrid2 cgrid2 )
00766 {
00767     PLINT      nx = idata.length;
00768     PLINT      ny = idata[0].length;
00769 
00770     c_PLcGrid2 c2;
00771     c2.xg = convert_array( cgrid2.xg );
00772     c2.yg = convert_array( cgrid2.yg );
00773     c2.zg = convert_array( cgrid2.zg );
00774     c2.nx = cgrid2.xg.length;
00775     c2.ny = cgrid2.xg[0].length;
00776     if ( cgrid2.yg )
00777     {
00778         assert( c2.nx == cgrid2.yg.length, "plcont(): Arrays must be of same length!" );
00779         assert( c2.ny == cgrid2.yg[0].length, "plcont(): Arrays must be of same length!" );
00780     }
00781     if ( cgrid2.zg )
00782     {
00783         assert( c2.nx == cgrid2.zg.length, "plcont(): Arrays must be of same length!" );
00784         assert( c2.ny == cgrid2.zg[0].length, "plcont(): Arrays must be of same length!" );
00785     }
00786 
00787     c_plimagefr( convert_array( idata ), nx, ny, xmin, xmax, ymin, ymax, zmin, zmax,
00788         valuemin, valuemax, &pltr2, &c2 );
00789 }
00790 
00791 // plots a 2d image (or a matrix too large for plshade() ) - colors
00792 // automatically scaled
00793 void plimage( PLFLT[][] idata, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax,
00794               PLFLT zmin, PLFLT zmax, PLFLT Dxmin, PLFLT Dxmax, PLFLT Dymin, PLFLT Dymax )
00795 {
00796     PLINT nx = idata.length;
00797     PLINT ny = idata[0].length;
00798 
00799     c_plimage( convert_array( idata ), nx, ny, xmin, xmax, ymin, ymax, zmin, zmax, Dxmin, Dxmax,
00800         Dymin, Dymax );
00801 }
00802 
00803 // Set up a new line style
00804 void plstyl( PLINT[] mark, PLINT[] space )
00805 {
00806     PLINT nms = mark.length;
00807     assert( nms == space.length, "plstyl(): Arrays must be of same length!" );
00808     c_plstyl( nms, mark.ptr, space.ptr );
00809 }
00810 
00811 // Plots the 3d surface representation of the function z[x][y].
00812 void plsurf3d( PLFLT[] x, PLFLT[] y, PLFLT[][] z, PLINT opt, PLFLT[] clevel = null )
00813 {
00814     PLINT nx = z.length;
00815     PLINT ny = z[0].length;
00816     assert( nx == x.length, "plsurf3d(): Arrays must be of same length!" );
00817     assert( ny == y.length, "plsurf3d(): Arrays must be of same length!" );
00818 
00819     if ( clevel )
00820         c_plsurf3d( x.ptr, y.ptr, convert_array( z ), nx, ny, opt, clevel.ptr, clevel.length );
00821     else
00822         c_plsurf3d( x.ptr, y.ptr, convert_array( z ), nx, ny, opt, null, 0 );
00823 }
00824 
00825 // Plots the 3d surface representation of the function z[x][y] with y
00826 // index limits.
00827 void plsurf3dl( PLFLT[] x, PLFLT[] y, PLFLT[][] z, PLINT opt, PLFLT[] clevel,
00828                 PLINT ixstart, PLINT ixn, PLINT[] indexymin, PLINT[] indexymax )
00829 {
00830     PLINT nx = z.length;
00831     PLINT ny = z[0].length;
00832     assert( nx == x.length, "plsurf3d(): Arrays must be of same length!" );
00833     assert( ny == y.length, "plsurf3d(): Arrays must be of same length!" );
00834 
00835     c_plsurf3dl( x.ptr, y.ptr, convert_array( z ), nx, ny, opt, clevel.ptr, clevel.length,
00836         ixstart, ixn, indexymin.ptr, indexymax.ptr );
00837 }
00838 
00839 // Plots array y against x for n points using Hershey symbol "code"
00840 void plsym( PLFLT[] x, PLFLT[] y, PLINT code )
00841 {
00842     PLINT n = x.length;
00843     assert( n == y.length, "plsym(): Arrays must be of same length!" );
00844     c_plsym( n, x.ptr, y.ptr, code );
00845 }
00846 
00847 // Set the format for date / time labels
00848 void pltimefmt( string fmt )
00849 {
00850     c_pltimefmt( toStringz( fmt ) );
00851 }
00852 
00853 //--------------------------------------------------------------------------
00854 //              Functions for use from C or C++ only
00855 //--------------------------------------------------------------------------
00856 
00857 // Returns a list of file-oriented device names and their menu strings
00858 //void  plgFileDevs(char ***p_menustr, char ***p_devname, int *p_ndev);
00859 
00860 // Returns a list of all device names and their menu strings
00861 //void  plgDevs(char ***p_menustr, char ***p_devname, int *p_ndev);
00862 
00863 // Set the function pointer for the keyboard event handler
00864 //void  plsKeyEH(void  function(PLGraphicsIn *, void *, int *)KeyEH, void *KeyEH_data);
00865 
00866 // Set the function pointer for the (mouse) button event handler
00867 //void  plsButtonEH(void  function(PLGraphicsIn *, void *, int *)ButtonEH, void *ButtonEH_data);
00868 
00869 // Sets an optional user bop handler
00870 //void  plsbopH(void  function(void *, int *)handler, void *handler_data);
00871 
00872 // Sets an optional user eop handler
00873 //void  plseopH(void  function(void *, int *)handler, void *handler_data);
00874 
00875 // Set the variables to be used for storing error info
00876 //void plsError(PLINT *errcode, char *errmsg)
00877 //{
00878 //}
00879 
00880 // Sets an optional user exit handler.
00881 //void  plsexit(int  function(char *)handler);
00882 
00883 // Sets an optional user abort handler.
00884 //void  plsabort(void  function(char *)handler);
00885 
00886 // Function evaluators
00887 
00888 // Does a lookup from a 2d function array.  Array is of type (PLFLT **),
00889 // and is column dominant (normal C ordering).
00890 //PLFLT  plf2eval2(PLINT ix, PLINT iy, PLPointer plf2eval_data);
00891 
00892 // Does a lookup from a 2d function array.  Array is of type (PLFLT *),
00893 // and is column dominant (normal C ordering).
00894 //PLFLT  plf2eval(PLINT ix, PLINT iy, PLPointer plf2eval_data);
00895 
00896 // Does a lookup from a 2d function array.  Array is of type (PLFLT *),
00897 // and is row dominant (Fortran ordering).
00898 //PLFLT  plf2evalr(PLINT ix, PLINT iy, PLPointer plf2eval_data);
00899 
00900 // Command line parsing utilities
00901 
00902 // Merge user option table into internal info structure.
00903 //int  plMergeOpts(PLOptionTable *options, char *name, char **notes);
00904 
00905 // Set the strings used in usage and syntax messages.
00906 //void  plSetUsage(char *program_string, char *usage_string);
00907 
00908 // Process input strings, treating them as an option and argument pair.
00909 // The first is for the external API, the second the work routine declared
00910 // here for backward compatibilty.
00911 int plsetopt( string opt, string optarg )
00912 {
00913     return c_plsetopt( toStringz( opt ), toStringz( optarg ) );
00914 }
00915 
00916 // Miscellaneous
00917 
00918 // Get the escape character for text strings.
00919 //void  plgesc(char *p_esc);
00920 
00921 // Front-end to driver escape function.
00922 //void  pl_cmd(PLINT op, void *ptr);
00923 
00924 // Return full pathname for given file if executable
00925 //int  plFindName(char *p);
00926 
00927 // Looks for the specified executable file according to usual search path.
00928 //char * plFindCommand(char *fn);
00929 
00930 // Gets search name for file by concatenating the dir, subdir, and file
00931 // name, allocating memory as needed.
00932 //void  plGetName(char *dir, char *subdir, char *filename, char **filespec);
00933 
00934 // Prompts human to input an integer in response to given message.
00935 //PLINT  plGetInt(char *s);
00936 
00937 // Prompts human to input a float in response to given message.
00938 //PLFLT  plGetFlt(char *s);
00939 
00940 // Find the maximum and minimum of a 2d matrix allocated with plAllc2dGrid().
00941 void plMinMax2dGrid( PLFLT[][] f, out PLFLT fmax, out PLFLT fmin )
00942 {
00943     plMinMax2dGrid( convert_array( f ), f.length, f[0].length, &fmax, &fmin );
00944 }
00945 
00946 // Wait for graphics input event and translate to world coordinates
00947 //int  plGetCursor(PLGraphicsIn *gin);
00948 
00949 // Translates relative device coordinates to world coordinates.
00950 //int  plTranslateCursor(PLGraphicsIn *gin);
00951 
00952 
00953 
00954 extern ( C ) :
00955 
00956 alias double PLFLT;
00957 
00958 // This is apparently portable if stdint.h exists.
00959 // A reasonable back-up in case stdint.h does not exist on the platform.
00960 alias uint PLUNICODE;
00961 alias int  PLINT;
00962 
00963 // For identifying logical (boolean) arguments
00964 alias PLINT PLBOOL;
00965 
00966 // For passing user data, as with X's XtPointer
00967 alias void* PLPointer;
00968 
00969 //--------------------------------------------------------------------------
00970 // Complex data types and other good stuff
00971 //--------------------------------------------------------------------------
00972 
00973 // Switches for escape function call.
00974 // Some of these are obsolete but are retained in order to process
00975 // old metafiles.
00976 
00977 const PLESC_SET_RGB         = 1;
00978 const PLESC_ALLOC_NCOL      = 2;
00979 const PLESC_SET_LPB         = 3;
00980 const PLESC_EXPOSE          = 4;
00981 const PLESC_RESIZE          = 5;
00982 const PLESC_REDRAW          = 6;
00983 const PLESC_TEXT            = 7;
00984 const PLESC_GRAPH           = 8;
00985 const PLESC_FILL            = 9;
00986 const PLESC_DI              = 10;
00987 const PLESC_FLUSH           = 11;
00988 const PLESC_EH              = 12;
00989 const PLESC_GETC            = 13;
00990 const PLESC_SWIN            = 14;
00991 const PLESC_DOUBLEBUFFERING = 15;
00992 const PLESC_XORMOD          = 16;
00993 const PLESC_SET_COMPRESSION = 17;
00994 const PLESC_CLEAR           = 18;
00995 const PLESC_DASH            = 19;
00996 const PLESC_HAS_TEXT        = 20;
00997 const PLESC_IMAGE           = 21;
00998 const PLESC_IMAGEOPS        = 22;
00999 const PLESC_PL2DEVCOL       = 23;
01000 const PLESC_DEV2PLCOL       = 24;
01001 const PLESC_SETBGFG         = 25;
01002 const PLESC_DEVINIT         = 26;
01003 
01004 // image operations
01005 const ZEROW2B = 1;
01006 const ZEROW2D = 2;
01007 const ONEW2B  = 3;
01008 const ONEW2D  = 4;
01009 
01010 // Window parameter tags
01011 const PLSWIN_DEVICE = 1;
01012 const PLSWIN_WORLD  = 2;
01013 
01014 // Axis label tags
01015 const PL_X_AXIS = 1;       // The x-axis
01016 const PL_Y_AXIS = 2;       // The y-axis
01017 const PL_Z_AXIS = 3;       // The z-axis
01018 
01019 // PLplot Option table & support constants
01020 
01021 // Option-specific settings
01022 const PL_OPT_ENABLED   = 0x0001;
01023 const PL_OPT_ARG       = 0x0002;
01024 const PL_OPT_NODELETE  = 0x0004;
01025 const PL_OPT_INVISIBLE = 0x0008;
01026 const PL_OPT_DISABLED  = 0x0010;
01027 
01028 // Option-processing settings -- mutually exclusive
01029 const PL_OPT_FUNC   = 0x0100;
01030 const PL_OPT_BOOL   = 0x0200;
01031 const PL_OPT_INT    = 0x0400;
01032 const PL_OPT_FLOAT  = 0x0800;
01033 const PL_OPT_STRING = 0x1000;
01034 
01035 // Global mode settings
01036 // These override per-option settings
01037 const PL_PARSE_PARTIAL = 0x0000;
01038 const PL_PARSE_FULL    = 0x0001;
01039 const PL_PARSE_QUIET   = 0x0002;
01040 
01041 // processing
01042 const PL_PARSE_NODELETE  = 0x0004;
01043 const PL_PARSE_SHOWALL   = 0x0008;
01044 const PL_PARSE_OVERRIDE  = 0x0010;
01045 const PL_PARSE_NOPROGRAM = 0x0020;
01046 const PL_PARSE_NODASH    = 0x0040;
01047 const PL_PARSE_SKIP      = 0x0080;
01048 
01049 // FCI (font characterization integer) related constants.
01050 const PL_FCI_MARK          = 0x80000000;
01051 const PL_FCI_IMPOSSIBLE    = 0x00000000;
01052 const PL_FCI_HEXDIGIT_MASK = 0xf;
01053 const PL_FCI_HEXPOWER_MASK = 0x7;
01054 
01055 // These define hexpower values corresponding to each font attribute.
01056 const PL_FCI_HEXPOWER_IMPOSSIBLE = 0xf;
01057 const PL_FCI_FAMILY = 0x0;
01058 const PL_FCI_STYLE  = 0x1;
01059 
01060 // These are legal values for font family attribute
01061 const PL_FCI_WEIGHT = 0x2;
01062 const PL_FCI_SANS   = 0x0;
01063 const PL_FCI_SERIF  = 0x1;
01064 const PL_FCI_MONO   = 0x2;
01065 const PL_FCI_SCRIPT = 0x3;
01066 
01067 // These are legal values for font style attribute
01068 const PL_FCI_SYMBOL  = 0x4;
01069 const PL_FCI_UPRIGHT = 0x0;
01070 const PL_FCI_ITALIC  = 0x1;
01071 
01072 // These are legal values for font weight attribute
01073 const PL_FCI_MEDIUM  = 0x0;
01074 const PL_FCI_BOLD    = 0x1;
01075 const PL_FCI_OBLIQUE = 0x2;
01076 
01077 // Obsolete names
01078 
01079 // Option table definition
01080 
01081 struct _N1
01082 {
01083     char *opt;
01084     int  function( char *, char *, void * ) handler;
01085     void *client_data;
01086     void *var;
01087     int  mode;
01088     char *syntax;
01089     char *desc;
01090 }
01091 alias _N1 PLOptionTable;
01092 
01093 // PLplot Graphics Input structure
01094 
01095 
01096 const PL_MAXKEY = 16;
01097 struct _N2
01098 {
01099     int   type;
01100     uint  state;
01101     uint  keysym;
01102     uint  button;
01103     PLINT subwindow;
01104     char [16] string;
01105     int   pX;
01106     int   pY;
01107     PLFLT dX;
01108     PLFLT dY;
01109     PLFLT wX;
01110     PLFLT wY;
01111 }
01112 alias _N2 PLGraphicsIn;
01113 
01114 // Structure for describing the plot window
01115 
01116 
01117 const PL_MAXWINDOWS = 64;
01118 struct _N3
01119 {
01120     PLFLT dxmi;
01121     PLFLT dxma;
01122     PLFLT dymi;
01123     PLFLT dyma;
01124     PLFLT wxmi;
01125     PLFLT wxma;
01126     PLFLT wymi;
01127     PLFLT wyma;
01128 }
01129 alias _N3 PLWindow;
01130 
01131 // Structure for doing display-oriented operations via escape commands
01132 // May add other attributes in time
01133 
01134 struct _N4
01135 {
01136     uint x;
01137     uint y;
01138     uint width;
01139     uint height;
01140 }
01141 alias _N4 PLDisplay;
01142 
01143 // Macro used (in some cases) to ignore value of argument
01144 // I don't plan on changing the value so you can hard-code it
01145 
01146 const int PL_NOTSET = -42;
01147 
01148 // See plcont.c for examples of the following
01149 
01150 //
01151 // PLfGrid is for passing (as a pointer to the first element) an arbitrarily
01152 // dimensioned array.  The grid dimensions MUST be stored, with a maximum of 3
01153 // dimensions assumed for now.
01154 //
01155 
01156 struct _N5
01157 {
01158     PLFLT *f;
01159     PLINT nx;
01160     PLINT ny;
01161     PLINT nz;
01162 }
01163 alias _N5 PLfGrid;
01164 
01165 //
01166 // PLfGrid2 is for passing (as an array of pointers) a 2d function array.  The
01167 // grid dimensions are passed for possible bounds checking.
01168 //
01169 
01170 struct _N6
01171 {
01172     PLFLT **f;
01173     PLINT nx;
01174     PLINT ny;
01175 }
01176 alias _N6 PLfGrid2;
01177 
01178 //
01179 // NOTE: a PLfGrid3 is a good idea here but there is no way to exploit it yet
01180 // so I'll leave it out for now.
01181 //
01182 
01183 //
01184 // PLcGrid is for passing (as a pointer to the first element) arbitrarily
01185 // dimensioned coordinate transformation arrays.  The grid dimensions MUST be
01186 // stored, with a maximum of 3 dimensions assumed for now.
01187 //
01188 
01189 struct _N7
01190 {
01191     PLFLT *xg;
01192     PLFLT *yg;
01193     PLFLT *zg;
01194     PLINT nx;
01195     PLINT ny;
01196     PLINT nz;
01197 }
01198 alias _N7 c_PLcGrid;
01199 
01200 //
01201 // PLcGrid2 is for passing (as arrays of pointers) 2d coordinate
01202 // transformation arrays.  The grid dimensions are passed for possible bounds
01203 // checking.
01204 //
01205 
01206 struct _N8
01207 {
01208     PLFLT **xg;
01209     PLFLT **yg;
01210     PLFLT **zg;
01211     PLINT nx;
01212     PLINT ny;
01213 }
01214 alias _N8 c_PLcGrid2;
01215 
01216 //
01217 // NOTE: a PLcGrid3 is a good idea here but there is no way to exploit it yet
01218 // so I'll leave it out for now.
01219 //
01220 
01221 // PLColor is the usual way to pass an rgb color value.
01222 
01223 struct _N9
01224 {
01225     ubyte r;
01226     ubyte g;
01227     ubyte b;
01228     PLFLT a;
01229     char  *name;
01230 }
01231 alias _N9 PLColor;
01232 
01233 // PLControlPt is how cmap1 control points are represented.
01234 
01235 struct _N10
01236 {
01237     PLFLT h;
01238     PLFLT l;
01239     PLFLT s;
01240     PLFLT p;
01241     PLFLT a;
01242     int   rev;
01243 }
01244 alias _N10 PLControlPt;
01245 
01246 // A PLBufferingCB is a control block for interacting with devices
01247 // that support double buffering.
01248 
01249 struct _N11
01250 {
01251     PLINT cmd;
01252     PLINT result;
01253 }
01254 alias _N11 PLBufferingCB;
01255 
01256 const      PLESC_DOUBLEBUFFERING_ENABLE  = 1;
01257 const      PLESC_DOUBLEBUFFERING_DISABLE = 2;
01258 
01259 const      PLESC_DOUBLEBUFFERING_QUERY = 3;
01260 
01261 //--------------------------------------------------------------------------* *         BRAINDEAD-ness
01262 //
01263 // Some systems allow the Fortran & C namespaces to clobber each other.
01264 // For PLplot to work from Fortran on these systems, we must name the the
01265 // externally callable C functions something other than their Fortran entry
01266 // names.  In order to make this as easy as possible for the casual user,
01267 // yet reversible to those who abhor my solution, I have done the
01268 // following:
01269 //
01270 //      The C-language bindings are actually different from those
01271 //      described in the manual.  Macros are used to convert the
01272 //      documented names to the names used in this package.  The
01273 //      user MUST include plplot.h in order to get the name
01274 //      redefinition correct.
01275 //
01276 // Sorry to have to resort to such an ugly kludge, but it is really the
01277 // best way to handle the situation at present.  If all available
01278 // compilers offer a way to correct this stupidity, then perhaps we can
01279 // eventually reverse it.
01280 //
01281 // If you feel like screaming at someone (I sure do), please
01282 // direct it at your nearest system vendor who has a braindead shared
01283 // C/Fortran namespace.  Some vendors do offer compiler switches that
01284 // change the object names, but then everybody who wants to use the
01285 // package must throw these same switches, leading to no end of trouble.
01286 //
01287 // Note that this definition should not cause any noticable effects except
01288 // when debugging PLplot calls, in which case you will need to remember
01289 // the real function names (same as before but with a 'c_' prepended).
01290 //
01291 // Also, to avoid macro conflicts, the BRAINDEAD part must not be expanded
01292 // in the stub routines.
01293 //
01294 // Aside: the reason why a shared Fortran/C namespace is deserving of the
01295 // BRAINDEAD characterization is that it completely precludes the the kind
01296 // of universal API that is attempted (more or less) with PLplot, without
01297 // Herculean efforts (e.g. remapping all of the C bindings by macros as
01298 // done here).  The vendors of such a scheme, in order to allow a SINGLE
01299 // type of argument to be passed transparently between C and Fortran,
01300 // namely, a pointer to a conformable data type, have slammed the door on
01301 // insertion of stub routines to handle the conversions needed for other
01302 // data types.  Intelligent linkers could solve this problem, but these are
01303 // not anywhere close to becoming universal.  So meanwhile, one must live
01304 // with either stub routines for the inevitable data conversions, or a
01305 // different API.  The former is what is used here, but is made far more
01306 // difficult in a braindead shared Fortran/C namespace.
01307 //--------------------------------------------------------------------------
01308 
01309 
01310 
01311 
01312 alias c_pl_setcontlabelformat pl_setcontlabelformat;
01313 alias c_pl_setcontlabelparam  pl_setcontlabelparam;
01314 alias c_pladv pladv;
01315 //alias c_plaxes plaxes;
01316 //alias c_plbin plbin;
01317 alias c_plbop plbop;
01318 //alias c_plbox plbox;
01319 //alias c_plbox3 plbox3;
01320 alias c_plbtime      plbtime;
01321 alias c_plslabelfunc plslabelfunc;
01322 alias c_plcalc_world plcalc_world;
01323 alias c_plarc        plarc;
01324 alias c_plclear      plclear;
01325 alias c_plcol0       plcol0;
01326 alias c_plcol1       plcol1;
01327 alias c_plconfigtime plconfigtime;
01328 //alias c_plcont plcont;
01329 alias c_plcpstrm     plcpstrm;
01330 alias c_plctime      plctime;
01331 alias c_plend        plend;
01332 alias c_plend1       plend1;
01333 alias c_plenv        plenv;
01334 alias c_plenv0       plenv0;
01335 alias c_pleop        pleop;
01336 //alias c_plerrx plerrx;
01337 //alias c_plerry plerry;
01338 alias c_plfamadv plfamadv;
01339 //alias c_plfill plfill;
01340 //alias c_plfill3 plfill3;
01341 alias c_plflush        plflush;
01342 alias c_plfont         plfont;
01343 alias c_plfontld       plfontld;
01344 alias c_plgchr         plgchr;
01345 alias c_plgcol0        plgcol0;
01346 alias c_plgcolbg       plgcolbg;
01347 alias c_plgcol0a       plgcol0a;
01348 alias c_plgcolbga      plgcolbga;
01349 alias c_plgcompression plgcompression;
01350 //alias c_plgdev plgdev;
01351 alias c_plgdidev       plgdidev;
01352 alias c_plgdiori       plgdiori;
01353 alias c_plgdiplt       plgdiplt;
01354 alias c_plgfam         plgfam;
01355 alias c_plgfci         plgfci;
01356 //alias c_plgfnam plgfnam;
01357 alias c_plgfont        plgfont;
01358 alias c_plglevel       plglevel;
01359 alias c_plgpage        plgpage;
01360 alias c_plgradient     plgrdient;
01361 alias c_plgra          plgra;
01362 //alias c_plgriddata plgriddata;
01363 alias c_plgspa         plgspa;
01364 alias c_plgstrm        plgstrm;
01365 //alias c_plgver plgver;
01366 alias c_plgvpd         plgvpd;
01367 alias c_plgvpw         plgvpw;
01368 alias c_plgxax         plgxax;
01369 alias c_plgyax         plgyax;
01370 alias c_plgzax         plgzax;
01371 //alias c_plhist plhist;
01372 alias c_plhls          plhls;
01373 alias c_plhlsrgb       plhlsrgb;
01374 //alias c_plimage plimage;
01375 //alias c_plimagefr plimagefr;
01376 alias c_plinit plinit;
01377 alias c_pljoin pljoin;
01378 //alias c_pllab pllab;
01379 //alias c_pllegend pllegend;
01380 alias c_pllightsource pllightsource;
01381 //alias c_plline plline;
01382 //alias c_plline3 plline3;
01383 alias c_pllsty      pllsty;
01384 //alias c_plmap plmap;
01385 alias c_plmeridians plmeridians;
01386 //alias c_plmesh plmesh;
01387 //alias c_plmeshc plmeshc;
01388 alias c_plmkstrm plmkstrm;
01389 //alias c_plmtex plmtex;
01390 //alias c_plmtex3 plmtex3;
01391 //alias c_plot3d plot3d;
01392 //alias c_plot3dc plot3dc;
01393 //alias c_plot3dcl plot3dcl;
01394 //alias c_plparseopts plparseopts;
01395 //alias c_plpat plpat;
01396 //alias c_plpoin plpoin;
01397 //alias c_plpoin3 plpoin3;
01398 //alias c_plpoly3 plpoly3;
01399 alias c_plprec plprec;
01400 alias c_plpsty plpsty;
01401 //alias c_plptex plptex;
01402 //alias c_plptex3 plptex3;
01403 alias c_plrandd  plrandd;
01404 alias c_plreplot plreplot;
01405 alias c_plrgb    plrgb;
01406 alias c_plrgb1   plrgb1;
01407 alias c_plrgbhls plrgbhls;
01408 alias c_plschr   plschr;
01409 //alias c_plscmap0 plscmap0;
01410 //alias c_plscmap0a plscmap0a;
01411 alias c_plscmap0n plscmap0n;
01412 //alias c_plscmap1 plscmap1;
01413 //alias c_plscmap1a plscmap1a;
01414 //alias c_plscmap1l plscmap1l;
01415 //alias c_plscmap1la plscmap1la;
01416 alias c_plscmap1n      plscmap1n;
01417 alias c_plscol0        plscol0;
01418 alias c_plscol0a       plscol0a;
01419 alias c_plscolbg       plscolbg;
01420 alias c_plscolbga      plscolbga;
01421 alias c_plscolor       plscolor;
01422 alias c_plscompression plscompression;
01423 // alias c_plsdev plsdev;
01424 alias c_plsdidev       plsdidev;
01425 alias c_plsdimap       plsdimap;
01426 alias c_plsdiori       plsdiori;
01427 alias c_plsdiplt       plsdiplt;
01428 alias c_plsdiplz       plsdiplz;
01429 alias c_plseed         plseed;
01430 alias c_plsesc         plsesc;
01431 //alias c_plsetopt plsetopt;
01432 alias c_plsfam         plsfam;
01433 alias c_plsfci         plsfci;
01434 // alias c_plsfnam plsfnam;
01435 alias c_plsfont        plsfont;
01436 //alias c_plshade plshade;
01437 //alias c_plshades plshades;
01438 alias c_plsmaj  plsmaj;
01439 alias c_plsmem  plsmem;
01440 alias c_plsmin  plsmin;
01441 alias c_plsori  plsori;
01442 alias c_plspage plspage;
01443 // alias c_plspal0 plspal0;
01444 // alias c_plspal1 plspal1;
01445 alias c_plspause     plspause;
01446 alias c_plsstrm      plsstrm;
01447 alias c_plssub       plssub;
01448 alias c_plssym       plssym;
01449 alias c_plstar       plstar;
01450 //alias c_plstart plstart;
01451 alias c_plstransform plstransform;
01452 alias c_plstripa     plstripa;
01453 //alias c_plstripc plstripc;
01454 alias c_plstripd     plstripd;
01455 //alias c_plstring     plstring;
01456 //alias c_plstring3     plstring3;
01457 //alias c_plstyl plstyl;
01458 //alias c_plsurf3d plsurf3d;
01459 //alias c_plsurf3dl plsurf3dl;
01460 //alias c_plsvect plsvect;
01461 alias c_plsvpa   plsvpa;
01462 alias c_plsxax   plsxax;
01463 alias c_plsyax   plsyax;
01464 //alias c_plsym plsym;
01465 alias c_plszax   plszax;
01466 alias c_pltext   pltext;
01467 //alias c_pltimefmt pltimefmt;
01468 alias c_plvasp   plvasp;
01469 //alias c_plvect plvect;
01470 alias c_plvpas   plvpas;
01471 alias c_plvpor   plvpor;
01472 alias c_plvsta   plvsta;
01473 alias c_plw3d    plw3d;
01474 alias c_plwid    plwid;
01475 alias c_plwind   plwind;
01476 
01477 alias c_plxormod plxormod;
01478 
01479 
01480 // Redefine some old function names for backward compatibility
01481 
01482 
01483 alias pleop          plclr;
01484 alias plbop          plpage;
01485 alias plcol0         plcol;
01486 alias plfcont        plcontf;
01487 alias plAlloc2dGrid  Alloc2dGrid;
01488 alias plFree2dGrid   Free2dGrid;
01489 alias plMinMax2dGrid MinMax2dGrid;
01490 alias plgvpd         plP_gvpd;
01491 alias plgvpw         plP_gvpw;
01492 
01493 
01494 //--------------------------------------------------------------------------* *         Function Prototypes
01495 //--------------------------------------------------------------------------
01496 
01497 
01498 // All void types
01499 // C routines callable from stub routines come first
01500 
01501 // set the format of the contour labels
01502 void c_pl_setcontlabelformat( PLINT lexp, PLINT sigdig );
01503 
01504 // set offset and spacing of contour labels
01505 void c_pl_setcontlabelparam( PLFLT offset, PLFLT size, PLFLT spacing, PLINT active );
01506 
01507 // Advance to subpage "page", or to the next one if "page" = 0.
01508 void c_pladv( PLINT page );
01509 
01510 // simple arrow plotter.
01511 void c_plvect( PLFLT **u, PLFLT **v, PLINT nx, PLINT ny, PLFLT scale,
01512                void function( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ) pltr, PLPointer pltr_data );
01513 void c_plsvect( PLFLT *arrowx, PLFLT *arrowy, PLINT npts, PLBOOL fill );
01514 
01515 // This functions similarly to plbox() except that the origin of the axes
01516 // is placed at the user-specified point (x0, y0).
01517 void c_plaxes( PLFLT x0, PLFLT y0, char *xopt, PLFLT xtick, PLINT nxsub,
01518                char *yopt, PLFLT ytick, PLINT nysub );
01519 
01520 // Flags for plbin() - opt argument
01521 const PL_BIN_DEFAULT  = 0;
01522 const PL_BIN_CENTRED  = 1;
01523 const PL_BIN_NOEXPAND = 2;
01524 const PL_BIN_NOEMPTY  = 4;
01525 
01526 // Plot a histogram using x to store data values and y to store frequencies
01527 void c_plbin( PLINT nbin, PLFLT *x, PLFLT *y, PLINT opt );
01528 
01529 // Start new page.  Should only be used with pleop().
01530 void c_plbop();
01531 
01532 // This draws a box around the current viewport.
01533 void c_plbox( char *xopt, PLFLT xtick, PLINT nxsub, char *yopt, PLFLT ytick, PLINT nysub );
01534 
01535 // This is the 3-d analogue of plbox().
01536 void c_plbox3( char *xopt, char *xlabel, PLFLT xtick, PLINT nsubx, char *yopt,
01537                char *ylabel, PLFLT ytick, PLINT nsuby, char *zopt, char *zlabel,
01538                PLFLT ztick, PLINT nsubz );
01539 
01540 // Calculate broken-down time from continuous time for current stream.
01541 void c_plbtime( PLINT *year, PLINT *month, PLINT *day, PLINT *hour, PLINT *min, PLFLT *sec, PLFLT ctime );
01542 
01543 // Setup a user-provided custom labeling function
01544 void c_plslabelfunc( void function( PLINT, PLFLT, char*, PLINT, PLPointer ) labelfunc,
01545                      PLPointer label_data );
01546 
01547 // Calculate world coordinates and subpage from relative device coordinates.
01548 void c_plcalc_world( PLFLT rx, PLFLT ry, PLFLT *wx, PLFLT *wy, PLINT *window );
01549 
01550 // Plot an arc
01551 void c_plarc( PLFLT x, PLFLT y, PLFLT a, PLFLT b, PLFLT angle1, PLFLT angle2,
01552               PLFLT rotate, PLBOOL fill );
01553 
01554 // Clear current subpage.
01555 void c_plclear();
01556 
01557 // Set color, map 0.  Argument is integer between 0 and 15.
01558 void c_plcol0( PLINT icol0 );
01559 
01560 // Set color, map 1.  Argument is a float between 0. and 1.
01561 void c_plcol1( PLFLT col1 );
01562 
01563 // Configure transformation between continuous and broken-down time (and
01564 // vice versa) for current stream.
01565 void c_plconfigtime( PLFLT scale, PLFLT offset1, PLFLT offset2, PLINT ccontrol, PLBOOL ifbtime_offset,
01566                      PLINT year, PLINT month, PLINT day, PLINT hour, PLINT min, PLFLT sec );
01567 
01568 // Draws a contour plot from data in f(nx,ny).  Is just a front-end to
01569 // plfcont, with a particular choice for f2eval and f2eval_data.
01570 //
01571 void c_plcont( PLFLT **f, PLINT nx, PLINT ny, PLINT kx, PLINT lx, PLINT ky, PLINT ly,
01572                PLFLT *clevel, PLINT nlevel,
01573                void function( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ) pltr, PLPointer pltr_data );
01574 
01575 // Draws a contour plot using the function evaluator f2eval and data stored
01576 // by way of the f2eval_data pointer.  This allows arbitrary organizations
01577 // of 2d array data to be used.
01578 //
01579 void plfcont( PLFLT function( PLINT, PLINT, PLPointer ) f2eval, PLPointer f2eval_data, PLINT nx, PLINT ny,
01580               PLINT kx, PLINT lx, PLINT ky, PLINT ly, PLFLT *clevel, PLINT nlevel,
01581               void function( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ) pltr, PLPointer pltr_data );
01582 
01583 // Copies state parameters from the reference stream to the current stream.
01584 void c_plcpstrm( PLINT iplsr, PLBOOL flags );
01585 
01586 // Calculate continuous time from broken-down time for current stream.
01587 void c_plctime( PLINT year, PLINT month, PLINT day, PLINT hour, PLINT min, PLFLT sec, PLFLT *ctime );
01588 
01589 // Converts input values from relative device coordinates to relative plot
01590 // coordinates.
01591 void pldid2pc( PLFLT *xmin, PLFLT *ymin, PLFLT *xmax, PLFLT *ymax );
01592 
01593 // Converts input values from relative plot coordinates to relative
01594 // device coordinates.
01595 void pldip2dc( PLFLT *xmin, PLFLT *ymin, PLFLT *xmax, PLFLT *ymax );
01596 
01597 // End a plotting session for all open streams.
01598 void c_plend();
01599 
01600 // End a plotting session for the current stream only.
01601 void c_plend1();
01602 
01603 // Simple interface for defining viewport and window.
01604 void c_plenv( PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLINT just, PLINT axis );
01605 
01606 // similar to plenv() above, but in multiplot mode does not advance the subpage,
01607 // instead the current subpage is cleared
01608 void c_plenv0( PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLINT just, PLINT axis );
01609 
01610 // End current page.  Should only be used with plbop().
01611 void c_pleop();
01612 
01613 // Plot horizontal error bars (xmin(i),y(i)) to (xmax(i),y(i))
01614 void c_plerrx( PLINT n, PLFLT *xmin, PLFLT *xmax, PLFLT *y );
01615 
01616 // Plot vertical error bars (x,ymin(i)) to (x(i),ymax(i))
01617 void c_plerry( PLINT n, PLFLT *x, PLFLT *ymin, PLFLT *ymax );
01618 
01619 // Advance to the next family file on the next new page
01620 void c_plfamadv();
01621 
01622 // Pattern fills the polygon bounded by the input points.
01623 void c_plfill( PLINT n, PLFLT *x, PLFLT *y );
01624 
01625 // Pattern fills the 3d polygon bounded by the input points.
01626 void c_plfill3( PLINT n, PLFLT *x, PLFLT *y, PLFLT *z );
01627 
01628 // Flushes the output stream.  Use sparingly, if at all.
01629 void c_plflush();
01630 
01631 // Sets the global font flag to 'ifont'.
01632 void c_plfont( PLINT ifont );
01633 
01634 // Load specified font set.
01635 void c_plfontld( PLINT fnt );
01636 
01637 // Get character default height and current (scaled) height
01638 void c_plgchr( PLFLT *p_def, PLFLT *p_ht );
01639 
01640 // Returns 8 bit RGB values for given color from color map 0
01641 void c_plgcol0( PLINT icol0, PLINT *r, PLINT *g, PLINT *b );
01642 
01643 // Returns 8 bit RGB values for given color from color map 0 and alpha value
01644 void c_plgcol0a( PLINT icol0, PLINT *r, PLINT *g, PLINT *b, PLFLT *a );
01645 
01646 // Returns the background color by 8 bit RGB value
01647 void c_plgcolbg( PLINT *r, PLINT *g, PLINT *b );
01648 
01649 // Returns the background color by 8 bit RGB value and alpha value
01650 void c_plgcolbga( PLINT *r, PLINT *g, PLINT *b, PLFLT *a );
01651 
01652 // Returns the current compression setting
01653 void c_plgcompression( PLINT *compression );
01654 
01655 // Get the current device (keyword) name
01656 void c_plgdev( char *p_dev );
01657 
01658 // Retrieve current window into device space
01659 void c_plgdidev( PLFLT *p_mar, PLFLT *p_aspect, PLFLT *p_jx, PLFLT *p_jy );
01660 
01661 // Get plot orientation
01662 void c_plgdiori( PLFLT *p_rot );
01663 
01664 // Retrieve current window into plot space
01665 void c_plgdiplt( PLFLT *p_xmin, PLFLT *p_ymin, PLFLT *p_xmax, PLFLT *p_ymax );
01666 
01667 // Get FCI (font characterization integer)
01668 
01669 void  c_plgfci( PLUNICODE *pfci );
01670 
01671 // Get family file parameters
01672 
01673 void  c_plgfam( PLINT *p_fam, PLINT *p_num, PLINT *p_bmax );
01674 
01675 // Get the (current) output file name.  Must be preallocated to >80 bytes
01676 void c_plgfnam( char *fnam );
01677 
01678 // Get the current font family, style and weight
01679 void c_plgfont( PLINT *p_family, PLINT *p_style, PLINT *p_weight );
01680 
01681 // Get the (current) run level.
01682 void c_plglevel( PLINT *p_level );
01683 
01684 // Get output device parameters.
01685 void c_plgpage( PLFLT *p_xp, PLFLT *p_yp, PLINT *p_xleng, PLINT *p_yleng,
01686                 PLINT *p_xoff, PLINT *p_yoff );
01687 
01688 // Switches to graphics screen.
01689 void c_plgra();
01690 
01691 // Draw gradient in polygon.
01692 void c_plgradient( PLINT n, PLFLT *x, PLFLT *y, PLFLT angle );
01693 
01694 // grid irregularly sampled data
01695 void c_plgriddata( PLFLT *x, PLFLT *y, PLFLT *z, PLINT npts, PLFLT *xg, PLINT nptsx,
01696                    PLFLT *yg, PLINT nptsy, PLFLT **zg, PLINT type, PLFLT data );
01697 
01698 // type of gridding algorithm for plgriddata()
01699 const GRID_CSA    = 1;
01700 const GRID_DTLI   = 2;
01701 const GRID_NNI    = 3;
01702 const GRID_NNIDW  = 4;
01703 const GRID_NNLI   = 5;
01704 const GRID_NNAIDW = 6;
01705 
01706 // Get subpage boundaries in absolute coordinates
01707 void c_plgspa( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax );
01708 
01709 // Get current stream number.
01710 void c_plgstrm( PLINT *p_strm );
01711 
01712 // Get the current library version number
01713 void c_plgver( char *p_ver );
01714 
01715 // Get viewport boundaries in normalized device coordinates
01716 void c_plgvpd( PLFLT *p_xmin, PLFLT *p_xmax, PLFLT *p_ymin, PLFLT *p_ymax );
01717 
01718 // Get viewport boundaries in world coordinates
01719 void c_plgvpw( PLFLT *p_xmin, PLFLT *p_xmax, PLFLT *p_ymin, PLFLT *p_ymax );
01720 
01721 // Get x axis labeling parameters
01722 void c_plgxax( PLINT *p_digmax, PLINT *p_digits );
01723 
01724 // Get y axis labeling parameters
01725 void c_plgyax( PLINT *p_digmax, PLINT *p_digits );
01726 
01727 // Get z axis labeling parameters
01728 void c_plgzax( PLINT *p_digmax, PLINT *p_digits );
01729 
01730 // Flags for plhist() - opt argument; note: some flags are passed to
01731 // plbin() for the actual plotting
01732 const PL_HIST_DEFAULT         = 0;
01733 const PL_HIST_NOSCALING       = 1;
01734 const PL_HIST_IGNORE_OUTLIERS = 2;
01735 const PL_HIST_NOEXPAND        = 8;
01736 const PL_HIST_NOEMPTY         = 16;
01737 
01738 // Draws a histogram of n values of a variable in array data[0..n-1]
01739 void c_plhist( PLINT n, PLFLT *data, PLFLT datmin, PLFLT datmax, PLINT nbin, PLINT opt );
01740 
01741 // Set current color (map 0) by hue, lightness, and saturation.
01742 void c_plhls( PLFLT h, PLFLT l, PLFLT s );
01743 
01744 // Functions for converting between HLS and RGB color space
01745 void c_plhlsrgb( PLFLT h, PLFLT l, PLFLT s, PLFLT *p_r, PLFLT *p_g, PLFLT *p_b );
01746 
01747 // Initializes PLplot, using preset or default options
01748 void c_plinit();
01749 
01750 // Draws a line segment from (x1, y1) to (x2, y2).
01751 void c_pljoin( PLFLT x1, PLFLT y1, PLFLT x2, PLFLT y2 );
01752 
01753 // Simple routine for labelling graphs.
01754 void c_pllab( char *xlabel, char *ylabel, char *tlabel );
01755 
01756 // Flags used for position argument of both pllegend and plcolorbar
01757 const PL_POSITION_LEFT     = 1;
01758 const PL_POSITION_RIGHT    = 2;
01759 const PL_POSITION_TOP      = 4;
01760 const PL_POSITION_BOTTOM   = 8;
01761 const PL_POSITION_INSIDE   = 16;
01762 const PL_POSITION_OUTSIDE  = 32;
01763 const PL_POSITION_VIEWPORT = 64;
01764 const PL_POSITION_SUBPAGE  = 128;
01765 
01766 // Flags for pllegend
01767 const PL_LEGEND_NONE         = 1;
01768 const PL_LEGEND_COLOR_BOX    = 2;
01769 const PL_LEGEND_LINE         = 4;
01770 const PL_LEGEND_SYMBOL       = 8;
01771 const PL_LEGEND_TEXT_LEFT    = 16;
01772 const PL_LEGEND_BACKGROUND   = 32;
01773 const PL_LEGEND_BOUNDING_BOX = 64;
01774 const PL_LEGEND_ROW_MAJOR    = 128;
01775 
01776 // Flags for plcolorbar
01777 const PL_COLORBAR_LABEL_LEFT   = 1;
01778 const PL_COLORBAR_LABEL_RIGHT  = 2;
01779 const PL_COLORBAR_LABEL_TOP    = 4;
01780 const PL_COLORBAR_LABEL_BOTTOM = 8;
01781 const PL_COLORBAR_IMAGE        = 16;
01782 const PL_COLORBAR_SHADE        = 32;
01783 const PL_COLORBAR_GRADIENT     = 64;
01784 const PL_COLORBAR_CAP_LOW      = 128;
01785 const PL_COLORBAR_CAP_HIGH     = 256;
01786 const PL_COLORBAR_SHADE_LABEL  = 512;
01787 
01788 // Routine for drawing discrete line, symbol, or cmap0 legends
01789 void c_pllegend( PLFLT *p_legend_width, PLFLT *p_legend_height,
01790                  PLINT opt, PLINT position, PLFLT x, PLFLT y, PLFLT plot_width,
01791                  PLINT bg_color, PLINT bb_color, PLINT bb_style,
01792                  PLINT nrow, PLINT ncolumn,
01793                  PLINT nlegend, PLINT *opt_array,
01794                  PLFLT text_offset, PLFLT text_scale, PLFLT text_spacing,
01795                  PLFLT text_justification,
01796                  PLINT *text_colors, char **text,
01797                  PLINT *box_colors, PLINT *box_patterns,
01798                  PLFLT *box_scales, PLINT *box_line_widths,
01799                  PLINT *line_colors, PLINT *line_styles,
01800                  PLINT *line_widths,
01801                  PLINT *symbol_colors, PLFLT *symbol_scales,
01802                  PLINT *symbol_numbers, char **symbols );
01803 
01804 // Sets position of the light source
01805 void c_pllightsource( PLFLT x, PLFLT y, PLFLT z );
01806 
01807 // Draws line segments connecting a series of points.
01808 void c_plline( PLINT n, PLFLT *x, PLFLT *y );
01809 
01810 // Draws a line in 3 space.
01811 void c_plline3( PLINT n, PLFLT *x, PLFLT *y, PLFLT *z );
01812 
01813 // Set line style.
01814 void c_pllsty( PLINT lin );
01815 
01816 // plot continental outline in world coordinates
01817 void c_plmap( void function( PLINT, PLFLT *, PLFLT* ) mapform, char *type, PLFLT minlong,
01818               PLFLT maxlong, PLFLT minlat, PLFLT maxlat );
01819 
01820 // Plot the latitudes and longitudes on the background.
01821 void c_plmeridians( void function( PLINT, PLFLT *, PLFLT* ) mapform, PLFLT dlong, PLFLT dlat,
01822                     PLFLT minlong, PLFLT maxlong, PLFLT minlat, PLFLT maxlat );
01823 
01824 // Plots a mesh representation of the function z[x][y].
01825 void c_plmesh( PLFLT *x, PLFLT *y, PLFLT **z, PLINT nx, PLINT ny, PLINT opt );
01826 
01827 // Plots a mesh representation of the function z[x][y] with contour
01828 void c_plmeshc( PLFLT *x, PLFLT *y, PLFLT **z, PLINT nx, PLINT ny, PLINT opt,
01829                 PLFLT *clevel, PLINT nlevel );
01830 
01831 // Creates a new stream and makes it the default.
01832 void c_plmkstrm( PLINT *p_strm );
01833 
01834 // Prints out "text" at specified position relative to viewport
01835 void c_plmtex( char *side, PLFLT disp, PLFLT pos, PLFLT just, char *text );
01836 
01837 // Prints out "text" at specified position relative to viewport (3D)
01838 void c_plmtex3( char *side, PLFLT disp, PLFLT pos, PLFLT just, char *text );
01839 
01840 // Plots a 3-d representation of the function z[x][y].
01841 void c_plot3d( PLFLT *x, PLFLT *y, PLFLT **z, PLINT nx, PLINT ny, PLINT opt, PLBOOL side );
01842 
01843 // Plots a 3-d representation of the function z[x][y] with contour.
01844 void c_plot3dc( PLFLT *x, PLFLT *y, PLFLT **z, PLINT nx, PLINT ny, PLINT opt,
01845                 PLFLT *clevel, PLINT nlevel );
01846 
01847 // Plots a 3-d representation of the function z[x][y] with contour and
01848 // y index limits.
01849 void c_plot3dcl( PLFLT *x, PLFLT *y, PLFLT **z, PLINT nx, PLINT ny, PLINT opt,
01850                  PLFLT *clevel, PLINT nlevel, PLINT ixstart, PLINT ixn,
01851                  PLINT *indexymin, PLINT *indexymax );
01852 
01853 //
01854 // definitions for the opt argument in plot3dc() and plsurf3d()
01855 //
01856 // DRAW_LINEX *must* be 1 and DRAW_LINEY *must* be 2, because of legacy code!
01857 //
01858 const DRAW_LINEX  = 1 << 0;                  // draw lines parallel to the X axis
01859 const DRAW_LINEY  = 1 << 1;                  // draw lines parallel to the Y axis
01860 const DRAW_LINEXY = DRAW_LINEX | DRAW_LINEY; // draw lines parallel to both the X and Y axis
01861 const MAG_COLOR   = 1 << 2;                  // draw the mesh with a color dependent of the magnitude
01862 const BASE_CONT   = 1 << 3;                  // draw contour plot at bottom xy plane
01863 const TOP_CONT    = 1 << 4;                  // draw contour plot at top xy plane
01864 const SURF_CONT   = 1 << 5;                  // draw contour plot at surface
01865 const DRAW_SIDES  = 1 << 6;                  // draw sides
01866 const FACETED     = 1 << 7;                  // draw outline for each square that makes up the surface
01867 const MESH        = 1 << 8;                  // draw mesh
01868 
01869 //
01870 //  valid options for plot3dc():
01871 //
01872 //  DRAW_SIDES, BASE_CONT, TOP_CONT (not yet),
01873 //  MAG_COLOR, DRAW_LINEX, DRAW_LINEY, DRAW_LINEXY.
01874 //
01875 //  valid options for plsurf3d():
01876 //
01877 //  MAG_COLOR, BASE_CONT, SURF_CONT, FACETED, DRAW_SIDES.
01878 //
01879 
01880 // Set fill pattern directly.
01881 void c_plpat( PLINT nlin, PLINT *inc, PLINT *del );
01882 
01883 // Plots array y against x for n points using ASCII code "code".
01884 void c_plpoin( PLINT n, PLFLT *x, PLFLT *y, PLINT code );
01885 
01886 // Draws a series of points in 3 space.
01887 void c_plpoin3( PLINT n, PLFLT *x, PLFLT *y, PLFLT *z, PLINT code );
01888 
01889 // Draws a polygon in 3 space.
01890 void c_plpoly3( PLINT n, PLFLT *x, PLFLT *y, PLFLT *z, PLBOOL *draw, PLBOOL ifcc );
01891 
01892 // Plots array y against x for n points using (UTF-8) text string
01893 void c_plstring( PLINT n, PLFLT *x, PLFLT *y, char *text );
01894 
01895 // Draws a series of points (described by [UTF8] text string) in 3 space.
01896 void c_plstring3( PLINT n, PLFLT *x, PLFLT *y, PLFLT *z, char * text );
01897 
01898 // Set the floating point precision (in number of places) in numeric labels.
01899 void c_plprec( PLINT setp, PLINT prec );
01900 
01901 // Set fill pattern, using one of the predefined patterns.
01902 void c_plpsty( PLINT patt );
01903 
01904 // Prints out "text" at world cooordinate (x,y).
01905 void c_plptex( PLFLT x, PLFLT y, PLFLT dx, PLFLT dy, PLFLT just, char *text );
01906 
01907 // Prints out "text" at world cooordinate (x,y,z).
01908 void c_plptex3( PLFLT wx, PLFLT wy, PLFLT wz, PLFLT dx, PLFLT dy, PLFLT dz, PLFLT sx, PLFLT sy, PLFLT sz, PLFLT just, char *text );
01909 
01910 // Random number generator based on Mersenne Twister.
01911 // Obtain real random number in range [0,1].
01912 PLFLT c_plrandd();
01913 
01914 // Replays contents of plot buffer to current device/file.
01915 void c_plreplot();
01916 
01917 // Set line color by red, green, blue from  0. to 1.
01918 
01919 void  c_plrgb( PLFLT r, PLFLT g, PLFLT b );
01920 
01921 // Set line color by 8 bit RGB values.
01922 
01923 void  c_plrgb1( PLINT r, PLINT g, PLINT b );
01924 
01925 // Functions for converting between HLS and RGB color space
01926 
01927 void  c_plrgbhls( PLFLT r, PLFLT g, PLFLT b, PLFLT *p_h, PLFLT *p_l, PLFLT *p_s );
01928 
01929 // Set character height.
01930 
01931 void  c_plschr( PLFLT def, PLFLT scale );
01932 
01933 // Set color map 0 colors by 8 bit RGB values
01934 void c_plscmap0( PLINT *r, PLINT *g, PLINT *b, PLINT ncol0 );
01935 
01936 // Set color map 0 colors by 8 bit RGB values and alpha values
01937 void c_plscmap0a( PLINT *r, PLINT *g, PLINT *b, PLFLT *a, PLINT ncol0 );
01938 
01939 // Set number of colors in cmap 0
01940 void c_plscmap0n( PLINT ncol0 );
01941 
01942 // Set color map 1 colors by 8 bit RGB values
01943 void c_plscmap1( PLINT *r, PLINT *g, PLINT *b, PLINT ncol1 );
01944 
01945 // Set color map 1 colors by 8 bit RGB and alpha values
01946 void c_plscmap1a( PLINT *r, PLINT *g, PLINT *b, PLFLT *a, PLINT ncol1 );
01947 
01948 // Set color map 1 colors using a piece-wise linear relationship between
01949 // intensity [0,1] (cmap 1 index) and position in HLS or RGB color space.
01950 void c_plscmap1l( PLBOOL itype, PLINT npts, PLFLT *intensity, PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLBOOL *rev );
01951 
01952 // Set color map 1 colors using a piece-wise linear relationship between
01953 // intensity [0,1] (cmap 1 index) and position in HLS or RGB color space.
01954 // Will also linear interpolate alpha values.
01955 void c_plscmap1la( PLBOOL itype, PLINT npts, PLFLT *intensity, PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLFLT *a, PLBOOL *rev );
01956 
01957 // Set number of colors in cmap 1
01958 void c_plscmap1n( PLINT ncol1 );
01959 
01960 // Set a given color from color map 0 by 8 bit RGB value
01961 void c_plscol0( PLINT icol0, PLINT r, PLINT g, PLINT b );
01962 
01963 // Set a given color from color map 0 by 8 bit RGB value
01964 void c_plscol0a( PLINT icol0, PLINT r, PLINT g, PLINT b, PLFLT a );
01965 
01966 // Set the background color by 8 bit RGB value
01967 void c_plscolbg( PLINT r, PLINT g, PLINT b );
01968 
01969 // Set the background color by 8 bit RGB value and alpha value
01970 void c_plscolbga( PLINT r, PLINT g, PLINT b, PLFLT a );
01971 
01972 // Used to globally turn color output on/off
01973 void c_plscolor( PLINT color );
01974 
01975 // Set the compression level
01976 
01977 void  c_plscompression( PLINT compression );
01978 
01979 // Set the device (keyword) name
01980 void c_plsdev( char *devname );
01981 
01982 // Set window into device space using margin, aspect ratio, and
01983 // justification
01984 
01985 void  c_plsdidev( PLFLT mar, PLFLT aspect, PLFLT jx, PLFLT jy );
01986 
01987 // Set up transformation from metafile coordinates.
01988 
01989 void  c_plsdimap( PLINT dimxmin, PLINT dimxmax, PLINT dimymin, PLINT dimymax, PLFLT dimxpmm, PLFLT dimypmm );
01990 
01991 // Set plot orientation, specifying rotation in units of pi/2.
01992 
01993 void  c_plsdiori( PLFLT rot );
01994 
01995 // Set window into plot space
01996 
01997 void  c_plsdiplt( PLFLT xmin, PLFLT ymin, PLFLT xmax, PLFLT ymax );
01998 
01999 // Set window into plot space incrementally (zoom)
02000 void c_plsdiplz( PLFLT xmin, PLFLT ymin, PLFLT xmax, PLFLT ymax );
02001 
02002 // Set seed for internal random number generator
02003 void c_plseed( uint s );
02004 
02005 // Set the escape character for text strings.
02006 void c_plsesc( char esc );
02007 
02008 // Set family file parameters
02009 
02010 void  c_plsfam( PLINT fam, PLINT num, PLINT bmax );
02011 
02012 // Set FCI (font characterization integer)
02013 
02014 void  c_plsfci( PLUNICODE fci );
02015 
02016 // Set the output file name.
02017 void c_plsfnam( char *fnam );
02018 
02019 // Set the current font family, style and weight
02020 
02021 void  c_plsfont( PLINT family, PLINT style, PLINT weight );
02022 
02023 // Shade region.
02024 void c_plshade( PLFLT **a, PLINT nx, PLINT ny, PLINT function( PLFLT, PLFLT ) defined, PLFLT left,
02025                 PLFLT right, PLFLT bottom, PLFLT top, PLFLT shade_min, PLFLT shade_max, PLINT sh_cmap,
02026                 PLFLT sh_color, PLINT sh_width, PLINT min_color, PLINT min_width, PLINT max_color,
02027                 PLINT max_width, void function( PLINT, PLFLT *, PLFLT* ) fill, PLBOOL rectangular,
02028                 void function( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ) pltr, PLPointer pltr_data );
02029 
02030 void c_plshades( PLFLT **a, PLINT nx, PLINT ny, PLINT function( PLFLT, PLFLT ) defined, PLFLT xmin,
02031                  PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT *clevel, PLINT nlevel, PLINT fill_width,
02032                  PLINT cont_color, PLINT cont_width, void function( PLINT, PLFLT *, PLFLT* ) fill,
02033                  PLBOOL rectangular, void function( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ) pltr,
02034                  PLPointer pltr_data );
02035 
02036 void  plfshade( PLFLT function( PLINT, PLINT, PLPointer ) f2eval, PLPointer f2eval_data, PLFLT function( PLINT, PLINT, PLPointer ) c2eval, PLPointer c2eval_data, PLINT nx, PLINT ny, PLFLT left, PLFLT right, PLFLT bottom, PLFLT top, PLFLT shade_min, PLFLT shade_max, PLINT sh_cmap, PLFLT sh_color, PLINT sh_width, PLINT min_color, PLINT min_width, PLINT max_color, PLINT max_width, void function( PLINT, PLFLT *, PLFLT * ) fill, PLBOOL rectangular, void function( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ) pltr, PLPointer pltr_data );
02037 
02038 // Set up lengths of major tick marks.
02039 
02040 void  c_plsmaj( PLFLT def, PLFLT scale );
02041 
02042 // Set the memory area to be plotted (with the 'mem' driver)
02043 
02044 void  c_plsmem( PLINT maxx, PLINT maxy, void *plotmem );
02045 
02046 // Set up lengths of minor tick marks.
02047 
02048 void  c_plsmin( PLFLT def, PLFLT scale );
02049 
02050 // Set orientation.  Must be done before calling plinit.
02051 
02052 void  c_plsori( PLINT ori );
02053 
02054 // Set output device parameters.  Usually ignored by the driver.
02055 void c_plspage( PLFLT xp, PLFLT yp, PLINT xleng, PLINT yleng, PLINT xoff, PLINT yoff );
02056 
02057 // Set the colors for color table 0 from a cmap0 file
02058 void c_plspal0( char* filename );
02059 
02060 // Set the colors for color table 1 from a cmap1 file
02061 void c_plspal1( char *filename, PLBOOL interpolate );
02062 
02063 // Set the pause (on end-of-page) status
02064 void c_plspause( PLBOOL pause );
02065 
02066 // Set stream number.
02067 
02068 void  c_plsstrm( PLINT strm );
02069 
02070 // Set the number of subwindows in x and y
02071 
02072 void  c_plssub( PLINT nx, PLINT ny );
02073 
02074 // Set symbol height.
02075 
02076 void  c_plssym( PLFLT def, PLFLT scale );
02077 
02078 // Initialize PLplot, passing in the windows/page settings.
02079 void c_plstar( PLINT nx, PLINT ny );
02080 
02081 // Initialize PLplot, passing the device name and windows/page settings.
02082 void c_plstart( char *devname, PLINT nx, PLINT ny );
02083 
02084 // Set the coordinate transform
02085 void c_plstransform( void ( *coordinate_transform )( PLFLT, PLFLT, PLFLT*, PLFLT*, PLPointer ), PLPointer coordinate_transform_data );
02086 
02087 // Add a point to a stripchart.
02088 void c_plstripa( PLINT id, PLINT pen, PLFLT x, PLFLT y );
02089 
02090 // Create 1d stripchart
02091 void c_plstripc( PLINT *id, char *xspec, char *yspec, PLFLT xmin, PLFLT xmax, PLFLT xjump, PLFLT ymin, PLFLT ymax, PLFLT xlpos, PLFLT ylpos, PLBOOL y_ascl, PLBOOL acc, PLINT colbox, PLINT collab, PLINT *colline, PLINT *styline, char **legline, char *labx, char *laby, char *labtop );
02092 
02093 // Deletes and releases memory used by a stripchart.
02094 void c_plstripd( PLINT id );
02095 
02096 // plots a 2d image (or a matrix too large for plshade() )
02097 void c_plimagefr( PLFLT **idata, PLINT nx, PLINT ny, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax,
02098                   PLFLT zmin, PLFLT zmax, PLFLT valuemin, PLFLT valuemax,
02099                   void function( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ), PLPointer pltr_data );
02100 
02101 // plots a 2d image (or a matrix too large for plshade() ) - colors
02102 // automatically scaled
02103 void c_plimage( PLFLT **idata, PLINT nx, PLINT ny, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax,
02104                 PLFLT zmin, PLFLT zmax, PLFLT Dxmin, PLFLT Dxmax, PLFLT Dymin, PLFLT Dymax );
02105 
02106 // Set up a new line style
02107 void c_plstyl( PLINT nms, PLINT *mark, PLINT *space );
02108 
02109 // Plots the 3d surface representation of the function z[x][y].
02110 void c_plsurf3d( PLFLT *x, PLFLT *y, PLFLT **z, PLINT nx, PLINT ny, PLINT opt,
02111                  PLFLT *clevel, PLINT nlevel );
02112 
02113 // Plots the 3d surface representation of the function z[x][y] with y
02114 // index limits.
02115 void c_plsurf3dl( PLFLT *x, PLFLT *y, PLFLT **z, PLINT nx, PLINT ny, PLINT opt, PLFLT *clevel,
02116                   PLINT nlevel, PLINT ixstart, PLINT ixn, PLINT *indexymin, PLINT *indexymax );
02117 
02118 // Sets the edges of the viewport to the specified absolute coordinates
02119 void c_plsvpa( PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax );
02120 
02121 // Set x axis labeling parameters
02122 void c_plsxax( PLINT digmax, PLINT digits );
02123 
02124 // Set inferior X window
02125 void plsxwin( PLINT window_id );
02126 
02127 // Set y axis labeling parameters
02128 void c_plsyax( PLINT digmax, PLINT digits );
02129 
02130 // Plots array y against x for n points using Hershey symbol "code"
02131 void c_plsym( PLINT n, PLFLT *x, PLFLT *y, PLINT code );
02132 
02133 // Set z axis labeling parameters
02134 
02135 void  c_plszax( PLINT digmax, PLINT digits );
02136 
02137 // Switches to text screen.
02138 
02139 void  c_pltext();
02140 
02141 // Set the format for date / time labels
02142 void c_pltimefmt( char *fmt );
02143 
02144 // Sets the edges of the viewport with the given aspect ratio, leaving
02145 // room for labels.
02146 
02147 void  c_plvasp( PLFLT aspect );
02148 
02149 // Creates the largest viewport of the specified aspect ratio that fits
02150 // within the specified normalized subpage coordinates.
02151 
02152 void  c_plvpas( PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT aspect );
02153 
02154 // Creates a viewport with the specified normalized subpage coordinates.
02155 
02156 void  c_plvpor( PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax );
02157 
02158 // Defines a "standard" viewport with seven character heights for
02159 // the left margin and four character heights everywhere else.
02160 
02161 void  c_plvsta();
02162 
02163 // Set up a window for three-dimensional plotting.
02164 
02165 void  c_plw3d( PLFLT basex, PLFLT basey, PLFLT height, PLFLT xmin0, PLFLT xmax0, PLFLT ymin0, PLFLT ymax0, PLFLT zmin0, PLFLT zmax0, PLFLT alt, PLFLT az );
02166 
02167 // Set pen width.
02168 
02169 void  c_plwid( PLINT width );
02170 
02171 // Set up world coordinates of the viewport boundaries (2d plots).
02172 
02173 void  c_plwind( PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax );
02174 
02175 //  set xor mode; mode = 1-enter, 0-leave, status = 0 if not interactive device
02176 
02177 void  c_plxormod( PLBOOL mode, PLBOOL *status );
02178 
02179 //--------------------------------------------------------------------------* *         Functions for use from C or C++ only
02180 //--------------------------------------------------------------------------
02181 
02182 // Returns a list of file-oriented device names and their menu strings
02183 
02184 void  plgFileDevs( char ***p_menustr, char ***p_devname, int *p_ndev );
02185 
02186 // Returns a list of all device names and their menu strings
02187 
02188 void  plgDevs( char ***p_menustr, char ***p_devname, int *p_ndev );
02189 
02190 // Set the function pointer for the keyboard event handler
02191 
02192 void  plsKeyEH( void function( PLGraphicsIn *, void *, int * ) KeyEH, void *KeyEH_data );
02193 
02194 // Set the function pointer for the (mouse) button event handler
02195 
02196 void  plsButtonEH( void function( PLGraphicsIn *, void *, int * ) ButtonEH, void *ButtonEH_data );
02197 
02198 // Sets an optional user bop handler
02199 
02200 void  plsbopH( void function( void *, int * ) handler, void *handler_data );
02201 
02202 // Sets an optional user eop handler
02203 
02204 void  plseopH( void function( void *, int * ) handler, void *handler_data );
02205 
02206 // Set the variables to be used for storing error info
02207 
02208 void  plsError( PLINT *errcode, char *errmsg );
02209 
02210 // Sets an optional user exit handler.
02211 
02212 void  plsexit( int function( char * ) handler );
02213 
02214 // Sets an optional user abort handler.
02215 
02216 void  plsabort( void function( char * ) handler );
02217 
02218 // Transformation routines
02219 
02220 // Identity transformation.
02221 void pltr0( PLFLT x, PLFLT y, PLFLT* tx, PLFLT* ty, PLPointer pltr_data );
02222 
02223 // Does linear interpolation from singly dimensioned coord arrays.
02224 void pltr1( PLFLT x, PLFLT y, PLFLT* tx, PLFLT* ty, PLPointer pltr_data );
02225 
02226 // Does linear interpolation from doubly dimensioned coord arrays
02227 // (column dominant, as per normal C 2d arrays).
02228 void pltr2( PLFLT x, PLFLT y, PLFLT* tx, PLFLT* ty, PLPointer pltr_data );
02229 
02230 // Just like pltr2() but uses pointer arithmetic to get coordinates from
02231 // 2d grid tables.
02232 void pltr2p( PLFLT x, PLFLT y, PLFLT* tx, PLFLT* ty, PLPointer pltr_data );
02233 
02234 // Identity transformation for plots from Fortran.
02235 void pltr0f( PLFLT x, PLFLT y, PLFLT* tx, PLFLT* ty, void* pltr_data );
02236 
02237 // Does linear interpolation from doubly dimensioned coord arrays
02238 // (row dominant, i.e. Fortran ordering).
02239 void pltr2f( PLFLT x, PLFLT y, PLFLT* tx, PLFLT* ty, void* pltr_data );
02240 
02241 // Function evaluators
02242 
02243 // Does a lookup from a 2d function array.  Array is of type (PLFLT **),
02244 // and is column dominant (normal C ordering).
02245 
02246 PLFLT  plf2eval2( PLINT ix, PLINT iy, PLPointer plf2eval_data );
02247 
02248 // Does a lookup from a 2d function array.  Array is of type (PLFLT *),
02249 // and is column dominant (normal C ordering).
02250 
02251 PLFLT  plf2eval( PLINT ix, PLINT iy, PLPointer plf2eval_data );
02252 
02253 // Does a lookup from a 2d function array.  Array is of type (PLFLT *),
02254 // and is row dominant (Fortran ordering).
02255 
02256 PLFLT  plf2evalr( PLINT ix, PLINT iy, PLPointer plf2eval_data );
02257 
02258 // Command line parsing utilities
02259 // Clear internal option table info structure.
02260 void plClearOpts();
02261 
02262 // Reset internal option table info structure.
02263 void plResetOpts();
02264 
02265 // Merge user option table into internal info structure.
02266 
02267 int  plMergeOpts( PLOptionTable *options, char *name, char **notes );
02268 
02269 // Set the strings used in usage and syntax messages.
02270 
02271 void  plSetUsage( char *program_string, char *usage_string );
02272 
02273 // Process input strings, treating them as an option and argument pair.
02274 // The first is for the external API, the second the work routine declared
02275 // here for backward compatibilty.
02276 int c_plsetopt( char *opt, char *optarg );
02277 
02278 int plSetOpt( char *opt, char *optarg );
02279 
02280 // Process options list using current options info.
02281 int c_plparseopts( int *p_argc, char **argv, PLINT mode );
02282 
02283 // Print usage & syntax message.
02284 
02285 void  plOptUsage();
02286 
02287 // Miscellaneous
02288 
02289 // Get the escape character for text strings.
02290 
02291 void  plgesc( char *p_esc );
02292 
02293 // Front-end to driver escape function.
02294 
02295 void  pl_cmd( PLINT op, void *ptr );
02296 
02297 // Return full pathname for given file if executable
02298 
02299 int  plFindName( char *p );
02300 
02301 // Looks for the specified executable file according to usual search path.
02302 
02303 char * plFindCommand( char *fn );
02304 
02305 // Gets search name for file by concatenating the dir, subdir, and file
02306 // name, allocating memory as needed.
02307 
02308 void  plGetName( char *dir, char *subdir, char *filename, char **filespec );
02309 
02310 // Prompts human to input an integer in response to given message.
02311 
02312 PLINT  plGetInt( char *s );
02313 
02314 // Prompts human to input a float in response to given message.
02315 
02316 PLFLT  plGetFlt( char *s );
02317 
02318 // Nice way to allocate space for a vectored 2d grid
02319 
02320 // Allocates a block of memory for use as a 2-d grid of PLFLT's.
02321 
02322 void  plAlloc2dGrid( PLFLT ***f, PLINT nx, PLINT ny );
02323 
02324 // Frees a block of memory allocated with plAlloc2dGrid().
02325 
02326 void  plFree2dGrid( PLFLT **f, PLINT nx, PLINT ny );
02327 
02328 // Find the maximum and minimum of a 2d matrix allocated with plAllc2dGrid().
02329 void plMinMax2dGrid( PLFLT **f, PLINT nx, PLINT ny, PLFLT *fmax, PLFLT *fmin );
02330 
02331 // Wait for graphics input event and translate to world coordinates
02332 
02333 int  plGetCursor( PLGraphicsIn *gin );
02334 
02335 // Translates relative device coordinates to world coordinates.
02336 
02337 int  plTranslateCursor( PLGraphicsIn *gin );
02338 

Generated on Wed Oct 12 2011 20:42:22 for PLplot by  doxygen 1.7.1