From: <sm...@us...> - 2009-05-29 07:30:04
|
Revision: 10009 http://plplot.svn.sourceforge.net/plplot/?rev=10009&view=rev Author: smekal Date: 2009-05-29 07:29:50 +0000 (Fri, 29 May 2009) Log Message: ----------- D Bindings improvements: * For the functions plscmap1l and plscmap1la the last parameter can be omitted now (set to null). * Added helper function to convert D dynamic array to C dynamic array. * Aliases for C functions (pltr, fill, defined) used as callback functions in certain PLplot functions. * Added implementation of plshade and plshades. * Few syntax changes. Added D example 15 and finished example 30 (which uses plshades). Changed CMakeLists.txt file accordingly. Modified Paths: -------------- trunk/bindings/d/plplot.d trunk/examples/d/CMakeLists.txt trunk/examples/d/x30d.d Added Paths: ----------- trunk/examples/d/x15d.d Modified: trunk/bindings/d/plplot.d =================================================================== --- trunk/bindings/d/plplot.d 2009-05-28 09:23:39 UTC (rev 10008) +++ trunk/bindings/d/plplot.d 2009-05-29 07:29:50 UTC (rev 10009) @@ -6,6 +6,31 @@ // improved D interface +// helper function to convert D dynamic arrays in C dynamic arrays +private PLFLT** convert_array(PLFLT[][] a) +{ + size_t nx=a.length; + size_t ny=a[0].length; + + PLFLT** c_a = (new PLFLT*[nx]).ptr; + for(size_t i=0; i<nx; i++) { + assert(ny==a[i].length, "convert_array(): Array must be 2 dimensional!"); + c_a[i] = a[i].ptr; + } + + return c_a; +} + +// certain functions must be declared as C functions so that PLplot +// can handle them +extern (C) { + alias PLINT function(PLFLT, PLFLT) def_func; + alias void function(PLINT, PLFLT* , PLFLT*) fill_func; + alias void function(PLFLT, PLFLT, PLFLT*, PLFLT*, PLPointer) pltr_func; +} + + + /* Process options list using current options info. */ int plparseopts(char[][] args, PLINT mode) { @@ -283,13 +308,14 @@ /* Set color map 1 colors using a piece-wise linear relationship between */ /* intensity [0,1] (cmap 1 index) and position in HLS or RGB color space. */ void plscmap1l(PLBOOL itype, PLFLT[] intensity, PLFLT[] coord1, - PLFLT[] coord2, PLFLT[] coord3, PLBOOL[] rev) + PLFLT[] coord2, PLFLT[] coord3, PLBOOL[] rev=null) { PLINT npts=intensity.length; assert(npts==coord1.length, "plscmap1l(): Arrays must be of same length!"); assert(npts==coord2.length, "plscmap1l(): Arrays must be of same length!"); assert(npts==coord3.length, "plscmap1l(): Arrays must be of same length!"); - assert(npts-1==rev.length, "plscmap1l(): Array rev must be of same length then other arrays minus 1!"); + if(rev!=null) + assert(npts-1==rev.length, "plscmap1l(): Array rev must be of same length then other arrays minus 1!"); c_plscmap1l(itype, npts, intensity.ptr, coord1.ptr, coord2.ptr, coord3.ptr, rev.ptr); } @@ -298,14 +324,15 @@ /* intensity [0,1] (cmap 1 index) and position in HLS or RGB color space. */ /* Will also linear interpolate alpha values. */ void plscmap1la(PLBOOL itype, PLFLT[] intensity, PLFLT[] coord1, - PLFLT[] coord2, PLFLT[] coord3, PLFLT[] a, PLBOOL[] rev) + PLFLT[] coord2, PLFLT[] coord3, PLFLT[] a, PLBOOL[] rev=null) { PLINT npts=intensity.length; assert(npts==coord1.length, "plscmap1la(): Arrays must be of same length!"); assert(npts==coord2.length, "plscmap1la(): Arrays must be of same length!"); assert(npts==coord3.length, "plscmap1la(): Arrays must be of same length!"); assert(npts==a.length, "plscmap1la(): Arrays must be of same length!"); - assert(npts-1==rev.length, "plscmap1la(): Array rev must be of same length then other arrays minus 1!"); + if(rev!=null) + assert(npts-1==rev.length, "plscmap1la(): Array rev must be of same length then other arrays minus 1!"); c_plscmap1la(itype, npts, intensity.ptr, coord1.ptr, coord2.ptr, coord3.ptr, a.ptr, rev.ptr); } @@ -314,7 +341,7 @@ { c_plsdev(toStringz(devname)); } - + /* Set the output file name. */ void plsfnam(string fnam) { @@ -322,11 +349,31 @@ } /* Shade region. */ -//void c_plshade(PLFLT **a, PLINT nx, PLINT ny, PLINT function(PLFLT , PLFLT )defined, 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); -//void c_plshade1(PLFLT *a, PLINT nx, PLINT ny, PLINT function(PLFLT , PLFLT )defined, 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); -//void c_plshades(PLFLT **a, PLINT nx, PLINT ny, PLINT function(PLFLT , PLFLT )defined, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT *clevel, PLINT nlevel, PLINT fill_width, PLINT cont_color, PLINT cont_width, void function(PLINT , PLFLT *, PLFLT *)fill, PLBOOL rectangular, void function(PLFLT , PLFLT , PLFLT *, PLFLT *, PLPointer )pltr, PLPointer pltr_data); -//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); +void plshade(PLFLT[][] a, def_func defined, 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, PLBOOL rectangular, + pltr_func pltr=null, PLPointer pltr_data=null) +{ + PLINT nx=a.length; + PLINT ny=a[0].length; + + c_plshade(convert_array(a), nx, ny, defined, left, right, bottom, top, shade_min, shade_max, sh_cmap, + sh_color, sh_width, min_color, min_width, max_color, max_width, &c_plfill, + rectangular, pltr, pltr_data); +} +void plshades(PLFLT[][] a, def_func defined, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, + PLFLT[] clevel, PLINT fill_width, PLINT cont_color, PLINT cont_width, + PLBOOL rectangular, pltr_func pltr=null, PLPointer pltr_data=null) +{ + PLINT nx=a.length; + PLINT ny=a[0].length; + + c_plshades(convert_array(a), nx, ny, defined, xmin, xmax, ymin, ymax, clevel.ptr, clevel.length, + fill_width, cont_color, cont_width, &c_plfill, rectangular, pltr, pltr_data); +} + /* Initialize PLplot, passing the device name and windows/page settings. */ void plstart(string devname, PLINT nx, PLINT ny) { @@ -978,9 +1025,8 @@ alias c_plsfci plsfci; // alias c_plsfnam plsfnam; alias c_plsfont plsfont; -alias c_plshade plshade; -alias c_plshade1 plshade1; -alias c_plshades plshades; +//alias c_plshade plshade; +//alias c_plshades plshades; alias c_plsmaj plsmaj; alias c_plsmem plsmem; alias c_plsmin plsmin; @@ -1153,9 +1199,8 @@ void c_plerry(PLINT n, PLFLT *x, PLFLT *ymin, PLFLT *ymax); /* Advance to the next family file on the next new page */ +void c_plfamadv(); -void c_plfamadv(); - /* Pattern fills the polygon bounded by the input points. */ void c_plfill(PLINT n, PLFLT *x, PLFLT *y); @@ -1514,13 +1559,18 @@ void c_plsfont(PLINT family, PLINT style, PLINT weight); /* Shade region. */ +void c_plshade(PLFLT **a, PLINT nx, PLINT ny, PLINT function(PLFLT, PLFLT) defined, 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); -void c_plshade(PLFLT **a, PLINT nx, PLINT ny, PLINT function(PLFLT , PLFLT )defined, 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); +void c_plshades(PLFLT **a, PLINT nx, PLINT ny, PLINT function(PLFLT, PLFLT) defined, PLFLT xmin, + PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT *clevel, PLINT nlevel, PLINT fill_width, + PLINT cont_color, PLINT cont_width, void function(PLINT, PLFLT*, PLFLT*) fill, + PLBOOL rectangular, void function(PLFLT, PLFLT, PLFLT*, PLFLT *, PLPointer) pltr, + PLPointer pltr_data); -void c_plshade1(PLFLT *a, PLINT nx, PLINT ny, PLINT function(PLFLT , PLFLT )defined, 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); - -void c_plshades(PLFLT **a, PLINT nx, PLINT ny, PLINT function(PLFLT , PLFLT )defined, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT *clevel, PLINT nlevel, PLINT fill_width, PLINT cont_color, PLINT cont_width, void function(PLINT , PLFLT *, PLFLT *)fill, PLBOOL rectangular, void function(PLFLT , PLFLT , PLFLT *, PLFLT *, PLPointer )pltr, PLPointer pltr_data); - 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); /* Set up lengths of major tick marks. */ Modified: trunk/examples/d/CMakeLists.txt =================================================================== --- trunk/examples/d/CMakeLists.txt 2009-05-28 09:23:39 UTC (rev 10008) +++ trunk/examples/d/CMakeLists.txt 2009-05-29 07:29:50 UTC (rev 10009) @@ -33,6 +33,7 @@ "12" "13" "14" + "15" "17" "23" "24" Added: trunk/examples/d/x15d.d =================================================================== --- trunk/examples/d/x15d.d (rev 0) +++ trunk/examples/d/x15d.d 2009-05-29 07:29:50 UTC (rev 10009) @@ -0,0 +1,238 @@ +/* $Id: $ + + Shade plot demo. + + Maurice LeBrun + IFS, University of Texas at Austin + 31 Aug 1993 +*/ + +import std.math; +import std.stdio; +import std.string; + +import plplot; + + +/*--------------------------------------------------------------------------*\ + * main + * + * Does a variety of shade plots. +\*--------------------------------------------------------------------------*/ +int main(char[][] args) +{ + const int XPTS=35; /* Data points in x */ + const int YPTS=46; /* Data points in y */ + + /* Parse and process command line arguments */ + plparseopts(args, PL_PARSE_FULL); + + /* Set up color map 0 */ + // plscmap0n(3); + + // create plot object + plot myPlot = new plot; + + /* Set up color map 1 */ + myPlot.cmap1_init2(); + + /* Initialize plplot */ + plinit(); + + /* Set up data array */ + PLFLT xx, yy; + PLFLT[][] z = new PLFLT[][XPTS]; + for(int i=0; i<XPTS; i++) + z[i] = new PLFLT[YPTS]; + + for(int i=0; i<XPTS; i++) { + xx = cast(double)(i-(XPTS/2))/(XPTS/2); + for(int j=0; j<YPTS; j++) { + yy = cast(double)(j-(YPTS/2))/(YPTS/2)-1.0; + z[i][j] = xx*xx - yy*yy + (xx-yy)/(xx*xx+yy*yy+0.1); + } + } + + /* Plot using identity transform */ + myPlot.plot1(z); + myPlot.plot2(z); + myPlot.plot3(); + + plend(); + return 0; +} + + +class plot { + + /*--------------------------------------------------------------------------*\ + * cmap1_init1 + * + * Initializes color map 1 in HLS space. + \*--------------------------------------------------------------------------*/ + public void cmap1_init1() + { + PLFLT[] i = [ 0.0, 0.45, 0.55, 1.0 ]; // left boundary, just before center, + // just after center, right boundary + PLFLT[] h = [ 260.0, 260.0, 20.0, 20.0 ]; // hue -- low: blue-violet, only change as we go over vertex + // hue -- high: red, keep fixed + PLFLT[] l = [ 0.5, 0.0, 0.0, 0.5 ]; // lightness -- low, lightness -- center + // lightness -- center, lightness -- high + PLFLT[] s = [ 1.0, 1.0, 1.0, 1.0 ]; // maximum saturation + + plscmap1l(0, i, h, l, s); + } + + /*--------------------------------------------------------------------------*\ + * cmap1_init2 + * + * Initializes color map 1 in HLS space. + \*--------------------------------------------------------------------------*/ + public void cmap1_init2() + { + PLFLT[] i = [ 0.0, 0.45, 0.55, 1.0 ]; // left boundary, just before center, + // just after center, right boundary + PLFLT[] h = [ 260.0, 260.0, 20.0, 20.0 ]; // hue -- low: blue-violet, only change as we go over vertex + // hue -- high: red, keep fixed + PLFLT[] l = [ 0.6, 0.0, 0.0, 0.6 ]; // lightness -- low, lightness -- center + // lightness -- center, lightness -- high + PLFLT[] s = [ 1.0, 0.5, 0.5, 1.0 ]; // saturation -- low, saturation -- center + // saturation -- center, saturation -- high + + plscmap1l(0, i, h, l, s); + } + + /*--------------------------------------------------------------------------*\ + * plot1 + * + * Illustrates a single shaded region. + \*--------------------------------------------------------------------------*/ + public void plot1(PLFLT[][] z) + { + pladv(0); + plvpor(0.1, 0.9, 0.1, 0.9); + plwind(-1.0, 1.0, -1.0, 1.0); + + PLFLT zmin, zmax; + f2mnmx(z, zmin, zmax); + + PLFLT shade_min = zmin + (zmax-zmin)*0.4; + PLFLT shade_max = zmin + (zmax-zmin)*0.6; + PLFLT sh_color = 7; + PLINT sh_width = 2; + PLINT sh_cmap = 0; + PLINT min_color = 9; + PLINT max_color = 2; + PLINT min_width = 2; + PLINT max_width = 2; + + plpsty(8); + plshade(z, null,-1., 1., -1., 1., + shade_min, shade_max, + sh_cmap, sh_color, sh_width, + min_color, min_width, max_color, max_width, 1); + + plcol0(1); + plbox("bcnst", 0.0, 0, "bcnstv", 0.0, 0); + plcol0(2); + pllab("distance", "altitude", "Bogon flux"); + } + + /*--------------------------------------------------------------------------*\ + * plot2 + * + * Illustrates multiple adjacent shaded regions, using different fill + * patterns for each region. + \*--------------------------------------------------------------------------*/ + public void plot2(PLFLT[][] z) + { + static PLINT nlin[10] = [ 1, 1, 1, 1, 1, 2, 2, 2, 2, 2 ]; + static PLINT inc[10][2] = [ [450, 0], [-450, 0], [0, 0], [900, 0], [300, 0], + [450,-450], [0, 900], [0, 450], [450, -450], [0, 900] ]; + static PLINT del[10][2] = [ [2000, 2000], [2000, 2000], [2000, 2000], + [2000, 2000], [2000, 2000], [2000, 2000], + [2000, 2000], [2000, 2000], [4000, 4000], + [4000, 2000] ]; + + PLINT sh_cmap = 0, sh_width = 2; + PLINT min_color = 0, min_width = 0, max_color = 0, max_width = 0; + + pladv(0); + plvpor(0.1, 0.9, 0.1, 0.9); + plwind(-1.0, 1.0, -1.0, 1.0); + + PLFLT zmin, zmax; + f2mnmx(z, zmin, zmax); + + /* Plot using identity transform */ + for(int i=0; i<10; i++) { + PLFLT shade_min = zmin + (zmax-zmin)*i/10.0; + PLFLT shade_max = zmin + (zmax-zmin)*(i+1)/10.0; + PLFLT sh_color = i+6; + plpat(inc[i][0..nlin[i]], del[i][0..nlin[i]]); + + plshade(z, null, -1., 1., -1., 1., + shade_min, shade_max, + sh_cmap, sh_color, sh_width, + min_color, min_width, max_color, max_width, 1); + } + + plcol0(1); + plbox("bcnst", 0.0, 0, "bcnstv", 0.0, 0); + plcol0(2); + pllab("distance", "altitude", "Bogon flux"); + } + + /*--------------------------------------------------------------------------*\ + * plot3 + * + * Illustrates shaded regions in 3d, using a different fill pattern for + * each region. + \*--------------------------------------------------------------------------*/ + public void plot3() + { + static PLFLT xx[2][5] = [ [-1.0, 1.0, 1.0, -1.0, -1.0], + [-1.0, 1.0, 1.0, -1.0, -1.0] ]; + static PLFLT yy[2][5] = [ [1.0, 1.0, 0.0, 0.0, 1.0], + [-1.0, -1.0, 0.0, 0.0, -1.0] ]; + static PLFLT zz[2][5] = [ [0.0, 0.0, 1.0, 1.0, 0.0], + [0.0, 0.0, 1.0, 1.0, 0.0] ]; + + pladv(0); + plvpor(0.1, 0.9, 0.1, 0.9); + plwind(-1.0, 1.0, -1.0, 1.0); + plw3d(1., 1., 1., -1.0, 1.0, -1.0, 1.0, 0.0, 1.5, 30, -40); + + /* Plot using identity transform */ + plcol0(1); + plbox3("bntu", "X", 0.0, 0, "bntu", "Y", 0.0, 0, "bcdfntu", "Z", 0.5, 0); + plcol0(2); + pllab("","","3-d polygon filling"); + + plcol0(3); + plpsty(1); + plline3(xx[0], yy[0], zz[0]); + plfill3(xx[0][0..4], yy[0][0..4], zz[0][0..4]); + plpsty(2); + plline3(xx[1], yy[1], zz[1]); + plfill3(xx[1][0..4], yy[1][0..4], zz[1][0..4]); + } + + /*--------------------------------------------------------------------------*\ + * f2mnmx + * + * Returns min & max of input 2d array. + \*--------------------------------------------------------------------------*/ + public void f2mnmx(PLFLT[][] f, out PLFLT fmn, out PLFLT fmx) + { + fmx = f[0][0]; + fmn = fmx; + + for(int i=0; i<f.length; i++) { + for(int j=0; j<f[0].length; j++) { + fmx = fmax(fmx, f[i][j]); + fmn = fmin(fmn, f[i][j]); + } + } + } +} \ No newline at end of file Property changes on: trunk/examples/d/x15d.d ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/examples/d/x30d.d =================================================================== --- trunk/examples/d/x30d.d 2009-05-28 09:23:39 UTC (rev 10008) +++ trunk/examples/d/x30d.d 2009-05-29 07:29:50 UTC (rev 10009) @@ -29,24 +29,25 @@ import plplot; import std.string; -static PLINT[] red = [ 0, 255, 0, 0 ]; -static PLINT[] green = [ 0, 0, 255, 0 ]; -static PLINT[] blue = [ 0, 0, 0, 255 ]; -static PLFLT[] alpha = [ 1.0, 1.0, 1.0, 1.0 ]; -static PLFLT[] px = [ 0.1, 0.5, 0.5, 0.1 ]; -static PLFLT[] py = [ 0.1, 0.1, 0.5, 0.5 ]; -static PLFLT[] pos = [ 0.0, 1.0 ]; -static PLFLT[] rcoord = [ 1.0, 1.0 ]; -static PLFLT[] gcoord = [ 0.0, 0.0 ]; -static PLFLT[] bcoord = [ 0.0, 0.0 ]; -static PLFLT[] acoord = [ 0.0, 1.0 ]; -static PLBOOL[] rev = [ 0 ]; +int main(char[][] args) +{ + PLINT[] red = [ 0, 255, 0, 0 ]; + PLINT[] green = [ 0, 0, 255, 0 ]; + PLINT[] blue = [ 0, 0, 0, 255 ]; + PLFLT[] alpha = [ 1.0, 1.0, 1.0, 1.0 ]; + PLFLT[] px = [ 0.1, 0.5, 0.5, 0.1 ]; + PLFLT[] py = [ 0.1, 0.1, 0.5, 0.5 ]; -int main( char[][] args ) -{ + PLFLT[] pos = [ 0.0, 1.0 ]; + PLFLT[] rcoord = [ 1.0, 1.0 ]; + PLFLT[] gcoord = [ 0.0, 0.0 ]; + PLFLT[] bcoord = [ 0.0, 0.0 ]; + PLFLT[] acoord = [ 0.0, 1.0 ]; + PLBOOL[] rev = [ 0 ]; + /* Parse and process command line arguments */ plparseopts(args, PL_PARSE_FULL); @@ -140,24 +141,18 @@ /* Create a 2 x 2 array that contains the z values (0.0 to 1.0) that will */ /* used for the shade plot. plshades will use linear interpolation to */ /* calculate the z values of all the intermediate points in this array. */ - PLFLT[2][2] z; + PLFLT[][] z = [ [0.0, 1.0], [0.0, 1.0] ]; - z[0][0] = 0.0; - z[1][0] = 0.0; - z[0][1] = 1.0; - z[1][1] = 1.0; - /* Set the color levels array. These levels are also between 0.0 and 1.0 */ - PLFLT[101] clevel; + PLFLT[] clevel; + clevel.length=101; for(int i=0; i<clevel.length; i++) clevel[i] = 0.01*i; /* Draw the shade plot with zmin = 0.0, zmax = 1.0 and x and y coordinate ranges */ /* such that it fills the entire plotting area. */ - //plshades(cast(PLFLT**)z, 2, 2, null, 0.0, 1.0, 0.0, 1.0, cast(PLFLT*)clevel, - // 101, 0, -1, 2, plfill, 1, null, null); + plshades(z, null, 0.0, 1.0, 0.0, 1.0, clevel, 0, -1, 2, 1); plend(); return 0; } - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |