From: <hez...@us...> - 2011-03-20 23:08:19
|
Revision: 11663 http://plplot.svn.sourceforge.net/plplot/?rev=11663&view=rev Author: hezekiahcarty Date: 2011-03-20 23:08:13 +0000 (Sun, 20 Mar 2011) Log Message: ----------- Add rotate parameter to plarc (not currently implemented) This commit updates the plarc function definition and C example 3. An actual update to implement arc rotation support will come later, but this gets the plarc API change in now so that it does not require another ABI bump. Modified Paths: -------------- trunk/examples/c/x03c.c trunk/include/plplot.h trunk/src/plarc.c Modified: trunk/examples/c/x03c.c =================================================================== --- trunk/examples/c/x03c.c 2011-03-20 22:44:44 UTC (rev 11662) +++ trunk/examples/c/x03c.c 2011-03-20 23:08:13 UTC (rev 11663) @@ -45,7 +45,7 @@ // Draw circles for polar grid for ( i = 1; i <= 10; i++ ) { - plarc( 0.0, 0.0, 0.1 * i, 0.1 * i, 0.0, 360.0, 0 ); + plarc( 0.0, 0.0, 0.1 * i, 0.1 * i, 0.0, 360.0, 0.0, 0 ); } plcol0( 2 ); Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2011-03-20 22:44:44 UTC (rev 11662) +++ trunk/include/plplot.h 2011-03-20 23:08:13 UTC (rev 11663) @@ -853,7 +853,7 @@ PLDLLIMPEXP void c_plarc( PLFLT x, PLFLT y, PLFLT a, PLFLT b, PLFLT angle1, PLFLT angle2, - PLBOOL fill ); + PLFLT rotate, PLBOOL fill ); // This functions similarly to plbox() except that the origin of the axes // is placed at the user-specified point (x0, y0). Modified: trunk/src/plarc.c =================================================================== --- trunk/src/plarc.c 2011-03-20 22:44:44 UTC (rev 11662) +++ trunk/src/plarc.c 2011-03-20 23:08:13 UTC (rev 11663) @@ -34,7 +34,7 @@ // //-------------------------------------------------------------------------- void -plarc_approx( PLFLT x, PLFLT y, PLFLT a, PLFLT b, PLFLT angle1, PLFLT angle2, PLBOOL fill ) +plarc_approx( PLFLT x, PLFLT y, PLFLT a, PLFLT b, PLFLT angle1, PLFLT angle2, PLFLT rotate, PLBOOL fill ) { PLINT i; PLFLT theta0, theta_step, theta, d_angle; @@ -106,7 +106,7 @@ // //-------------------------------------------------------------------------- void -c_plarc( PLFLT x, PLFLT y, PLFLT a, PLFLT b, PLFLT angle1, PLFLT angle2, PLBOOL fill ) +c_plarc( PLFLT x, PLFLT y, PLFLT a, PLFLT b, PLFLT angle1, PLFLT angle2, PLFLT rotate, PLBOOL fill ) { PLINT xscl[2], yscl[2]; PLINT clpxmi, clpxma, clpymi, clpyma; @@ -138,7 +138,7 @@ } else { - plarc_approx( x, y, a, b, angle1, angle2, fill ); + plarc_approx( x, y, a, b, angle1, angle2, rotate, fill ); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hez...@us...> - 2011-03-20 23:08:59
|
Revision: 11664 http://plplot.svn.sourceforge.net/plplot/?rev=11664&view=rev Author: hezekiahcarty Date: 2011-03-20 23:08:53 +0000 (Sun, 20 Mar 2011) Log Message: ----------- Update OCaml bindings to support the new plarc rotation parameter Modified Paths: -------------- trunk/bindings/ocaml/plplot.ml trunk/bindings/ocaml/plplot.mli trunk/bindings/ocaml/plplot_h trunk/bindings/ocaml/plplot_h.inc trunk/examples/ocaml/x03.ml Modified: trunk/bindings/ocaml/plplot.ml =================================================================== --- trunk/bindings/ocaml/plplot.ml 2011-03-20 23:08:13 UTC (rev 11663) +++ trunk/bindings/ocaml/plplot.ml 2011-03-20 23:08:53 UTC (rev 11664) @@ -181,7 +181,8 @@ type plot_t = (* Standard plot elements *) - | Arc of (color_t * float * float * float * float * float * float * bool) + | Arc of + (color_t * float * float * float * float * float * float * float * bool) | Axes of (color_t * axis_options_t list * axis_options_t list * int * line_style_t * (plplot_axis_type -> float -> string) option) @@ -493,8 +494,8 @@ (** {3 Simplified plotting interface} *) (** [arc ?fill color x y a b angle1 angle2 rotation] *) - let arc ?(fill = false) color x y a b angle1 angle2 = - Arc (color, x, y, a, b, angle1, angle2, fill) + let arc ?(fill = false) color x y a b angle1 angle2 rotation = + Arc (color, x, y, a, b, angle1, angle2, rotation, fill) (** [axes ?color ?style ?width xopt yopt] *) let axes ?(color = Black) ?(style = Solid_line) ?(width = 1) ?labelfunc xopt yopt = @@ -504,7 +505,7 @@ let default_axes = axes default_axis_options default_axis_options (** [circle ?fill color x y r] - A special case of [arc]. *) - let circle ?fill color x y r = arc ?fill color x y r r 0.0 360.0 + let circle ?fill color x y r = arc ?fill color x y r r 0.0 360.0 0.0 (** Draw a colorbar, optionally log scaled and labeled. *) let image_colorbar ?custom_axis ?label ?log ?pos ?width data = @@ -950,9 +951,9 @@ set_color (Index_color old_color); () in - let plot_arc (color, x, y, a, b, angle1, angle2, fill) = + let plot_arc (color, x, y, a, b, angle1, angle2, rotate, fill) = set_color_in color ( - fun () -> plarc x y a b angle1 angle2 fill; + fun () -> plarc x y a b angle1 angle2 rotate fill; ) in let plot_axes (color, xopt, yopt, width, style, labelfunc) = Modified: trunk/bindings/ocaml/plplot.mli =================================================================== --- trunk/bindings/ocaml/plplot.mli 2011-03-20 23:08:13 UTC (rev 11663) +++ trunk/bindings/ocaml/plplot.mli 2011-03-20 23:08:53 UTC (rev 11664) @@ -262,10 +262,11 @@ (** {4 Plot elements} *) - (** [arc ?fill color x y a b angle0 angle1] *) + (** [arc ?fill color x y a b angle0 angle1 rotate] *) val arc : ?fill:bool -> - color_t -> float -> float -> float -> float -> float -> float -> plot_t + color_t -> float -> float -> float -> float -> float -> float -> float -> + plot_t (** [axes ?color ?style ?width xopt yopt] *) val axes : @@ -587,7 +588,7 @@ = "camlidl_plplot_core_c_pl_setcontlabelparam" external pladv : int -> unit = "camlidl_plplot_core_c_pladv" external plarc : - float -> float -> float -> float -> float -> float -> bool -> unit + float -> float -> float -> float -> float -> float -> float -> bool -> unit = "camlidl_plplot_core_c_plarc_bytecode" "camlidl_plplot_core_c_plarc" external plaxes : float -> float -> string -> float -> int -> string -> float -> int -> unit Modified: trunk/bindings/ocaml/plplot_h =================================================================== --- trunk/bindings/ocaml/plplot_h 2011-03-20 23:08:13 UTC (rev 11663) +++ trunk/bindings/ocaml/plplot_h 2011-03-20 23:08:53 UTC (rev 11664) @@ -20,7 +20,7 @@ void c_plarc(PLFLT x, PLFLT y, PLFLT a, PLFLT b, PLFLT angle1, PLFLT angle2, - PLBOOL fill); + PLFLT rotate, PLBOOL fill); void c_plaxes(PLFLT x0, PLFLT y0, const char *xopt, PLFLT xtick, PLINT nxsub, Modified: trunk/bindings/ocaml/plplot_h.inc =================================================================== --- trunk/bindings/ocaml/plplot_h.inc 2011-03-20 23:08:13 UTC (rev 11663) +++ trunk/bindings/ocaml/plplot_h.inc 2011-03-20 23:08:53 UTC (rev 11664) @@ -1,7 +1,7 @@ [mlname(pl_setcontlabelformat)] void c_pl_setcontlabelformat ( int lexp, int sigdig ); [mlname(pl_setcontlabelparam)] void c_pl_setcontlabelparam ( double offset, double size, double spacing, int active ); [mlname(pladv)] void c_pladv ( int page ); -[mlname(plarc)] void c_plarc ( double x, double y, double a, double b, double angle1, double angle2, boolean fill ); +[mlname(plarc)] void c_plarc ( double x, double y, double a, double b, double angle1, double angle2, double rotate, boolean fill ); [mlname(plaxes)] void c_plaxes ( double x0, double y0, [string] const char * xopt, double xtick, int nxsub, [string] const char * yopt, double ytick, int nysub ); [mlname(plbin)] void c_plbin ( int nbin, [in, size_is(nbin)] double * x, [in, size_is(nbin)] double * y, plplot_bin_style opt ); [mlname(plbtime)] void c_plbtime ( [out] int * year, [out] int * month, [out] int * day, [out] int * hour, [out] int * min, [out] double * sec, double ctime ); Modified: trunk/examples/ocaml/x03.ml =================================================================== --- trunk/examples/ocaml/x03.ml 2011-03-20 23:08:13 UTC (rev 11663) +++ trunk/examples/ocaml/x03.ml 2011-03-20 23:08:53 UTC (rev 11664) @@ -50,7 +50,7 @@ for i = 1 to 10 do (* Draw circles for polar grid *) let r = 0.1 *. float_of_int i in - plarc 0.0 0.0 r r 0.0 360.0 false; + plarc 0.0 0.0 r r 0.0 360.0 0.0 false; done; plcol0 2; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hez...@us...> - 2011-03-20 23:09:40
|
Revision: 11665 http://plplot.svn.sourceforge.net/plplot/?rev=11665&view=rev Author: hezekiahcarty Date: 2011-03-20 23:09:33 +0000 (Sun, 20 Mar 2011) Log Message: ----------- Propagate the plarc rotation change to all other language bindings/examples This provides clean build results and unchanged "make test_diff_psc" on my system. Modified Paths: -------------- trunk/bindings/ada/plplot.adb trunk/bindings/ada/plplot.ads trunk/bindings/ada/plplot_thin.ads trunk/bindings/ada/plplot_traditional.adb trunk/bindings/ada/plplot_traditional.ads trunk/bindings/c++/plstream.cc trunk/bindings/c++/plstream.h trunk/bindings/d/plplot.d trunk/bindings/f77/scstubs.c trunk/bindings/f95/scstubs.c trunk/bindings/java/PLStream.java trunk/bindings/octave/plplot_octave.h.in trunk/bindings/swig-support/plplotcapi.i trunk/bindings/swig-support/swig_documentation.i trunk/bindings/tcl/plapi.tpl trunk/examples/ada/x03a.adb trunk/examples/c++/x03.cc trunk/examples/d/x03d.d trunk/examples/f77/x03f.fm4 trunk/examples/f95/x03f.f90 trunk/examples/octave/x03c.m trunk/examples/python/xw03.py trunk/examples/tcl/x03.tcl Modified: trunk/bindings/ada/plplot.adb =================================================================== --- trunk/bindings/ada/plplot.adb 2011-03-20 23:08:53 UTC (rev 11664) +++ trunk/bindings/ada/plplot.adb 2011-03-20 23:09:33 UTC (rev 11665) @@ -1086,7 +1086,7 @@ -- Plot an arc. -- plarc procedure Draw_Arc - (x, y, a, b, angle1, angle2 : Long_Float; + (x, y, a, b, angle1, angle2, rotate : Long_Float; fill : Boolean) is fill_arc : PLBOOL; @@ -1097,7 +1097,7 @@ else fill_arc := PLfalse; end if; - plarc(x, y, a, b, angle1, angle2, fill_arc); + plarc(x, y, a, b, angle1, angle2, rotate, fill_arc); end Draw_Arc; Modified: trunk/bindings/ada/plplot.ads =================================================================== --- trunk/bindings/ada/plplot.ads 2011-03-20 23:08:53 UTC (rev 11664) +++ trunk/bindings/ada/plplot.ads 2011-03-20 23:09:33 UTC (rev 11665) @@ -738,7 +738,7 @@ -- Plot an arc. -- plarc procedure Draw_Arc - (x, y, a, b, angle1, angle2 : Long_Float; + (x, y, a, b, angle1, angle2, rotate : Long_Float; fill : Boolean); Modified: trunk/bindings/ada/plplot_thin.ads =================================================================== --- trunk/bindings/ada/plplot_thin.ads 2011-03-20 23:08:53 UTC (rev 11664) +++ trunk/bindings/ada/plplot_thin.ads 2011-03-20 23:09:33 UTC (rev 11665) @@ -512,7 +512,7 @@ -- Plot an arc. procedure - plarc(x : PLFLT; y : PLFLT; a : PLFLT; b : PLFLT; angle1 : PLFLT; angle2 : PLFLT; fill : PLBOOL); + plarc(x : PLFLT; y : PLFLT; a : PLFLT; b : PLFLT; angle1 : PLFLT; angle2 : PLFLT; rotate : PLFLT; fill : PLBOOL); pragma Import(C, plarc, "c_plarc"); Modified: trunk/bindings/ada/plplot_traditional.adb =================================================================== --- trunk/bindings/ada/plplot_traditional.adb 2011-03-20 23:08:53 UTC (rev 11664) +++ trunk/bindings/ada/plplot_traditional.adb 2011-03-20 23:09:33 UTC (rev 11665) @@ -1083,7 +1083,7 @@ -- Plot an arc. procedure plarc - (x, y, a, b, angle1, angle2 : Long_Float; + (x, y, a, b, angle1, angle2, rotate : Long_Float; fill : Boolean) is fill_arc : PLBOOL; @@ -1094,7 +1094,7 @@ else fill_arc := PLfalse; end if; - PLplot_Thin.plarc(x, y, a, b, angle1, angle2, fill_arc); + PLplot_Thin.plarc(x, y, a, b, angle1, angle2, rotate, fill_arc); end plarc; @@ -3312,4 +3312,4 @@ -- the 16 default colors of color map 0. Make_Snapshot_Of_Color_Map_0(Default_Red_Components, Default_Green_Components, Default_Blue_Components); -end PLplot_Traditional; \ No newline at end of file +end PLplot_Traditional; Modified: trunk/bindings/ada/plplot_traditional.ads =================================================================== --- trunk/bindings/ada/plplot_traditional.ads 2011-03-20 23:08:53 UTC (rev 11664) +++ trunk/bindings/ada/plplot_traditional.ads 2011-03-20 23:09:33 UTC (rev 11665) @@ -732,7 +732,7 @@ -- Plot an arc. procedure plarc - (x, y, a, b, angle1, angle2 : Long_Float; + (x, y, a, b, angle1, angle2, rotate : Long_Float; fill : Boolean); Modified: trunk/bindings/c++/plstream.cc =================================================================== --- trunk/bindings/c++/plstream.cc 2011-03-20 23:08:53 UTC (rev 11664) +++ trunk/bindings/c++/plstream.cc 2011-03-20 23:09:33 UTC (rev 11665) @@ -321,11 +321,11 @@ void plstream::arc( PLFLT x, PLFLT y, PLFLT a, PLFLT b, PLFLT angle1, PLFLT angle2, - PLBOOL fill ) + PLFLT rotate, PLBOOL fill ) { set_stream(); - plarc( x, y, a, b, angle1, angle2, fill ); + plarc( x, y, a, b, angle1, angle2, rotate, fill ); } #ifdef PL_DEPRECATED Modified: trunk/bindings/c++/plstream.h =================================================================== --- trunk/bindings/c++/plstream.h 2011-03-20 23:08:53 UTC (rev 11664) +++ trunk/bindings/c++/plstream.h 2011-03-20 23:09:33 UTC (rev 11665) @@ -122,7 +122,7 @@ // Plot an arc void arc( PLFLT x, PLFLT y, PLFLT a, PLFLT b, PLFLT angle1, PLFLT angle2, - PLBOOL fill ); + PLFLT rotate, PLBOOL fill ); // Simple arrow plotter #ifdef PL_DEPRECATED Modified: trunk/bindings/d/plplot.d =================================================================== --- trunk/bindings/d/plplot.d 2011-03-20 23:08:53 UTC (rev 11664) +++ trunk/bindings/d/plplot.d 2011-03-20 23:09:33 UTC (rev 11665) @@ -1494,7 +1494,7 @@ /* Plot an arc */ void c_plarc( PLFLT x, PLFLT y, PLFLT a, PLFLT b, PLFLT angle1, PLFLT angle2, - PLBOOL fill ); + PLFLT rotate, PLBOOL fill ); /* Clear current subpage. */ void c_plclear(); Modified: trunk/bindings/f77/scstubs.c =================================================================== --- trunk/bindings/f77/scstubs.c 2011-03-20 23:08:53 UTC (rev 11664) +++ trunk/bindings/f77/scstubs.c 2011-03-20 23:09:33 UTC (rev 11665) @@ -90,9 +90,9 @@ } void -PLARC( PLFLT *x, PLFLT *y, PLFLT *a, PLFLT *b, PLFLT *angle1, PLFLT *angle2, PLBOOL *fill ) +PLARC( PLFLT *x, PLFLT *y, PLFLT *a, PLFLT *b, PLFLT *angle1, PLFLT *angle2, PLFLT *rotate, PLBOOL *fill ) { - c_plarc( *x, *y, *a, *b, *angle1, *angle2, *fill ); + c_plarc( *x, *y, *a, *b, *angle1, *angle2, *rotate, *fill ); } void Modified: trunk/bindings/f95/scstubs.c =================================================================== --- trunk/bindings/f95/scstubs.c 2011-03-20 23:08:53 UTC (rev 11664) +++ trunk/bindings/f95/scstubs.c 2011-03-20 23:09:33 UTC (rev 11665) @@ -91,9 +91,9 @@ } void -PLARC( PLFLT *x, PLFLT *y, PLFLT *a, PLFLT *b, PLFLT *angle1, PLFLT *angle2, PLBOOL *fill ) +PLARC( PLFLT *x, PLFLT *y, PLFLT *a, PLFLT *b, PLFLT *angle1, PLFLT *angle2, PLFLT *rotate, PLBOOL *fill ) { - c_plarc( *x, *y, *a, *b, *angle1, *angle2, *fill ); + c_plarc( *x, *y, *a, *b, *angle1, *angle2, *rotate, *fill ); } void Modified: trunk/bindings/java/PLStream.java =================================================================== --- trunk/bindings/java/PLStream.java 2011-03-20 23:08:53 UTC (rev 11664) +++ trunk/bindings/java/PLStream.java 2011-03-20 23:09:33 UTC (rev 11665) @@ -131,10 +131,10 @@ plplotjavac.pladv( page ); } - public void arc( double x, double y, double a, double b, double angle1, double angle2, boolean fill ) + public void arc( double x, double y, double a, double b, double angle1, double angle2, double rotate, boolean fill ) { if ( set_stream() == -1 ) return; - plplotjavac.plarc( x, y, a, b, angle1, angle2, fill ); + plplotjavac.plarc( x, y, a, b, angle1, angle2, rotate, fill ); } public void axes( double x0, double y0, String xopt, double xtick, int nxsub, Modified: trunk/bindings/octave/plplot_octave.h.in =================================================================== --- trunk/bindings/octave/plplot_octave.h.in 2011-03-20 23:08:53 UTC (rev 11664) +++ trunk/bindings/octave/plplot_octave.h.in 2011-03-20 23:09:33 UTC (rev 11665) @@ -630,7 +630,7 @@ // Plot an arc void c_plarc( PLFLT x, PLFLT y, PLFLT a, PLFLT b, PLFLT angle1, PLFLT angle2, - PLBOOL fill ); //%name plarc + PLFLT rotate, PLBOOL fill ); //%name plarc // This functions similarly to plbox() except that the origin of the axes // is placed at the user-specified point (x0, y0). Modified: trunk/bindings/swig-support/plplotcapi.i =================================================================== --- trunk/bindings/swig-support/plplotcapi.i 2011-03-20 23:08:53 UTC (rev 11664) +++ trunk/bindings/swig-support/plplotcapi.i 2011-03-20 23:09:33 UTC (rev 11665) @@ -264,7 +264,7 @@ void plarc( PLFLT x, PLFLT y, PLFLT a, PLFLT b, PLFLT angle1, PLFLT angle2, - PLBOOL fill ); + PLFLT rotate, PLBOOL fill ); void plaxes( PLFLT x0, PLFLT y0, const char *xopt, PLFLT xtick, PLINT nxsub, Modified: trunk/bindings/swig-support/swig_documentation.i =================================================================== --- trunk/bindings/swig-support/swig_documentation.i 2011-03-20 23:08:53 UTC (rev 11664) +++ trunk/bindings/swig-support/swig_documentation.i 2011-03-20 23:09:33 UTC (rev 11665) @@ -101,7 +101,7 @@ Draw a possible filled arc centered at x, y with semimajor axis a and semiminor axis b, starting at angle1 and ending at angle2. - Redacted form: General: plarc(x, y, a, b, angle1, angle2, fill) + Redacted form: General: plarc(x, y, a, b, angle1, angle2, rotate, fill) This function is used in example 3. @@ -110,7 +110,7 @@ SYNOPSIS: -plarc(x, y, a, b, angle1, angle2, fill) +plarc(x, y, a, b, angle1, angle2, rotate, fill) ARGUMENTS: @@ -126,6 +126,8 @@ angle2 (PLFLT, input) : Ending angle of the arc. + rotate (PLFLT, input) : Rotation of arc + fill (PLBOOL, input) : Draw a filled arc. ") plarc; Modified: trunk/bindings/tcl/plapi.tpl =================================================================== --- trunk/bindings/tcl/plapi.tpl 2011-03-20 23:08:53 UTC (rev 11664) +++ trunk/bindings/tcl/plapi.tpl 2011-03-20 23:09:33 UTC (rev 11665) @@ -45,6 +45,7 @@ b PLFLT angle1 PLFLT angle2 PLFLT +rotate PLFLT fill PLINT # This functions similarly to plbox() except that the origin of the axes Modified: trunk/examples/ada/x03a.adb =================================================================== --- trunk/examples/ada/x03a.adb 2011-03-20 23:08:53 UTC (rev 11664) +++ trunk/examples/ada/x03a.adb 2011-03-20 23:09:33 UTC (rev 11665) @@ -65,7 +65,7 @@ -- Draw circles for polar grid. for i in 1 .. 10 loop - plarc(0.0, 0.0, 0.1 * Long_Float(i), 0.1 * Long_Float(i), 0.0, 360.0, False); + plarc(0.0, 0.0, 0.1 * Long_Float(i), 0.1 * Long_Float(i), 0.0, 360.0, 0.0, False); end loop; plcol0(2); Modified: trunk/examples/c++/x03.cc =================================================================== --- trunk/examples/c++/x03.cc 2011-03-20 23:08:53 UTC (rev 11664) +++ trunk/examples/c++/x03.cc 2011-03-20 23:09:33 UTC (rev 11665) @@ -81,7 +81,7 @@ // Draw circles for polar grid for ( i = 1; i <= 10; i++ ) { - pls->arc( 0.0, 0.0, 0.1 * i, 0.1 * i, 0.0, 360.0, 0 ); + pls->arc( 0.0, 0.0, 0.1 * i, 0.1 * i, 0.0, 360.0, 0.0, 0 ); } pls->col0( 2 ); Modified: trunk/examples/d/x03d.d =================================================================== --- trunk/examples/d/x03d.d 2011-03-20 23:08:53 UTC (rev 11664) +++ trunk/examples/d/x03d.d 2011-03-20 23:09:33 UTC (rev 11665) @@ -39,7 +39,7 @@ /* Draw circles for polar grid */ for ( size_t i = 1; i < 11; i++ ) - plarc( 0.0, 0.0, 0.1 * i, 0.1 * i, 0.0, 360.0, 0 ); + plarc( 0.0, 0.0, 0.1 * i, 0.1 * i, 0.0, 360.0, 0.0, 0 ); plcol0( 2 ); for ( size_t i = 0; i <= 11; i++ ) Modified: trunk/examples/f77/x03f.fm4 =================================================================== --- trunk/examples/f77/x03f.fm4 2011-03-20 23:08:53 UTC (rev 11664) +++ trunk/examples/f77/x03f.fm4 2011-03-20 23:09:33 UTC (rev 11665) @@ -49,7 +49,8 @@ c Draw circles for polar grid do i = 1,10 - call plarc(0.0d0, 0.0d0, 0.1d0*i, 0.1d0*i, 0.0d0, 360.0d0, 0) + call plarc(0.0d0, 0.0d0, 0.1d0*i, 0.1d0*i, + & 0.0d0, 360.0d0, 0.0d0, 0) enddo call plcol0(2) Modified: trunk/examples/f95/x03f.f90 =================================================================== --- trunk/examples/f95/x03f.f90 2011-03-20 23:08:53 UTC (rev 11664) +++ trunk/examples/f95/x03f.f90 2011-03-20 23:09:33 UTC (rev 11665) @@ -49,7 +49,7 @@ ! Draw circles for polar grid do i = 1,10 call plarc(0.0_plflt, 0.0_plflt, 0.1_plflt*i, 0.1_plflt*i, & - 0.0_plflt, 360.0_plflt, 0) + 0.0_plflt, 360.0_plflt, 0.0_plflt, 0) enddo call plcol0(2) do i = 0,11 Modified: trunk/examples/octave/x03c.m =================================================================== --- trunk/examples/octave/x03c.m 2011-03-20 23:08:53 UTC (rev 11664) +++ trunk/examples/octave/x03c.m 2011-03-20 23:09:33 UTC (rev 11665) @@ -40,7 +40,7 @@ plenv(-1.3, 1.3, -1.3, 1.3, 1, -2); ## Draw circles for polar grid for i=1:10 - plarc(0.0, 0.0, 0.1 * i, 0.1 * i, 0.0, 360.0, 0); + plarc(0.0, 0.0, 0.1 * i, 0.1 * i, 0.0, 360.0, 0.0, 0); endfor Modified: trunk/examples/python/xw03.py =================================================================== --- trunk/examples/python/xw03.py 2011-03-20 23:08:53 UTC (rev 11664) +++ trunk/examples/python/xw03.py 2011-03-20 23:09:33 UTC (rev 11665) @@ -39,7 +39,7 @@ # Draw circles for polar grid for i in range(10): - plarc(0.0, 0.0, 0.1*(i+1), 0.1*(i+1), 0.0, 360.0, 0) + plarc(0.0, 0.0, 0.1*(i+1), 0.1*(i+1), 0.0, 360.0, 0.0, 0) plcol0(2) for i in range(12): Modified: trunk/examples/tcl/x03.tcl =================================================================== --- trunk/examples/tcl/x03.tcl 2011-03-20 23:08:53 UTC (rev 11664) +++ trunk/examples/tcl/x03.tcl 2011-03-20 23:09:33 UTC (rev 11665) @@ -21,7 +21,7 @@ matrix yj f $nj1 for {set i 1} {$i <= $ni} {incr i} { - $w cmd plarc 0.0 0.0 [expr {0.1 * $i}]] [expr {0.1 * $i}] 0.0 360.0 0 + $w cmd plarc 0.0 0.0 [expr {0.1 * $i}]] [expr {0.1 * $i}] 0.0 360.0 0.0 0 } # Draw radial spokes for polar grid and write labels for angle This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-03-21 03:35:14
|
Revision: 11667 http://plplot.svn.sourceforge.net/plplot/?rev=11667&view=rev Author: airwin Date: 2011-03-21 03:35:08 +0000 (Mon, 21 Mar 2011) Log Message: ----------- Implement pllegend for Lua and use it in fourth example (whose results now agree with the corresponding C results). Next pllegend steps for Lua: example 26 update and implement example 33. Modified Paths: -------------- trunk/bindings/lua/plplotluac.i trunk/examples/lua/x04.lua Modified: trunk/bindings/lua/plplotluac.i =================================================================== --- trunk/bindings/lua/plplotluac.i 2011-03-21 00:50:17 UTC (rev 11666) +++ trunk/bindings/lua/plplotluac.i 2011-03-21 03:35:08 UTC (rev 11667) @@ -968,7 +968,35 @@ if($1) {free($1); $1=NULL;} } +// No count but check consistency with previous +%typemap(in, checkfn="lua_istable") const char **ArrayCk { + int i; + $1=NULL; + + if(SWIG_table_size(L, $input) != Alen) { + lua_pushfstring(L, "Tables must be of same length."); + SWIG_fail; + } + $1 = malloc(sizeof(char*)*Alen); + for(i = 1; i <= Alen; i++) { + lua_rawgeti(L, $input, i); + if(lua_isstring(L, -1)) { + $1[i-1] = (char*)lua_tostring(L, -1); + } else { + lua_pop(L,1); + lua_pushfstring(L, "Requires a sequence of strings."); + SWIG_fail; + /* $1 array is freed after 'fail:' */ + } + lua_pop(L,1); + } +} +%typemap(freearg) const char **ArrayCk { + if($1) {free($1); $1=NULL;} +} + + /* Process options list using current options info. */ %typemap(in, checkfn="lua_istable") (int *p_argc, const char **argv) { int i, n; @@ -1079,6 +1107,7 @@ %rename(init) plinit; %rename(join) pljoin; %rename(lab) pllab; +%rename(legend) pllegend; %rename(lightsource) pllightsource; %rename(line) plline; %rename(line3) plline3; @@ -1180,9 +1209,6 @@ %rename(abort) plabort; %rename(MinMax2dGrid) plMinMax2dGrid; -// Not implemented yet. -%ignore pllegend; - /* swig compatible PLplot API definitions from here on. */ %include plplotcapi.i Modified: trunk/examples/lua/x04.lua =================================================================== --- trunk/examples/lua/x04.lua 2011-03-21 00:50:17 UTC (rev 11666) +++ trunk/examples/lua/x04.lua 2011-03-21 03:35:08 UTC (rev 11667) @@ -31,6 +31,19 @@ -- Log-linear plot. ---------------------------------------------------------------------------- +-- return single bit (for OR) +function bit(x,b) + return (math.mod(x, 2^b) - math.mod(x,2^(b-1)) > 0) +end + +-- logic OR for number values + +function lor(x,y) + result = 0 + for p=1,8 do result = result + (((bit(x,p) or bit(y,p)) == true) and 2^(p-1) or 0) end + return result +end + function plot1(type) freql = {} ampl = {} @@ -54,16 +67,16 @@ pl.col0(1) if type == 0 then pl.box("bclnst", 0, 0, "bnstv", 0, 0) - end - - if type == 1 then + elseif type == 1 then pl.box("bcfghlnst", 0, 0, "bcghnstv", 0, 0) + else + print("error: type must be either 0 or 1") end -- Plot ampl vs freq pl.col0(2) pl.line(freql, ampl) - pl.col0(1) + pl.col0(2) pl.ptex(1.6, -30, 1, -20, 0.5, "-20 dB/decade") -- Put labels on @@ -83,10 +96,75 @@ pl.string(freql, phase, "*") pl.col0(3) pl.mtex("r", 5, 0.5, 0.5, "Phase shift (degrees)") + nlegend = 2 + else + nlegend = 1 end + + -- Draw a legend. + opt_array = {} + text_colors = {} + text = {} + box_colors = {} + box_patterns = {} + box_scales = {} + box_line_widths = {} + line_colors = {} + line_styles = {} + line_widths = {} + symbol_colors = {} + symbol_scales = {} + symbol_numbers = {} + symbols = {} + + -- Data for the first legend entry. + opt_array[1] = pl.PL_LEGEND_LINE + text_colors[1] = 2 + text[1] = "Amplitude" + -- box data unused so initialize to arbitrary values. + box_colors[1] = 0 + box_patterns[1] = 0 + box_scales[1] = 0 + box_line_widths[1] = 0 + line_colors[1] = 2 + line_styles[1] = 1 + line_widths[1] = 1 + -- unused arbitrary data + symbol_colors[1] = 0 + symbol_scales[1] = 0 + symbol_numbers[1] = 0 + symbols[1] = "" + + -- Data for the second legend entry. + if nlegend > 1 then + opt_array[2] = lor(pl.PL_LEGEND_LINE, pl.PL_LEGEND_SYMBOL) + text_colors[2] = 3 + text[2] = "Phase shift" + -- box data unused so initialize to arbitrary values. + box_colors[2] = 0 + box_patterns[2] = 0 + box_scales[2] = 0 + box_line_widths[2] = 0 + line_colors[2] = 3 + line_styles[2] = 1 + line_widths[2] = 1 + symbol_colors[2] = 3 + symbol_scales[2] = 1. + symbol_numbers[2] = 4 + symbols[2] = "*" + end + + pl.scol0a( 15, 32, 32, 32, 0.70 ) + + legend_width, legend_height = pl.legend( + 0, lor(pl.PL_LEGEND_BACKGROUND, pl.PL_LEGEND_BOUNDING_BOX), 0.0, 0.0, + 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, 1.0, 2.0, + 1., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ) end - ---------------------------------------------------------------------------- -- main -- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-03-21 08:59:15
|
Revision: 11669 http://plplot.svn.sourceforge.net/plplot/?rev=11669&view=rev Author: airwin Date: 2011-03-21 08:59:09 +0000 (Mon, 21 Mar 2011) Log Message: ----------- Implement working first page of Lua example 33 as a template for the remaining pllegend pages of that example. Modified Paths: -------------- trunk/examples/lua/CMakeLists.txt trunk/plplot_test/test_lua.sh.in Added Paths: ----------- trunk/examples/lua/x33.lua Modified: trunk/examples/lua/CMakeLists.txt =================================================================== --- trunk/examples/lua/CMakeLists.txt 2011-03-21 06:27:10 UTC (rev 11668) +++ trunk/examples/lua/CMakeLists.txt 2011-03-21 08:59:09 UTC (rev 11669) @@ -56,6 +56,7 @@ "29" "30" "31" + "33" ) set(lua_SCRIPTS) Added: trunk/examples/lua/x33.lua =================================================================== --- trunk/examples/lua/x33.lua (rev 0) +++ trunk/examples/lua/x33.lua 2011-03-21 08:59:09 UTC (rev 11669) @@ -0,0 +1,159 @@ +--[[ $Id: x04.lua 11667 2011-03-21 03:35:08Z airwin $ + + Demonstrate most pllegend capability including unicode symbols. + + Copyright (C) 2010 Alan W. Irwin + + This file is part of PLplot. + + PLplot is free software you can redistribute it and/or modify + it under the terms of the GNU General Library Public License as published + by the Free Software Foundation either version 2 of the License, or + (at your option) any later version. + + PLplot is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with PLplot if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--]] + +-- initialise Lua bindings for PLplot examples. +dofile("plplot_examples.lua") + +---------------------------------------------------------------------------- +-- plot1 +-- +-- Log-linear plot. +---------------------------------------------------------------------------- + +-- return single bit (for OR) +function bit(x,b) + return (math.mod(x, 2^b) - math.mod(x,2^(b-1)) > 0) +end + +-- logic OR for number values + +function lor(x,y) + result = 0 + for p=1,8 do result = result + (((bit(x,p) or bit(y,p)) == true) and 2^(p-1) or 0) end + return result +end + +-- Intialize pllegend arrays taking advantage of Lua's default global scope. + +function initialize_pllegend_arrays(nlegend) + opt_array = {} + text_colors = {} + text = {} + box_colors = {} + box_patterns = {} + box_scales = {} + box_line_widths = {} + line_colors = {} + line_styles = {} + line_widths = {} + symbol_colors = {} + symbol_scales = {} + symbol_numbers = {} + symbols = {} + for i=1,nlegend do + opt_array[i] = 0 + text_colors[i] = 0 + text[i] = "" + box_colors[i] = 0 + box_patterns[i] = 0 + box_scales[i] = 0.0 + box_line_widths[i] = 0 + line_colors[i] = 0 + line_styles[i] = 0 + line_widths[i] = 0 + symbol_colors[i] = 0 + symbol_scales[i] = 0.0 + symbol_numbers[i] = 0 + symbols[i] = "" + end +end + +---------------------------------------------------------------------------- +-- main +---------------------------------------------------------------------------- + +position_options = { +lor(pl.PL_POSITION_LEFT, lor(pl.PL_POSITION_TOP , pl.PL_POSITION_OUTSIDE)), +lor(pl.PL_POSITION_TOP, pl.PL_POSITION_OUTSIDE), +lor(pl.PL_POSITION_RIGHT, lor(pl.PL_POSITION_TOP, pl.PL_POSITION_OUTSIDE)), +lor(pl.PL_POSITION_RIGHT, pl.PL_POSITION_OUTSIDE), +lor(pl.PL_POSITION_RIGHT, lor(pl.PL_POSITION_BOTTOM, pl.PL_POSITION_OUTSIDE)), +lor(pl.PL_POSITION_BOTTOM, pl.PL_POSITION_OUTSIDE), +lor(pl.PL_POSITION_LEFT, lor(pl.PL_POSITION_BOTTOM, pl.PL_POSITION_OUTSIDE)), +lor(pl.PL_POSITION_LEFT, pl.PL_POSITION_OUTSIDE), +lor(pl.PL_POSITION_LEFT, lor(pl.PL_POSITION_TOP, pl.PL_POSITION_INSIDE)), +lor(pl.PL_POSITION_TOP, pl.PL_POSITION_INSIDE), +lor(pl.PL_POSITION_RIGHT, lor(pl.PL_POSITION_TOP, pl.PL_POSITION_INSIDE)), +lor(pl.PL_POSITION_RIGHT, pl.PL_POSITION_INSIDE), +lor(pl.PL_POSITION_RIGHT, lor(pl.PL_POSITION_BOTTOM, pl.PL_POSITION_INSIDE)), +lor(pl.PL_POSITION_BOTTOM, pl.PL_POSITION_INSIDE), +lor(pl.PL_POSITION_LEFT, lor(pl.PL_POSITION_BOTTOM, pl.PL_POSITION_INSIDE)), +lor(pl.PL_POSITION_LEFT, pl.PL_POSITION_INSIDE) +} + +-- Pick 5 arbitrary UTF-8 symbols useful for plotting points (✠✚✱✪✽✺✰✴✦). +special_symbols = { +"✰", +"✴", +"✱", +"✽", +"✦" +} + +-- Parse and process command line arguments +pl.parseopts(arg, pl.PL_PARSE_FULL) + +-- Initialize plplot +pl.init() + +-- First page illustrating the 16 standard positions. +pl.adv(0) +pl.vpor(0.25, 0.75, 0.25, 0.75) +pl.wind(0.0, 1.0, 0.0, 1.0) +pl.box("bc", 0.0, 0, "bc", 0.0, 0) +pl.sfont(pl.PL_FCI_SANS, -1, -1) +pl.mtex("t", 8.0, 0.5, 0.5, "The 16 standard legend positions with") +pl.mtex("t", 6.0, 0.5, 0.5, "the same (0.05) offset in x and y") + +nlegend = 1 +initialize_pllegend_arrays(nlegend) +-- Only specify legend data that are required according to the +-- value of opt_array for that entry. +opt_base = lor(pl.PL_LEGEND_BACKGROUND, pl.PL_LEGEND_BOUNDING_BOX) +opt_array[1] = lor(pl.PL_LEGEND_LINE, pl.PL_LEGEND_SYMBOL) +line_styles[1] = 1 +line_widths[1] = 1 +symbol_scales[1] = 1. +symbol_numbers[1] = 4 +symbols[1] = "*" +-- Use monotype fonts so that all legends are the same size. +pl.sfont(pl.PL_FCI_MONO, -1, -1) +pl.scol0a( 15, 32, 32, 32, 0.70 ) + +for k=0,15 do + position = position_options[k+1] + opt = opt_base + text[1] = string.format("%2.2d", k) + text_colors[1] = 1 + (k % 8) + line_colors[1] = 1 + (k % 8) + symbol_colors[1] = 1 + (k % 8) + legend_width, legend_height = pl.legend( + position, opt, 0.05, 0.05, + 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, 1.0, 2.0, + 1., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ) +end + +pl.plend() Property changes on: trunk/examples/lua/x33.lua ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/plplot_test/test_lua.sh.in =================================================================== --- trunk/plplot_test/test_lua.sh.in 2011-03-21 06:27:10 UTC (rev 11668) +++ trunk/plplot_test/test_lua.sh.in 2011-03-21 08:59:09 UTC (rev 11669) @@ -32,7 +32,7 @@ results="$(pwd |sed 's?^/\(.\)/?\1:/?')" export results cd "$luadir" -for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31; do +for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33; do if [ "$verbose_test" ] ; then echo "x${index}" fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-03-22 21:58:54
|
Revision: 11675 http://plplot.svn.sourceforge.net/plplot/?rev=11675&view=rev Author: airwin Date: 2011-03-22 21:58:47 +0000 (Tue, 22 Mar 2011) Log Message: ----------- Implement D example 33 that gives results consistent with the corresponding C example results. This removes the last PostScript difference between D and C results. Modified Paths: -------------- trunk/examples/d/CMakeLists.txt trunk/plplot_test/test_d.sh.in Added Paths: ----------- trunk/examples/d/x33d.d Modified: trunk/examples/d/CMakeLists.txt =================================================================== --- trunk/examples/d/CMakeLists.txt 2011-03-22 19:06:25 UTC (rev 11674) +++ trunk/examples/d/CMakeLists.txt 2011-03-22 21:58:47 UTC (rev 11675) @@ -57,6 +57,7 @@ "29" "30" "31" + "33" ) if(CORE_BUILD) Added: trunk/examples/d/x33d.d =================================================================== --- trunk/examples/d/x33d.d (rev 0) +++ trunk/examples/d/x33d.d 2011-03-22 21:58:47 UTC (rev 11675) @@ -0,0 +1,677 @@ +// -*- coding: utf-8; -*- +// +// $Id: x33c.c 11565 2011-02-13 21:06:58Z airwin $ +// +// Demonstrate most pllegend capability including unicode symbols. +// +// Copyright (C) 2010 Alan W. Irwin +// +// This file is part of PLplot. +// +// PLplot is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Library Public License as published +// by the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// PLplot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public License +// along with PLplot; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// + +// This example designed just for devices (e.g., the cairo-related and +// qt-related devices) where the best choice of glyph is automatically +// selected by the related libraries (pango/cairo or Qt4) for each +// unicode character depending on what system fonts are installed. Of +// course, you must have the appropriate TrueType fonts installed to +// have access to all the required glyphs. + +import plplot; +import std.math; +import std.string; + +//-------------------------------------------------------------------------- +// main +// +// Demonstrate most pllegend capability including unicode symbols. +//-------------------------------------------------------------------------- + + +int main( char[][] args ) +{ + PLINT opt; + PLINT nlegend, nturn; + PLINT[] opt_array; + PLINT[] text_colors; + PLINT[] box_colors; + PLINT[] box_patterns; + PLFLT[] box_scales; + PLINT[] box_line_widths; + PLINT[] line_colors; + PLINT[] line_styles; + PLINT[] line_widths; + PLINT[] symbol_numbers, symbol_colors; + PLFLT[] symbol_scales; + string[] text, symbols; + + PLFLT legend_width, legend_height, x, y, xstart, ystart; + PLFLT max_height, text_scale; + PLINT position, opt_base, nrow, ncolumn; + + PLINT[16] position_options = [ + PL_POSITION_LEFT | PL_POSITION_TOP | PL_POSITION_OUTSIDE, + PL_POSITION_TOP | PL_POSITION_OUTSIDE, + PL_POSITION_RIGHT | PL_POSITION_TOP | PL_POSITION_OUTSIDE, + PL_POSITION_RIGHT | PL_POSITION_OUTSIDE, + PL_POSITION_RIGHT | PL_POSITION_BOTTOM | PL_POSITION_OUTSIDE, + PL_POSITION_BOTTOM | PL_POSITION_OUTSIDE, + PL_POSITION_LEFT | PL_POSITION_BOTTOM | PL_POSITION_OUTSIDE, + PL_POSITION_LEFT | PL_POSITION_OUTSIDE, + PL_POSITION_LEFT | PL_POSITION_TOP | PL_POSITION_INSIDE, + PL_POSITION_TOP | PL_POSITION_INSIDE, + PL_POSITION_RIGHT | PL_POSITION_TOP | PL_POSITION_INSIDE, + PL_POSITION_RIGHT | PL_POSITION_INSIDE, + PL_POSITION_RIGHT | PL_POSITION_BOTTOM | PL_POSITION_INSIDE, + PL_POSITION_BOTTOM | PL_POSITION_INSIDE, + PL_POSITION_LEFT | PL_POSITION_BOTTOM | PL_POSITION_INSIDE, + PL_POSITION_LEFT | PL_POSITION_INSIDE + ]; + + // Pick 5 arbitrary UTF-8 symbols useful for plotting points (✠✚✱✪✽✺✰✴✦). + string[5] special_symbols = [ + "✰", + "✴", + "✱", + "✽", + "✦" +]; + + // Parse and process command line arguments + plparseopts( args, PL_PARSE_FULL ); + // Initialize plplot + plinit(); + + // First page illustrating the 16 standard positions. + pladv( 0 ); + plvpor( 0.25, 0.75, 0.25, 0.75 ); + plwind( 0.0, 1.0, 0.0, 1.0 ); + plbox( "bc", 0.0, 0, "bc", 0.0, 0 ); + plsfont( PL_FCI_SANS, -1, -1 ); + plmtex( "t", 8.0, 0.5, 0.5, "The 16 standard legend positions with" ); + plmtex( "t", 6.0, 0.5, 0.5, "the same (0.05) offset in x and y" ); + + nlegend = 1; + // Initialize arrays needed for pllegend. + opt_array.length = nlegend; + text_colors.length = nlegend; + text.length = nlegend; + line_colors.length = nlegend; + line_styles.length = nlegend; + line_widths.length = nlegend; + box_colors.length = nlegend; + box_patterns.length = nlegend; + box_scales.length = nlegend; + box_line_widths.length = nlegend; + symbol_numbers.length = nlegend; + symbol_colors.length = nlegend; + symbol_scales.length = nlegend; + symbols.length = nlegend; + + // Only specify legend data that are required according to the + // value of opt_array for that entry. + opt_base = PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX; + opt_array[0] = PL_LEGEND_LINE | PL_LEGEND_SYMBOL; + line_styles[0] = 1; + line_widths[0] = 1; + symbol_scales[0] = 1.; + symbol_numbers[0] = 4; + symbols[0] = "*"; + + // Use monotype fonts so that all legends are the same size. + plsfont( PL_FCI_MONO, -1, -1 ); + plscol0a( 15, 32, 32, 32, 0.70 ); + + for ( size_t k = 0; k < 16; k++ ) + { + position = position_options[k]; + opt = opt_base; + text[0] = format( "%2.2d", k ); + text_colors[0] = 1 + ( k % 8 ); + line_colors[0] = 1 + ( k % 8 ); + symbol_colors[0] = 1 + ( k % 8 ); + + pllegend( &legend_width, &legend_height, position, opt, 0.05, 0.05, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, 1.0, 2.0, + 1., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + } + + // Second page illustrating effect of nrow, ncolumn for the same legend + // data.; + pladv( 0 ); + plvpor( 0.25, 0.75, 0.25, 0.75 ); + plwind( 0.0, 1.0, 0.0, 1.0 ); + plbox( "bc", 0.0, 0, "bc", 0.0, 0 ); + plsfont( PL_FCI_SANS, -1, -1 ); + plmtex( "t", 8.0, 0.5, 0.5, "The effect of nrow, ncolumn, PL_LEGEND_ROW_MAJOR," ); + plmtex( "t", 6.0, 0.5, 0.5, "and position for the same legend data" ); + + nlegend = 7; + // Initialize arrays needed for pllegend. + opt_array.length = nlegend; + text_colors.length = nlegend; + text.length = nlegend; + line_colors.length = nlegend; + line_styles.length = nlegend; + line_widths.length = nlegend; + box_colors.length = nlegend; + box_patterns.length = nlegend; + box_scales.length = nlegend; + box_line_widths.length = nlegend; + symbol_numbers.length = nlegend; + symbol_colors.length = nlegend; + symbol_scales.length = nlegend; + symbols.length = nlegend; + + // Only specify legend data that are required according to the + // value of opt_array for that entry. + opt_base = PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX; + for ( size_t k = 0; k < nlegend; k++ ) + { + opt_array[k] = PL_LEGEND_LINE | PL_LEGEND_SYMBOL; + line_styles[k] = 1; + line_widths[k] = 1; + symbol_scales[k] = 1.; + symbol_numbers[k] = 2; + symbols[k] = "*"; + text[k] = format( "%2.2d", k ); + text_colors[k] = 1 + ( k % 8 ); + line_colors[k] = 1 + ( k % 8 ); + symbol_colors[k] = 1 + ( k % 8 ); + } + + // Use monotype fonts so that all legends are the same size. + plsfont( PL_FCI_MONO, -1, -1 ); + plscol0a( 15, 32, 32, 32, 0.70 ); + + position = PL_POSITION_TOP | PL_POSITION_OUTSIDE; + opt = opt_base; + x = 0.; + y = 0.1; + nrow = 1; + ncolumn = nlegend; + pllegend( &legend_width, &legend_height, position, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + opt_array, 1.0, 1.0, 2.0, + 1., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + + position = PL_POSITION_BOTTOM | PL_POSITION_OUTSIDE; + opt = opt_base; + x = 0.; + y = 0.1; + nrow = 1; + ncolumn = nlegend; + pllegend( &legend_width, &legend_height, position, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + opt_array, 1.0, 1.0, 2.0, + 1., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + + position = PL_POSITION_LEFT | PL_POSITION_OUTSIDE; + opt = opt_base; + x = 0.1; + y = 0.; + nrow = nlegend; + ncolumn = 1; + pllegend( &legend_width, &legend_height, position, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + opt_array, 1.0, 1.0, 2.0, + 1., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + + position = PL_POSITION_RIGHT | PL_POSITION_OUTSIDE; + opt = opt_base; + x = 0.1; + y = 0.; + nrow = nlegend; + ncolumn = 1; + pllegend( &legend_width, &legend_height, position, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + opt_array, 1.0, 1.0, 2.0, + 1., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + + position = PL_POSITION_LEFT | PL_POSITION_TOP | PL_POSITION_INSIDE; + opt = opt_base; + x = 0.; + y = 0.; + nrow = 6; + ncolumn = 2; + pllegend( &legend_width, &legend_height, position, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + opt_array, 1.0, 1.0, 2.0, + 1., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + + position = PL_POSITION_RIGHT | PL_POSITION_TOP | PL_POSITION_INSIDE; + opt = opt_base | PL_LEGEND_ROW_MAJOR; + x = 0.; + y = 0.; + nrow = 6; + ncolumn = 2; + pllegend( &legend_width, &legend_height, position, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + opt_array, 1.0, 1.0, 2.0, + 1., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + + position = PL_POSITION_BOTTOM | PL_POSITION_INSIDE; + opt = opt_base | PL_LEGEND_ROW_MAJOR; + x = 0.; + y = 0.; + nrow = 3; + ncolumn = 3; + pllegend( &legend_width, &legend_height, position, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + opt_array, 1.0, 1.0, 2.0, + 1., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + + // Third page demonstrating legend alignment + pladv( 0 ); + plvpor( 0.0, 1.0, 0.0, 0.9 ); + plwind( 0.0, 1.0, 0.0, 1.0 ); + plsfont( PL_FCI_SANS, -1, -1 ); + plmtex( "t", 2.0, 0.5, 0.5, "Demonstrate legend alignment" ); + + x = 0.1; + y = 0.1; + nturn = 4; + nlegend = 0; + position = PL_POSITION_TOP | PL_POSITION_LEFT | PL_POSITION_SUBPAGE; + opt_base = PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX; + opt = opt_base; + for ( size_t i = 0; i < 9; i++ ) + { + // Set up legend arrays with the correct size, type. + if ( i <= nturn ) + nlegend += 1; + else + nlegend -= 1; + nlegend = cast(PLINT) fmax( 1, nlegend ); + // Initialize arrays needed for pllegend. + opt_array.length = nlegend; + text_colors.length = nlegend; + text.length = nlegend; + line_colors.length = nlegend; + line_styles.length = nlegend; + line_widths.length = nlegend; + box_colors.length = nlegend; + box_patterns.length = nlegend; + box_scales.length = nlegend; + box_line_widths.length = nlegend; + symbol_numbers.length = nlegend; + symbol_colors.length = nlegend; + symbol_scales.length = nlegend; + symbols.length = nlegend; + + // nly specify legend data that are required according to the + // value of opt_array for that entry. + for ( size_t k = 0; k < nlegend; k++ ) + { + opt_array[k] = PL_LEGEND_LINE | PL_LEGEND_SYMBOL; + line_styles[k] = 1; + line_widths[k] = 1; + symbol_scales[k] = 1.; + symbol_numbers[k] = 2; + symbols[k] = "*"; + text[k] = format( "%2.2d", k ); + text_colors[k] = 1 + ( k % 8 ); + line_colors[k] = 1 + ( k % 8 ); + symbol_colors[k] = 1 + ( k % 8 ); + } + // Use monotype fonts so that all legends are the same size. + plsfont( PL_FCI_MONO, -1, -1 ); + plscol0a( 15, 32, 32, 32, 0.70 ); + + nrow = cast(PLINT) fmin( 3, nlegend ); + ncolumn = 0; + + pllegend( &legend_width, &legend_height, position, opt, x, y, + 0.025, 15, 1, 1, nrow, ncolumn, + opt_array, 1.0, 1.0, 1.5, + 1., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + + if ( i == nturn ) + { + position = PL_POSITION_TOP | PL_POSITION_RIGHT | PL_POSITION_SUBPAGE; + opt = opt_base; + x = 1. - x; + y += legend_height; + } + else + { + x += legend_width; + y += legend_height; + } + } + + // Fourth page illustrating various kinds of legends + max_height = 0.; + xstart = 0.0; + ystart = 0.1; + x = xstart; + y = ystart; + text_scale = 0.90; + pladv( 0 ); + plvpor( 0.0, 1., 0.0, 0.90 ); + plwind( 0.0, 1.0, 0.0, 1.0 ); + //plbox("bc", 0.0, 0, "bc", 0.0, 0); + plsfont( PL_FCI_SANS, -1, -1 ); + plmtex( "t", 2.0, 0.5, 0.5, "Demonstrate Various Kinds of Legends" ); + + nlegend = 5; + // Initialize arrays needed for pllegend. + opt_array.length = nlegend; + text_colors.length = nlegend; + text.length = nlegend; + line_colors.length = nlegend; + line_styles.length = nlegend; + line_widths.length = nlegend; + box_colors.length = nlegend; + box_patterns.length = nlegend; + box_scales.length = nlegend; + box_line_widths.length = nlegend; + symbol_numbers.length = nlegend; + symbol_colors.length = nlegend; + symbol_scales.length = nlegend; + symbols.length = nlegend; + + // Only specify legend data that are required according to the + // value of opt_array for that entry. + position = PL_POSITION_LEFT | PL_POSITION_TOP; + opt_base = PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX | PL_LEGEND_TEXT_LEFT; + + // Set up None, Box, Line, Symbol, and Line & Symbol legend entries. + opt_array[0] = PL_LEGEND_NONE; + text[0] = format( "%s", "None" ); + text_colors[0] = 1; + + opt_array[1] = PL_LEGEND_COLOR_BOX; + text[1] = format( "%s", "Box" ); + text_colors[1] = 2; + box_colors[1] = 2; + box_patterns[1] = 0; + box_scales[1] = 0.8; + box_line_widths[1] = 1; + + opt_array[2] = PL_LEGEND_LINE; + text[2] = format( "%s", "Line" ); + text_colors[2] = 3; + line_colors[2] = 3; + line_styles[2] = 1; + line_widths[2] = 1; + + opt_array[3] = PL_LEGEND_SYMBOL; + text[3] = format( "%s", "Symbol" ); + text_colors[3] = 4; + symbol_colors[3] = 4; + symbol_scales[3] = text_scale; + symbol_numbers[3] = 4; + symbols[3] = special_symbols[2]; + + opt_array[4] = PL_LEGEND_SYMBOL | PL_LEGEND_LINE; + text[4] = format( "%s", "L & S" ); + text_colors[4] = 5; + line_colors[4] = 5; + line_styles[4] = 1; + line_widths[4] = 1; + symbol_colors[4] = 5; + symbol_scales[4] = text_scale; + symbol_numbers[4] = 4; + symbols[4] = special_symbols[2]; + + opt = opt_base; + plscol0a( 15, 32, 32, 32, 0.70 ); + + pllegend( &legend_width, &legend_height, position, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, text_scale, 2.0, + 0., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + max_height = fmax( max_height, legend_height ); + + // Set up symbol legend entries with various symbols. + for ( size_t i = 0; i < nlegend; i++ ) + { + opt_array[i] = PL_LEGEND_SYMBOL; + text[i] = format( "%s%s", "Symbol ", special_symbols[i] ); + text_colors[i] = i + 1; + symbol_colors[i] = i + 1; + symbol_scales[i] = text_scale; + symbol_numbers[i] = 4; + symbols[i] = special_symbols[i]; + } + + opt = opt_base; + x += legend_width; + plscol0a( 15, 32, 32, 32, 0.70 ); + + pllegend( &legend_width, &legend_height, position, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, text_scale, 2.0, + 0., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + max_height = fmax( max_height, legend_height ); + + // Set up symbol legend entries with various numbers of symbols. + for ( size_t i = 0; i < nlegend; i++ ) + { + opt_array[i] = PL_LEGEND_SYMBOL; + text[i] = format( "%s %d", "Symbol Number", i + 2 ); + text_colors[i] = i + 1; + symbol_colors[i] = i + 1; + symbol_scales[i] = text_scale; + symbol_numbers[i] = i + 2; + symbols[i] = special_symbols[2]; + } + + opt = opt_base; + x += legend_width; + plscol0a( 15, 32, 32, 32, 0.70 ); + + pllegend( &legend_width, &legend_height, position, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, text_scale, 2.0, + 0., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + max_height = fmax( max_height, legend_height ); + + // Set up box legend entries with various colours. + for ( size_t i = 0; i < nlegend; i++ ) + { + opt_array[i] = PL_LEGEND_COLOR_BOX; + text[i] = format( "%s %d", "Box Color", i + 1 ); + text_colors[i] = i + 1; + box_colors[i] = i + 1; + box_patterns[i] = 0; + box_scales[i] = 0.8; + box_line_widths[i] = 1; + } + + opt = opt_base; + // Use new origin + x = xstart; + y += max_height; + max_height = 0.; + plscol0a( 15, 32, 32, 32, 0.70 ); + + pllegend( &legend_width, &legend_height, position, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, text_scale, 2.0, + 0., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + max_height = fmax( max_height, legend_height ); + + // Set up box legend entries with various patterns. + for ( size_t i = 0; i < nlegend; i++ ) + { + opt_array[i] = PL_LEGEND_COLOR_BOX; + text[i] = format( "%s %d", "Box Pattern", i ); + text_colors[i] = 2; + box_colors[i] = 2; + box_patterns[i] = i; + box_scales[i] = 0.8; + box_line_widths[i] = 1; + } + + opt = opt_base; + x += legend_width; + plscol0a( 15, 32, 32, 32, 0.70 ); + + pllegend( &legend_width, &legend_height, position, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, text_scale, 2.0, + 0., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + max_height = fmax( max_height, legend_height ); + + // Set up box legend entries with various box pattern line widths. + for ( size_t i = 0; i < nlegend; i++ ) + { + opt_array[i] = PL_LEGEND_COLOR_BOX; + text[i] = format( "%s %d", "Box Line Width", i + 1 ); + text_colors[i] = 2; + box_colors[i] = 2; + box_patterns[i] = 3; + box_scales[i] = 0.8; + box_line_widths[i] = i + 1; + } + + opt = opt_base; + x += legend_width; + plscol0a( 15, 32, 32, 32, 0.70 ); + + pllegend( &legend_width, &legend_height, position, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, text_scale, 2.0, + 0., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + max_height = fmax( max_height, legend_height ); + + // Set up line legend entries with various colours. + for ( size_t i = 0; i < nlegend; i++ ) + { + opt_array[i] = PL_LEGEND_LINE; + text[i] = format( "%s %d", "Line Color", i + 1 ); + text_colors[i] = i + 1; + line_colors[i] = i + 1; + line_styles[i] = 1; + line_widths[i] = 1; + } + + opt = opt_base; + // Use new origin + x = xstart; + y += max_height; + max_height = 0.; + plscol0a( 15, 32, 32, 32, 0.70 ); + + pllegend( &legend_width, &legend_height, position, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, text_scale, 2.0, + 0., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + max_height = fmax( max_height, legend_height ); + + // Set up line legend entries with various styles. + for ( size_t i = 0; i < nlegend; i++ ) + { + opt_array[i] = PL_LEGEND_LINE; + text[i] = format( "%s %d", "Line Style", i + 1 ); + text_colors[i] = 2; + line_colors[i] = 2; + line_styles[i] = i + 1; + line_widths[i] = 1; + } + + opt = opt_base; + x += legend_width; + plscol0a( 15, 32, 32, 32, 0.70 ); + + pllegend( &legend_width, &legend_height, position, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, text_scale, 2.0, + 0., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + max_height = fmax( max_height, legend_height ); + + // Set up line legend entries with various widths. + for ( size_t i = 0; i < nlegend; i++ ) + { + opt_array[i] = PL_LEGEND_LINE; + text[i] = format( "%s %d", "Line Width", i + 1 ); + text_colors[i] = 2; + line_colors[i] = 2; + line_styles[i] = 1; + line_widths[i] = i + 1; + } + + opt = opt_base; + x += legend_width; + plscol0a( 15, 32, 32, 32, 0.70 ); + + pllegend( &legend_width, &legend_height, position, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, text_scale, 2.0, + 0., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + max_height = fmax( max_height, legend_height ); + + plend(); + return 0; +} + Property changes on: trunk/examples/d/x33d.d ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/plplot_test/test_d.sh.in =================================================================== --- trunk/plplot_test/test_d.sh.in 2011-03-22 19:06:25 UTC (rev 11674) +++ trunk/plplot_test/test_d.sh.in 2011-03-22 21:58:47 UTC (rev 11675) @@ -31,7 +31,7 @@ # 20-22, 28, and 31 not implemented yet. # example 14 excluded until plgdev fixed since the bad driver information # causes run-time errors. -for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31; do +for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33; do if [ "$verbose_test" ] ; then echo "x${index}${lang}" fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2011-03-23 21:34:36
|
Revision: 11677 http://plplot.svn.sourceforge.net/plplot/?rev=11677&view=rev Author: andrewross Date: 2011-03-23 21:34:29 +0000 (Wed, 23 Mar 2011) Log Message: ----------- Add lua support for plstransform. Update example 19 to use this. Results are now consistent with the C version. Modified Paths: -------------- trunk/bindings/lua/plplotluac.i trunk/bindings/swig-support/plplotcapi.i trunk/examples/lua/x19.lua Modified: trunk/bindings/lua/plplotluac.i =================================================================== --- trunk/bindings/lua/plplotluac.i 2011-03-22 22:01:34 UTC (rev 11676) +++ trunk/bindings/lua/plplotluac.i 2011-03-23 21:34:29 UTC (rev 11677) @@ -634,6 +634,7 @@ typedef PLINT (*defined_func)(PLFLT, PLFLT); typedef void (*fill_func)(PLINT, const PLFLT*, const PLFLT*); typedef void (*pltr_func)(PLFLT, PLFLT, PLFLT *, PLFLT*, PLPointer); +typedef void (*ct_func)(PLFLT, PLFLT, PLFLT *, PLFLT*, PLPointer); typedef void (*mapform_func)(PLINT, PLFLT*, PLFLT*); typedef PLFLT (*f2eval_func)(PLINT, PLINT, PLPointer); typedef void (*label_func)(PLINT, PLFLT, char*, PLINT, PLPointer); @@ -642,6 +643,7 @@ typedef PLINT (*defined_func)(PLFLT, PLFLT); typedef void (*fill_func)(PLINT, const PLFLT*, const PLFLT*); typedef void (*pltr_func)(PLFLT, PLFLT, PLFLT *, PLFLT*, PLPointer); +typedef void (*ct_func)(PLFLT, PLFLT, PLFLT *, PLFLT*, PLPointer); typedef void (*mapform_func)(PLINT, PLFLT *, PLFLT*); typedef PLFLT (*f2eval_func)(PLINT, PLINT, PLPointer); typedef void (*label_func)(PLINT, PLFLT, char*, PLINT, PLPointer); @@ -687,6 +689,47 @@ return; } +static char myct_funcstr[255]; + +/* This is the callback that gets handed to the C code. + It, in turn, calls the Lua callback */ +void myct(PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data) +{ + *tx=0; + *ty=0; + + /* check Lua state */ + if(myL==NULL) { + fprintf(stderr, "Lua state is not set!"); + return; + } + + /* push functions and arguments */ + lua_getglobal(myL, myct_funcstr); /* function to be called */ + lua_pushnumber(myL, x); /* push 1st argument */ + lua_pushnumber(myL, y); /* push 2nd argument */ + + /* do the call (2 arguments, 2 result) */ + if(lua_pcall(myL, 2, 2, 0) != 0) + fprintf(stderr, "error running function `%s': %s", + myct_funcstr, lua_tostring(myL, -1)); + + /* retrieve results */ + if(!lua_isnumber(myL, -2)) { + fprintf(stderr, "function `%s' must return a number as 1st result", myct_funcstr); + return; + } + if(!lua_isnumber(myL, -1)) { + fprintf(stderr, "function `%s' must return a number as 2nd result", myct_funcstr); + return; + } + *tx = lua_tonumber(myL, -2); + *ty = lua_tonumber(myL, -1); + lua_pop(myL, 2); /* pop returned values */ + + return; +} + static char label_funcstr[255]; void mylabel(PLINT axis, PLFLT value, char* label, PLINT length, PLPointer data) @@ -798,6 +841,23 @@ } %apply pltr_func pltr { pltr_func pltr_img }; +%typemap(in) ct_func ctf { + $1 = NULL; + myct_funcstr[0]='\0'; + + if(lua_isstring(L, $input)) { + const char* funcstr = lua_tostring(L, $input); + $1 = myct; + strncpy(myct_funcstr, funcstr, 255); + myL = L; + } else + SWIG_fail_arg("$symname", $argnum, "$1_type") +} +/* you can omit the ct func */ +%typemap(default) ct_func ctf { + $1 = NULL; + myct_funcstr[0]='\0'; +} %typemap(arginit) PLPointer OBJECT_DATA { cgrid1$argnum.xg = cgrid1$argnum.yg = cgrid1$argnum.zg = NULL; @@ -1180,6 +1240,7 @@ %rename(ssym) plssym; %rename(star) plstar; %rename(start) plstart; +%rename(stransform) plstransform; %rename(string) plstring; %rename(string3) plstring3; %rename(stripa) plstripa; Modified: trunk/bindings/swig-support/plplotcapi.i =================================================================== --- trunk/bindings/swig-support/plplotcapi.i 2011-03-22 22:01:34 UTC (rev 11676) +++ trunk/bindings/swig-support/plplotcapi.i 2011-03-23 21:34:29 UTC (rev 11677) @@ -731,10 +731,8 @@ void plstart( const char *devname, PLINT nx, PLINT ny ); -#if !defined ( SWIG_LUA ) void plstransform( ct_func ctf, PLPointer data ); -#endif void plstring( PLINT n, const PLFLT *Array, const PLFLT *ArrayCk, const char *string ); Modified: trunk/examples/lua/x19.lua =================================================================== --- trunk/examples/lua/x19.lua 2011-03-22 22:01:34 UTC (rev 11676) +++ trunk/examples/lua/x19.lua 2011-03-23 21:34:29 UTC (rev 11677) @@ -25,6 +25,14 @@ -- initialise Lua bindings for PLplot examples. dofile("plplot_examples.lua") +function map_transform(x,y) + radius = 90 - y + xt = radius * math.cos(x * math.pi / 180) + yt = radius * math.sin(x * math.pi / 180) + + return xt, yt +end + -------------------------------------------------------------------------- -- mapform19 -- @@ -35,11 +43,7 @@ function mapform19(n, x, y) for i = 1, n do - radius = 90 - y[i] - xp = radius * math.cos(x[i] * math.pi / 180) - yp = radius * math.sin(x[i] * math.pi / 180) - x[i] = xp - y[i] = yp + x[i], y[i] = map_transform(x[i], y[i]) end return x, y @@ -106,6 +110,9 @@ -- Parse and process command line arguments +x = {} +y = {} + pl.parseopts(arg, pl.PL_PARSE_FULL) -- Longitude (x) and latitude (y) @@ -150,4 +157,33 @@ pl.lsty(2) pl.meridians("mapform19", 10, 10, 0, 360, -10, 80) + +-- Polar, Northern hemisphere, this time with a PLplot-wide transform + +minx = 0 +maxx = 360 + +pl.stransform( "map_transform" ) + +pl.lsty( 1 ) +pl.env( -75., 75., -75., 75., 1, -1 ) +-- No need to set the map transform here as the global transform will be +-- used. +pl.map( nil, "globe", minx, maxx, miny, maxy ) + +pl.lsty( 2 ); +pl.meridians( nil, 10.0, 10.0, 0.0, 360.0, -10.0, 80.0 ) + +-- Show Baltimore, MD on the map +pl.col0( 2 ) +pl.ssym( 0.0, 2.0 ) +x[1] = -76.6125 +y[1] = 39.2902778 +pl.poin( x, y, 18 ) +pl.ssym( 0.0, 1.0 ) +pl.ptex( -76.6125, 43.0, 0.0, 0.0, 0.0, "Baltimore, MD" ) + +-- For C, this is how the global transform is cleared +pl.stransform( ); + pl.plend() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-03-24 19:13:42
|
Revision: 11678 http://plplot.svn.sourceforge.net/plplot/?rev=11678&view=rev Author: airwin Date: 2011-03-24 19:13:36 +0000 (Thu, 24 Mar 2011) Log Message: ----------- Update (or implement in the case of plstring3 and docbook) doxygen and docbook documentation for plpoin, plpoin3, plsym, plstring, and plstring3. Modified Paths: -------------- trunk/doc/docbook/src/api.xml trunk/doc/docbook/src/plplotdoc.xml.in trunk/src/plsym.c Modified: trunk/doc/docbook/src/api.xml =================================================================== --- trunk/doc/docbook/src/api.xml 2011-03-23 21:34:29 UTC (rev 11677) +++ trunk/doc/docbook/src/api.xml 2011-03-24 19:13:36 UTC (rev 11678) @@ -6451,6 +6451,7 @@ <literal><parameter>nrow</parameter></literal> > 1 and <literal><parameter>ncolumn</parameter></literal> > 1, then plot the resulting array of legend entries in row-major order. + Otherwise, plot the legend entries in column-major order. </para> </listitem> </varlistentry> @@ -8717,13 +8718,10 @@ </para> <para> - Plot a glyph at a set of - <literal><parameter>n</parameter></literal> points at positions - <literal>(<parameter>x</parameter>[i], - <parameter>y</parameter>[i])</literal> using the glyph defined by - <literal><parameter>code</parameter></literal>. This function is - superseded by &plstring; which gives access to many(!) more glyphs. - code=-1 means try to just draw a point. Right now it's just a move + Plot a glyph at the specified points. (This function is largely + superseded by &plstring; which gives access to many[!] more glyphs.) + <literal><parameter>code</parameter>=-1</literal> means try to + just draw a point. Right now it's just a move and a draw at the same place. Not ideal, since a sufficiently intelligent output device may optimize it away, or there may be faster ways of doing it. This is OK for now, though, and offers a 4X speedup @@ -8777,8 +8775,9 @@ </term> <listitem> <para> - Hershey symbol code corresponding to a glyph to be plotted - at each of the <literal><parameter>n</parameter></literal> points. + Hershey symbol code (in "ascii-indexed" form with -1 <= code <= + 127) corresponding to a glyph to be plotted at each of the + <literal><parameter>n</parameter></literal> points. </para> </listitem> </varlistentry> @@ -8789,7 +8788,7 @@ </para> <para> - This function is used in examples 1,6,14,18,21,29. + This function is used in examples 1,6,14,21,29. </para> </sect1> @@ -8815,11 +8814,10 @@ </para> <para> - Plot a glyph at a set of - <literal><parameter>n</parameter></literal> points at positions - <literal>(<parameter>x</parameter>[i], <parameter>y</parameter>[i], - <parameter>z</parameter>[i])</literal> using the glyph defined by - <literal><parameter>code</parameter></literal>. code=-1 means try to + Plot a glyph at the specified 3D points. (This function is largely + superseded by &plstring3; which gives access to many[!] more glyphs.) + Set up the call to this function similar to what is done for &plline3;. + <literal><parameter>code</parameter>=-1</literal> means try to just draw a point. Right now it's just a move and a draw at the same place. Not ideal, since a sufficiently intelligent output device may optimize it away, or there may be faster ways of doing it. This is OK @@ -8897,7 +8895,7 @@ </para> <para> - This function is used in example 18. + This function is not used in any example. </para> </sect1> @@ -13936,16 +13934,15 @@ </para> <para> - Plot glyphs (normally just one of them) at a set of - <literal><parameter>n</parameter></literal> points at positions - <literal>(<parameter>x</parameter>[i], - <parameter>y</parameter>[i])</literal> using the glyph defined by - <literal><parameter>string</parameter></literal>. Supersedes &plpoin; - and &plsym; because many(!) more glyphs are accessible with - &plstring;. The glyph is specified with a PLplot user string. As - with &plmtex; and &plptex;, the user string can contain FCI escapes to - determine the font, UTF-8 code to determine the glyph or else PLplot - escapes for Hershey or unicode text to determine the glyph. + Plot a glyph at the specified points. (Supersedes &plpoin; and + &plsym; because many[!] more glyphs are accessible with &plstring;.) + The glyph is specified with a PLplot user string. Note that the user + string is not actually limited to one glyph so it is possible (but not + normally useful) to plot more than one glyph at the specified points + with this function. As with &plmtex; and &plptex;, the user string + can contain FCI escapes to determine the font, UTF-8 code to determine + the glyph or else PLplot escapes for Hershey or unicode text to + determine the glyph. </para> <variablelist> @@ -14000,15 +13997,121 @@ </variablelist> <para> - Redacted form: <function>plsym(x, y, code)</function> + Redacted form: <function>plstring(x, y, string)</function> </para> <para> - This function is used in example 7. + This function is used in examples 4 and 26. </para> </sect1> + <sect1 id="plstring3" renderas="sect3"> + <title> + <function>plstring3</function>: Plot a glyph at the specified 3D points + </title> + + <para> + <funcsynopsis> + <funcprototype> + <funcdef> + <function>plstring3</function> + </funcdef> + <paramdef><parameter>n</parameter></paramdef> + <paramdef><parameter>x</parameter></paramdef> + <paramdef><parameter>y</parameter></paramdef> + <paramdef><parameter>z</parameter></paramdef> + <paramdef><parameter>string</parameter></paramdef> + </funcprototype> + </funcsynopsis> + </para> + + <para> + Plot a glyph at the specified 3D points. (Supersedes &plpoin3; + because many[!] more glyphs are accessible with &plstring3;.) + Set up the call to this function similar to what is done for &plline3;. + The glyph is specified with a PLplot user string. Note that the user + string is not actually limited to one glyph so it is possible (but not + normally useful) to plot more than one glyph at the specified points + with this function. As with &plmtex; and &plptex;, the user string + can contain FCI escapes to determine the font, UTF-8 code to determine + the glyph or else PLplot escapes for Hershey or unicode text to + determine the glyph. + </para> + + <variablelist> + <varlistentry> + <term> + <parameter>n</parameter> + (<literal>PLINT</literal>, input) + </term> + <listitem> + <para> + Number of points in the + <literal><parameter>x</parameter></literal>, + <literal><parameter>y</parameter></literal>, and + <literal><parameter>z</parameter></literal> arrays. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>x</parameter> + (<literal>PLFLT *</literal>, input) + </term> + <listitem> + <para> + Pointer to an array with X coordinates of points. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>y</parameter> + (<literal>PLFLT *</literal>, input) + </term> + <listitem> + <para> + Pointer to an array with Y coordinates of points. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>z</parameter> + (<literal>PLFLT *</literal>, input) + </term> + <listitem> + <para> + Pointer to an array with Z coordinates of points. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>string</parameter> + (<literal>const char *</literal>, input) + </term> + <listitem> + <para> + PLplot user string corresponding to the glyph to be + plotted at each of the <literal><parameter>n</parameter></literal> + points. + </para> + </listitem> + </varlistentry> + </variablelist> + + <para> + Redacted form: <function>plstring3(x, y, z, string)</function> + </para> + + <para> + This function is used in example 18. + </para> + + </sect1> + <sect1 id="plstripa" renderas="sect3"> <title> <function>plstripa</function>: Add a point to a stripchart @@ -15223,13 +15326,9 @@ </para> <para> - Plot a glyph at a set of - <literal><parameter>n</parameter></literal> points at positions - <literal>(<parameter>x</parameter>[i], - <parameter>y</parameter>[i])</literal> using the glyph defined by - <literal><parameter>code</parameter></literal>. The code is - interpreted as an index in the Hershey font tables. This function is - superseded by &plstring; which gives access to many(!) more glyphs. + Plot a glyph at the specified points. (This function is + largely superseded by &plstring; which gives access to many[!] + more glyphs.) </para> <variablelist> Modified: trunk/doc/docbook/src/plplotdoc.xml.in =================================================================== --- trunk/doc/docbook/src/plplotdoc.xml.in 2011-03-23 21:34:29 UTC (rev 11677) +++ trunk/doc/docbook/src/plplotdoc.xml.in 2011-03-24 19:13:36 UTC (rev 11678) @@ -225,6 +225,7 @@ <!ENTITY plstar '<link linkend="plstar"><function>plstar</function></link>'> <!ENTITY plstripa '<link linkend="plstripa"><function>plstripa</function></link>'> <!ENTITY plstring '<link linkend="plstring"><function>plstring</function></link>'> +<!ENTITY plstring3 '<link linkend="plstring3"><function>plstring3</function></link>'> <!ENTITY plstripc '<link linkend="plstripc"><function>plstripc</function></link>'> <!ENTITY plstripd '<link linkend="plstripd"><function>plstripd</function></link>'> <!ENTITY plstart '<link linkend="plstart"><function>plstart</function></link>'> Modified: trunk/src/plsym.c =================================================================== --- trunk/src/plsym.c 2011-03-23 21:34:29 UTC (rev 11677) +++ trunk/src/plsym.c 2011-03-24 19:13:36 UTC (rev 11678) @@ -83,13 +83,15 @@ plhrsh2( PLINT ch, PLINT x, PLINT y ); //-------------------------------------------------------------------------- -//! Plot glyphs (normally just one of them) at the specified -//! coordinates. This function largely supersedes plpoin and plsym -//! because many(!) more glyphs are accessible with plstring. The -//! glyph is specified with a PLplot user string. As with plmtex and -//! plptex, the user string can contain FCI escapes to determine the -//! font, UTF-8 code to determine the glyph or else PLplot escapes for -//! Hershey or unicode text to determine the glyph. +//! Plot a glyph at the specified points. (This function largely +//! supersedes plpoin and plsym because many[!] more glyphs are +//! accessible with plstring.) The glyph is specified with a PLplot +//! user string. Note that the user string is not actually limited to +//! one glyph so it is possible (but not normally useful) to plot more +//! than one glyph at the specified points with this function. As +//! with plmtex and plptex, the user string can contain FCI escapes to +//! determine the font, UTF-8 code to determine the glyph or else +//! PLplot escapes for Hershey or unicode text to determine the glyph. //! @param n Number of points in x and y arrays. //! @param x Array of X coordinates of points. //! @param y Array of Y coordinates of points. @@ -108,8 +110,8 @@ } //-------------------------------------------------------------------------- -//! Plot a glyph at the specified points. This function is largely -//! superseded by plstring which gives access to many(!) more glyphs. +//! Plot a glyph at the specified points. (This function is largely +//! superseded by plstring which gives access to many[!] more glyphs.) //! @param n Number of points in x and y arrays. //! @param x Pointer to an array with X coordinates of points. //! @param y Pointer to an array with Y coordinates of points. @@ -142,8 +144,8 @@ } //-------------------------------------------------------------------------- -//! Plot a glyph at the specified points. This function is largely -//! superseded by plstring which gives access to many(!) more glyphs. +//! Plot a glyph at the specified points. (This function is largely +//! superseded by plstring which gives access to many[!] more glyphs.) //! code=-1 means try to just draw a point. Right now it's just a //! move and a draw at the same place. Not ideal, since a //! sufficiently intelligent output device may optimize it away, or @@ -203,11 +205,11 @@ } //-------------------------------------------------------------------------- -//! Plot a glyph at the specified 3D points. Setup the call to this -//! function similar to what is done for plline3. This function is -//! largely superseded by plstring3 which gives access to many(!) more -//! glyphs. code=-1 means try to just draw a point. Right now it's -//! just a move and a draw at the same place. Not ideal, since a +//! Plot a glyph at the specified 3D points. (This function is +//! largely superseded by plstring3 which gives access to many[!] more +//! glyphs.) Set up the call to this function similar to what is done +//! for plline3. code=-1 means try to just draw a point. Right now +//! it's just a move and a draw at the same place. Not ideal, since a //! sufficiently intelligent output device may optimize it away, or //! there may be faster ways of doing it. This is OK for now, though, //! and offers a 4X speedup over drawing a Hershey font "point" (which @@ -281,14 +283,17 @@ } //-------------------------------------------------------------------------- -//! Plot glyphs (normally just one of them) at the specified 3D -//! coordinates. Setup the call to this function similar to what is -//! done for plline3. This function largely supersedes plpoin3 -//! because many(!) more glyphs are accessible with plstring3. The -//! glyph is specified with a PLplot user string. As with plmtex and -//! plptex, the user string can contain FCI escapes to determine the -//! font, UTF-8 code to determine the glyph or else PLplot escapes for -//! Hershey or unicode text to determine the glyph. +//! Plot a glyph at the specified 3D points. (This function +//! largely supersedes plpoin3 because many[!] more glyphs are +//! accessible with plstring3). Set up the call to this function +//! similar to what is done for plline3. The glyph is specified with +//! a PLplot user string. Note that the user string is not actually +//! limited to one glyph so it is possible (but not normally useful) +//! to plot more than one glyph at the specified points with this +//! function. As with plmtex and plptex, the user string can contain +//! FCI escapes to determine the font, UTF-8 code to determine the +//! glyph or else PLplot escapes for Hershey or unicode text to +//! determine the glyph. //! @param n Number of points in x, y, and z arrays. //! @param x Array of X coordinates of points. //! @param y Array of Y coordinates of points. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-03-27 17:58:04
|
Revision: 11680 http://plplot.svn.sourceforge.net/plplot/?rev=11680&view=rev Author: airwin Date: 2011-03-27 17:57:51 +0000 (Sun, 27 Mar 2011) Log Message: ----------- Fix long-standing typographical error in LGPL licensing terms that has propagated to many of our files. Early in the license paragraph we incorrectly referred to the "GNU General Library Public License" (there is no such thing as the GNU GLPL) which has now been changed to the correct terminology "GNU Library General Public License" instead. This change is consistent with how we refer to the license later in the licensing paragraph. Modified Paths: -------------- trunk/bindings/ada/plplot.adb trunk/bindings/ada/plplot.ads trunk/bindings/ada/plplot_auxiliary.adb trunk/bindings/ada/plplot_auxiliary.ads trunk/bindings/ada/plplot_thin.adb trunk/bindings/ada/plplot_thin.ads trunk/bindings/ada/plplot_traditional.adb trunk/bindings/ada/plplot_traditional.ads trunk/bindings/c++/plstream.cc trunk/bindings/c++/plstream.h trunk/bindings/f77/configurable.f.cmake trunk/bindings/f77/double2single.sed trunk/bindings/f77/sc3d.c trunk/bindings/f77/sccont.c trunk/bindings/f77/scstubs.c trunk/bindings/f77/sfstubs.fm4 trunk/bindings/f77/sfstubs.h trunk/bindings/f77/strutil.f trunk/bindings/f95/configurable.f90 trunk/bindings/f95/sc3d.c trunk/bindings/f95/sccont.c trunk/bindings/f95/scstubs.c trunk/bindings/f95/sfstubs.f90 trunk/bindings/f95/sfstubs.h trunk/bindings/f95/sfstubsf95.f90 trunk/bindings/f95/strutil.f90 trunk/bindings/java/PLStream.java trunk/bindings/java/config.java.in trunk/bindings/qt_gui/pyqt4/plplot_pyqt4.sip trunk/bindings/tcl/matrixInit.c trunk/bindings/tcl/pkgIndex.tcl.in trunk/bindings/tcl/tclAPI.c trunk/bindings/tcl/tclMain.c trunk/bindings/tcl/tclMatrix.c trunk/bindings/tk/Pltk_Init.c trunk/bindings/tk/pkgIndex.tcl.in trunk/bindings/tk/pldefaults.tcl trunk/bindings/tk/plframe.c trunk/bindings/tk/plserver.c trunk/bindings/tk/tcpip.c trunk/bindings/tk/tkMain.c trunk/bindings/tk/tkshell.c trunk/bindings/tk-x-plat/Plplotter_Init.c trunk/bindings/tk-x-plat/pkgIndex.tcl.in trunk/bindings/tk-x-plat/plplotter.c trunk/bindings/wxwidgets/wxPLplotstream.cpp trunk/bindings/wxwidgets/wxPLplotstream.h.in trunk/bindings/wxwidgets/wxPLplotwindow.cpp trunk/bindings/wxwidgets/wxPLplotwindow.h trunk/drivers/aqt.c trunk/drivers/cairo.c trunk/drivers/gd.c trunk/drivers/pdf.c trunk/drivers/ps.c trunk/drivers/psttf.cc trunk/drivers/svg.c trunk/drivers/tk.c trunk/drivers/tkwin.c trunk/drivers/wingcc.c trunk/drivers/wxwidgets.cpp trunk/drivers/wxwidgets.h trunk/drivers/wxwidgets_agg.cpp trunk/drivers/wxwidgets_app.cpp trunk/drivers/wxwidgets_dc.cpp trunk/drivers/wxwidgets_gc.cpp trunk/drivers/xwin.c trunk/examples/ada/x01a.adb trunk/examples/ada/x02a.adb trunk/examples/ada/x03a.adb trunk/examples/ada/x04a.adb trunk/examples/ada/x05a.adb trunk/examples/ada/x06a.adb trunk/examples/ada/x07a.adb trunk/examples/ada/x08a.adb trunk/examples/ada/x09a.adb trunk/examples/ada/x10a.adb trunk/examples/ada/x11a.adb trunk/examples/ada/x12a.adb trunk/examples/ada/x13a.adb trunk/examples/ada/x14a.adb trunk/examples/ada/x15a.adb trunk/examples/ada/x16a.adb trunk/examples/ada/x17a.adb trunk/examples/ada/x18a.adb trunk/examples/ada/x19a.adb trunk/examples/ada/x20a.adb trunk/examples/ada/x21a.adb trunk/examples/ada/x22a.adb trunk/examples/ada/x23a.adb trunk/examples/ada/x24a.adb trunk/examples/ada/x25a.adb trunk/examples/ada/x26a.adb trunk/examples/ada/x27a.adb trunk/examples/ada/x28a.adb trunk/examples/ada/x29a.adb trunk/examples/ada/x30a.adb trunk/examples/ada/x31a.adb trunk/examples/ada/xthick01a.adb trunk/examples/ada/xthick02a.adb trunk/examples/ada/xthick03a.adb trunk/examples/ada/xthick04a.adb trunk/examples/ada/xthick05a.adb trunk/examples/ada/xthick06a.adb trunk/examples/ada/xthick07a.adb trunk/examples/ada/xthick08a.adb trunk/examples/ada/xthick09a.adb trunk/examples/ada/xthick10a.adb trunk/examples/ada/xthick11a.adb trunk/examples/ada/xthick12a.adb trunk/examples/ada/xthick13a.adb trunk/examples/ada/xthick14a.adb trunk/examples/ada/xthick15a.adb trunk/examples/ada/xthick16a.adb trunk/examples/ada/xthick17a.adb trunk/examples/ada/xthick18a.adb trunk/examples/ada/xthick19a.adb trunk/examples/ada/xthick20a.adb trunk/examples/ada/xthick21a.adb trunk/examples/ada/xthick22a.adb trunk/examples/ada/xthick23a.adb trunk/examples/ada/xthick24a.adb trunk/examples/ada/xthick25a.adb trunk/examples/ada/xthick26a.adb trunk/examples/ada/xthick27a.adb trunk/examples/ada/xthick28a.adb trunk/examples/ada/xthick29a.adb trunk/examples/ada/xthick30a.adb trunk/examples/ada/xthick31a.adb trunk/examples/c/extXdrawable_demo.c trunk/examples/c/x01c.c trunk/examples/c/x08c.c trunk/examples/c/x09c.c trunk/examples/c/x11c.c trunk/examples/c/x14c.c trunk/examples/c/x21c.c trunk/examples/c/x22c.c trunk/examples/c/x23c.c trunk/examples/c/x24c.c trunk/examples/c/x26c.c trunk/examples/c/x27c.c trunk/examples/c/x28c.c trunk/examples/c/x29c.c trunk/examples/c/x30c.c trunk/examples/c/x31c.c trunk/examples/c/x32c.c trunk/examples/c/x33c.c trunk/examples/c++/wxPLplotDemo.cpp trunk/examples/c++/x24.cc trunk/examples/c++/x25.cc trunk/examples/c++/x29.cc trunk/examples/c++/x30.cc trunk/examples/c++/x31.cc trunk/examples/c++/x33.cc trunk/examples/d/x01d.d trunk/examples/d/x08d.d trunk/examples/d/x09d.d trunk/examples/d/x11d.d trunk/examples/d/x14d.d trunk/examples/d/x21d.d trunk/examples/d/x22d.d trunk/examples/d/x23d.d trunk/examples/d/x24d.d trunk/examples/d/x26d.d trunk/examples/d/x27d.d trunk/examples/d/x28d.d trunk/examples/d/x29d.d trunk/examples/d/x30d.d trunk/examples/d/x31d.d trunk/examples/d/x33d.d trunk/examples/f77/double2single.sed trunk/examples/f77/x01f.fm4 trunk/examples/f77/x02f.fm4 trunk/examples/f77/x03f.fm4 trunk/examples/f77/x04f.fm4 trunk/examples/f77/x05f.fm4 trunk/examples/f77/x06f.fm4 trunk/examples/f77/x07f.fm4 trunk/examples/f77/x08f.fm4 trunk/examples/f77/x09f.fm4 trunk/examples/f77/x10f.fm4 trunk/examples/f77/x11f.fm4 trunk/examples/f77/x12f.fm4 trunk/examples/f77/x13f.fm4 trunk/examples/f77/x14f.fm4 trunk/examples/f77/x15f.fm4 trunk/examples/f77/x16af.fm4 trunk/examples/f77/x16f.fm4 trunk/examples/f77/x17f.fm4 trunk/examples/f77/x18f.fm4 trunk/examples/f77/x19f.fm4 trunk/examples/f77/x20f.fm4 trunk/examples/f77/x21f.fm4 trunk/examples/f77/x22f.fm4 trunk/examples/f77/x23f.fm4 trunk/examples/f77/x24f.fm4 trunk/examples/f77/x26f.fm4 trunk/examples/f77/x27f.fm4 trunk/examples/f77/x28f.fm4 trunk/examples/f77/x29f.fm4 trunk/examples/f77/x30f.fm4 trunk/examples/f77/x31f.fm4 trunk/examples/f77/x33f.fm4 trunk/examples/f95/x01f.f90 trunk/examples/f95/x02f.f90 trunk/examples/f95/x03f.f90 trunk/examples/f95/x04f.f90 trunk/examples/f95/x05f.f90 trunk/examples/f95/x06f.f90 trunk/examples/f95/x07f.f90 trunk/examples/f95/x08f.f90 trunk/examples/f95/x09f.f90 trunk/examples/f95/x10f.f90 trunk/examples/f95/x11f.f90 trunk/examples/f95/x12f.f90 trunk/examples/f95/x13f.f90 trunk/examples/f95/x14f.f90 trunk/examples/f95/x15f.f90 trunk/examples/f95/x16af.f90 trunk/examples/f95/x16f.f90 trunk/examples/f95/x17f.f90 trunk/examples/f95/x18f.f90 trunk/examples/f95/x19f.f90 trunk/examples/f95/x20f.f90 trunk/examples/f95/x21f.f90 trunk/examples/f95/x22f.f90 trunk/examples/f95/x23f.f90 trunk/examples/f95/x24f.f90 trunk/examples/f95/x25f.f90 trunk/examples/f95/x26f.f90 trunk/examples/f95/x27f.f90 trunk/examples/f95/x28f.f90 trunk/examples/f95/x29f.f90 trunk/examples/f95/x30f.f90 trunk/examples/f95/x31f.f90 trunk/examples/f95/x33f.f90 trunk/examples/java/x24.java trunk/examples/java/x25.java trunk/examples/java/x29.java trunk/examples/java/x30.java trunk/examples/java/x31.java trunk/examples/java/x33.java trunk/examples/lua/x01.lua trunk/examples/lua/x02.lua trunk/examples/lua/x03.lua trunk/examples/lua/x04.lua trunk/examples/lua/x05.lua trunk/examples/lua/x06.lua trunk/examples/lua/x07.lua trunk/examples/lua/x08.lua trunk/examples/lua/x09.lua trunk/examples/lua/x10.lua trunk/examples/lua/x11.lua trunk/examples/lua/x12.lua trunk/examples/lua/x13.lua trunk/examples/lua/x14.lua trunk/examples/lua/x15.lua trunk/examples/lua/x16.lua trunk/examples/lua/x17.lua trunk/examples/lua/x18.lua trunk/examples/lua/x19.lua trunk/examples/lua/x21.lua trunk/examples/lua/x22.lua trunk/examples/lua/x23.lua trunk/examples/lua/x24.lua trunk/examples/lua/x25.lua trunk/examples/lua/x26.lua trunk/examples/lua/x27.lua trunk/examples/lua/x28.lua trunk/examples/lua/x29.lua trunk/examples/lua/x30.lua trunk/examples/lua/x31.lua trunk/examples/lua/x33.lua trunk/examples/ocaml/x01.ml trunk/examples/ocaml/x02.ml trunk/examples/ocaml/x03.ml trunk/examples/ocaml/x08.ml trunk/examples/ocaml/x09.ml trunk/examples/ocaml/x11.ml trunk/examples/ocaml/x14.ml trunk/examples/ocaml/x17.ml trunk/examples/ocaml/x21.ml trunk/examples/ocaml/x22.ml trunk/examples/ocaml/x23.ml trunk/examples/ocaml/x24.ml trunk/examples/ocaml/x25.ml trunk/examples/ocaml/x26.ml trunk/examples/ocaml/x27.ml trunk/examples/ocaml/x28.ml trunk/examples/ocaml/x29.ml trunk/examples/ocaml/x30.ml trunk/examples/ocaml/x31.ml trunk/examples/ocaml/xplot01.ml trunk/examples/octave/x21c.m trunk/examples/octave/x23c.m trunk/examples/octave/x24c.m trunk/examples/octave/x26c.m trunk/examples/octave/x27c.m trunk/examples/octave/x28c.m trunk/examples/octave/x29c.m trunk/examples/octave/x30c.m trunk/examples/octave/x31c.m trunk/examples/octave/x33c.m trunk/examples/perl/x01.pl trunk/examples/perl/x02.pl trunk/examples/perl/x03.pl trunk/examples/perl/x04.pl trunk/examples/perl/x05.pl trunk/examples/perl/x06.pl trunk/examples/perl/x07.pl trunk/examples/perl/x08.pl trunk/examples/perl/x09.pl trunk/examples/perl/x10.pl trunk/examples/perl/x11.pl trunk/examples/perl/x12.pl trunk/examples/perl/x13.pl trunk/examples/perl/x14.pl trunk/examples/perl/x15.pl trunk/examples/perl/x16.pl trunk/examples/perl/x17.pl trunk/examples/perl/x18.pl trunk/examples/perl/x19.pl trunk/examples/perl/x20.pl trunk/examples/perl/x21.pl trunk/examples/perl/x22.pl trunk/examples/perl/x23.pl trunk/examples/perl/x24.pl trunk/examples/perl/x25.pl trunk/examples/perl/x26.pl trunk/examples/perl/x27.pl trunk/examples/perl/x28.pl trunk/examples/perl/x29.pl trunk/examples/perl/x30.pl trunk/examples/perl/x31.pl trunk/examples/python/pyqt4_example.py trunk/examples/python/test_hebrew_diacritic.py trunk/examples/python/test_plsmem.py.in trunk/examples/python/xw01.py trunk/examples/python/xw02.py trunk/examples/python/xw03.py trunk/examples/python/xw04.py trunk/examples/python/xw05.py trunk/examples/python/xw06.py trunk/examples/python/xw07.py trunk/examples/python/xw08.py trunk/examples/python/xw09.py trunk/examples/python/xw10.py trunk/examples/python/xw11.py trunk/examples/python/xw12.py trunk/examples/python/xw13.py trunk/examples/python/xw14.py trunk/examples/python/xw15.py trunk/examples/python/xw16.py trunk/examples/python/xw18.py trunk/examples/python/xw19.py trunk/examples/python/xw20.py trunk/examples/python/xw21.py trunk/examples/python/xw22.py trunk/examples/python/xw23.py trunk/examples/python/xw24.py trunk/examples/python/xw25.py trunk/examples/python/xw26.py trunk/examples/python/xw27.py trunk/examples/python/xw28.py trunk/examples/python/xw29.py trunk/examples/python/xw30.py trunk/examples/python/xw31.py trunk/examples/python/xw33.py trunk/examples/tcl/x08.tcl trunk/examples/tcl/x17.tcl trunk/examples/tcl/x19.tcl trunk/examples/tcl/x20.tcl trunk/examples/tcl/x21.tcl trunk/examples/tcl/x23.tcl trunk/examples/tcl/x24.tcl trunk/examples/tcl/x25.tcl trunk/examples/tcl/x26.tcl trunk/examples/tcl/x27.tcl trunk/examples/tcl/x28.tcl trunk/examples/tcl/x29.tcl trunk/examples/tcl/x30.tcl trunk/examples/tcl/x33.tcl trunk/examples/tk/xtk01.c trunk/examples/tk/xtk02.c trunk/examples/tk/xtk04.c trunk/fonts/plhershey-unicode-gen.c trunk/include/plConfig.h.cmake trunk/include/plfci-truetype.h trunk/include/plfci-type1.h trunk/include/plplotP.h trunk/include/plunicode-type1.h trunk/lib/qsastime/bhunt_search_test.c trunk/lib/qsastime/deltaT-gen.c trunk/lib/qsastime/dspline.c trunk/lib/qsastime/dsplint.c trunk/lib/qsastime/qsastime.c trunk/lib/qsastime/qsastime.h trunk/lib/qsastime/qsastime_extra.c trunk/lib/qsastime/qsastime_extra.h trunk/lib/qsastime/qsastime_test.c trunk/lib/qsastime/qsastime_testlib.c trunk/lib/qsastime/tai-utc-gen.c trunk/plplot_test/plplot-test-interactive.sh.in trunk/plplot_test/plplot-test.sh.cmake trunk/plplot_test/test_ada.sh.in trunk/plplot_test/test_c.sh.in trunk/plplot_test/test_c_interactive.sh.in trunk/plplot_test/test_cxx.sh.in trunk/plplot_test/test_d.sh.in trunk/plplot_test/test_diff.sh.in trunk/plplot_test/test_f77.sh.in trunk/plplot_test/test_f95.sh.in trunk/plplot_test/test_java.sh.in trunk/plplot_test/test_lua.sh.in trunk/plplot_test/test_ocaml.sh.in trunk/plplot_test/test_octave.sh.in trunk/plplot_test/test_octave_interactive.sh.in trunk/plplot_test/test_pdl.sh.in trunk/plplot_test/test_python.sh.in trunk/plplot_test/test_single_python.sh trunk/plplot_test/test_single_tcl.sh trunk/plplot_test/test_tcl.sh.in trunk/scripts/make_tarball.sh trunk/scripts/parity_bit_check.sh trunk/scripts/style_source.sh trunk/src/pdfutils.c trunk/src/plaffine.c trunk/src/plarc.c trunk/src/plbox.c trunk/src/plbuf.c trunk/src/plcont.c trunk/src/plcore.c trunk/src/plctrl.c trunk/src/plcvt.c trunk/src/pldtik.c trunk/src/plf2ops.c trunk/src/plfill.c trunk/src/plfreetype.c trunk/src/plgradient.c trunk/src/plgridd.c trunk/src/plgset.c trunk/src/plhist.c trunk/src/plimage.c trunk/src/pllegend.c trunk/src/plpage.c trunk/src/plsdef.c trunk/src/plshade.c trunk/src/plstripc.c trunk/src/plsym.c trunk/src/pltick.c trunk/src/pltime.c trunk/src/plvect.c trunk/src/plvpor.c trunk/src/plwind.c trunk/sys/win-tk/makefile.vc trunk/utils/pltcl.c Modified: trunk/bindings/ada/plplot.adb =================================================================== --- trunk/bindings/ada/plplot.adb 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/ada/plplot.adb 2011-03-27 17:57:51 UTC (rev 11680) @@ -7,7 +7,7 @@ -- This file is part of PLplot. -- PLplot is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Library Public License as published +-- it under the terms of the GNU Library General Public License as published -- by the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. Modified: trunk/bindings/ada/plplot.ads =================================================================== --- trunk/bindings/ada/plplot.ads 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/ada/plplot.ads 2011-03-27 17:57:51 UTC (rev 11680) @@ -7,7 +7,7 @@ -- This file is part of PLplot. -- PLplot is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Library Public License as published +-- it under the terms of the GNU Library General Public License as published -- by the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. Modified: trunk/bindings/ada/plplot_auxiliary.adb =================================================================== --- trunk/bindings/ada/plplot_auxiliary.adb 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/ada/plplot_auxiliary.adb 2011-03-27 17:57:51 UTC (rev 11680) @@ -8,7 +8,7 @@ -- This file is part of PLplot. -- PLplot is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Library Public License as published +-- it under the terms of the GNU Library General Public License as published -- by the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. Modified: trunk/bindings/ada/plplot_auxiliary.ads =================================================================== --- trunk/bindings/ada/plplot_auxiliary.ads 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/ada/plplot_auxiliary.ads 2011-03-27 17:57:51 UTC (rev 11680) @@ -8,7 +8,7 @@ -- This file is part of PLplot. -- PLplot is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Library Public License as published +-- it under the terms of the GNU Library General Public License as published -- by the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. Modified: trunk/bindings/ada/plplot_thin.adb =================================================================== --- trunk/bindings/ada/plplot_thin.adb 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/ada/plplot_thin.adb 2011-03-27 17:57:51 UTC (rev 11680) @@ -7,7 +7,7 @@ -- This file is part of PLplot. -- PLplot is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Library Public License as published +-- it under the terms of the GNU Library General Public License as published -- by the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. Modified: trunk/bindings/ada/plplot_thin.ads =================================================================== --- trunk/bindings/ada/plplot_thin.ads 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/ada/plplot_thin.ads 2011-03-27 17:57:51 UTC (rev 11680) @@ -7,7 +7,7 @@ -- This file is part of PLplot. -- PLplot is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Library Public License as published +-- it under the terms of the GNU Library General Public License as published -- by the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. Modified: trunk/bindings/ada/plplot_traditional.adb =================================================================== --- trunk/bindings/ada/plplot_traditional.adb 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/ada/plplot_traditional.adb 2011-03-27 17:57:51 UTC (rev 11680) @@ -7,7 +7,7 @@ -- This file is part of PLplot. -- PLplot is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Library Public License as published +-- it under the terms of the GNU Library General Public License as published -- by the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. Modified: trunk/bindings/ada/plplot_traditional.ads =================================================================== --- trunk/bindings/ada/plplot_traditional.ads 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/ada/plplot_traditional.ads 2011-03-27 17:57:51 UTC (rev 11680) @@ -7,7 +7,7 @@ -- This file is part of PLplot. -- PLplot is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Library Public License as published +-- it under the terms of the GNU Library General Public License as published -- by the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. Modified: trunk/bindings/c++/plstream.cc =================================================================== --- trunk/bindings/c++/plstream.cc 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/c++/plstream.cc 2011-03-27 17:57:51 UTC (rev 11680) @@ -9,7 +9,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/bindings/c++/plstream.h =================================================================== --- trunk/bindings/c++/plstream.h 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/c++/plstream.h 2011-03-27 17:57:51 UTC (rev 11680) @@ -9,7 +9,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/bindings/f77/configurable.f.cmake =================================================================== --- trunk/bindings/f77/configurable.f.cmake 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/f77/configurable.f.cmake 2011-03-27 17:57:51 UTC (rev 11680) @@ -5,7 +5,7 @@ C This file is part of PLplot. C C PLplot is free software; you can redistribute it and/or modify -C it under the terms of the GNU General Library Public License as +C it under the terms of the GNU Library General Public License as C published by the Free Software Foundation; either version 2 of the C License, or (at your option) any later version. C Modified: trunk/bindings/f77/double2single.sed =================================================================== --- trunk/bindings/f77/double2single.sed 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/f77/double2single.sed 2011-03-27 17:57:51 UTC (rev 11680) @@ -5,7 +5,7 @@ # This file is part of PLplot. # # PLplot is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Library Public License as published +# it under the terms of the GNU Library General Public License as published # by the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # Modified: trunk/bindings/f77/sc3d.c =================================================================== --- trunk/bindings/f77/sc3d.c 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/f77/sc3d.c 2011-03-27 17:57:51 UTC (rev 11680) @@ -7,7 +7,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/bindings/f77/sccont.c =================================================================== --- trunk/bindings/f77/sccont.c 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/f77/sccont.c 2011-03-27 17:57:51 UTC (rev 11680) @@ -7,7 +7,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/bindings/f77/scstubs.c =================================================================== --- trunk/bindings/f77/scstubs.c 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/f77/scstubs.c 2011-03-27 17:57:51 UTC (rev 11680) @@ -7,7 +7,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/bindings/f77/sfstubs.fm4 =================================================================== --- trunk/bindings/f77/sfstubs.fm4 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/f77/sfstubs.fm4 2011-03-27 17:57:51 UTC (rev 11680) @@ -7,7 +7,7 @@ c This file is part of PLplot. c c PLplot is free software; you can redistribute it and/or modify -c it under the terms of the GNU General Library Public License as published +c it under the terms of the GNU Library General Public License as published c by the Free Software Foundation; either version 2 of the License, or c (at your option) any later version. c Modified: trunk/bindings/f77/sfstubs.h =================================================================== --- trunk/bindings/f77/sfstubs.h 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/f77/sfstubs.h 2011-03-27 17:57:51 UTC (rev 11680) @@ -6,7 +6,7 @@ C This file is part of PLplot. C C PLplot is free software; you can redistribute it and/or modify -C it under the terms of the GNU General Library Public License as +C it under the terms of the GNU Library General Public License as C published by the Free Software Foundation; either version 2 of the C License, or (at your option) any later version. C Modified: trunk/bindings/f77/strutil.f =================================================================== --- trunk/bindings/f77/strutil.f 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/f77/strutil.f 2011-03-27 17:57:51 UTC (rev 11680) @@ -5,7 +5,7 @@ ! This file is part of PLplot. ! ! PLplot is free software; you can redistribute it and/or modify -! it under the terms of the GNU General Library Public License as published +! it under the terms of the GNU Library General Public License as published ! by the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! Modified: trunk/bindings/f95/configurable.f90 =================================================================== --- trunk/bindings/f95/configurable.f90 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/f95/configurable.f90 2011-03-27 17:57:51 UTC (rev 11680) @@ -5,7 +5,7 @@ ! This file is part of PLplot. ! ! PLplot is free software; you can redistribute it and/or modify -! it under the terms of the GNU General Library Public License as +! it under the terms of the GNU Library General Public License as ! published by the Free Software Foundation; either version 2 of the ! License, or (at your option) any later version. ! Modified: trunk/bindings/f95/sc3d.c =================================================================== --- trunk/bindings/f95/sc3d.c 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/f95/sc3d.c 2011-03-27 17:57:51 UTC (rev 11680) @@ -7,7 +7,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/bindings/f95/sccont.c =================================================================== --- trunk/bindings/f95/sccont.c 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/f95/sccont.c 2011-03-27 17:57:51 UTC (rev 11680) @@ -7,7 +7,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/bindings/f95/scstubs.c =================================================================== --- trunk/bindings/f95/scstubs.c 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/f95/scstubs.c 2011-03-27 17:57:51 UTC (rev 11680) @@ -7,7 +7,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/bindings/f95/sfstubs.f90 =================================================================== --- trunk/bindings/f95/sfstubs.f90 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/f95/sfstubs.f90 2011-03-27 17:57:51 UTC (rev 11680) @@ -7,7 +7,7 @@ ! This file is part of PLplot. ! ! PLplot is free software; you can redistribute it and/or modify -! it under the terms of the GNU General Library Public License as published +! it under the terms of the GNU Library General Public License as published ! by the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! Modified: trunk/bindings/f95/sfstubs.h =================================================================== --- trunk/bindings/f95/sfstubs.h 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/f95/sfstubs.h 2011-03-27 17:57:51 UTC (rev 11680) @@ -6,7 +6,7 @@ ! This file is part of PLplot. ! ! PLplot is free software; you can redistribute it and/or modify -! it under the terms of the GNU General Library Public License as +! it under the terms of the GNU Library General Public License as ! published by the Free Software Foundation; either version 2 of the ! License, or (at your option) any later version. ! Modified: trunk/bindings/f95/sfstubsf95.f90 =================================================================== --- trunk/bindings/f95/sfstubsf95.f90 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/f95/sfstubsf95.f90 2011-03-27 17:57:51 UTC (rev 11680) @@ -8,7 +8,7 @@ ! This file is part of PLplot. ! ! PLplot is free software; you can redistribute it and/or modify -! it under the terms of the GNU General Library Public License as published +! it under the terms of the GNU Library General Public License as published ! by the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! Modified: trunk/bindings/f95/strutil.f90 =================================================================== --- trunk/bindings/f95/strutil.f90 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/f95/strutil.f90 2011-03-27 17:57:51 UTC (rev 11680) @@ -5,7 +5,7 @@ ! This file is part of PLplot. ! ! PLplot is free software; you can redistribute it and/or modify -! it under the terms of the GNU General Library Public License as published +! it under the terms of the GNU Library General Public License as published ! by the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! Modified: trunk/bindings/java/PLStream.java =================================================================== --- trunk/bindings/java/PLStream.java 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/java/PLStream.java 2011-03-27 17:57:51 UTC (rev 11680) @@ -5,7 +5,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/bindings/java/config.java.in =================================================================== --- trunk/bindings/java/config.java.in 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/java/config.java.in 2011-03-27 17:57:51 UTC (rev 11680) @@ -5,7 +5,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/bindings/qt_gui/pyqt4/plplot_pyqt4.sip =================================================================== --- trunk/bindings/qt_gui/pyqt4/plplot_pyqt4.sip 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/qt_gui/pyqt4/plplot_pyqt4.sip 2011-03-27 17:57:51 UTC (rev 11680) @@ -7,7 +7,7 @@ This file is part of PLplot. PLplot is free software; you can redistribute it and/or modify - it under the terms of the GNU General Library Public License as published + it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Modified: trunk/bindings/tcl/matrixInit.c =================================================================== --- trunk/bindings/tcl/matrixInit.c 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/tcl/matrixInit.c 2011-03-27 17:57:51 UTC (rev 11680) @@ -8,7 +8,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/bindings/tcl/pkgIndex.tcl.in =================================================================== --- trunk/bindings/tcl/pkgIndex.tcl.in 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/tcl/pkgIndex.tcl.in 2011-03-27 17:57:51 UTC (rev 11680) @@ -8,7 +8,7 @@ # This file is part of PLplot. # # PLplot is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Library Public License as published +# it under the terms of the GNU Library General Public License as published # by the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # Modified: trunk/bindings/tcl/tclAPI.c =================================================================== --- trunk/bindings/tcl/tclAPI.c 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/tcl/tclAPI.c 2011-03-27 17:57:51 UTC (rev 11680) @@ -10,7 +10,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/bindings/tcl/tclMain.c =================================================================== --- trunk/bindings/tcl/tclMain.c 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/tcl/tclMain.c 2011-03-27 17:57:51 UTC (rev 11680) @@ -9,7 +9,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/bindings/tcl/tclMatrix.c =================================================================== --- trunk/bindings/tcl/tclMatrix.c 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/tcl/tclMatrix.c 2011-03-27 17:57:51 UTC (rev 11680) @@ -9,7 +9,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/bindings/tk/Pltk_Init.c =================================================================== --- trunk/bindings/tk/Pltk_Init.c 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/tk/Pltk_Init.c 2011-03-27 17:57:51 UTC (rev 11680) @@ -5,7 +5,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/bindings/tk/pkgIndex.tcl.in =================================================================== --- trunk/bindings/tk/pkgIndex.tcl.in 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/tk/pkgIndex.tcl.in 2011-03-27 17:57:51 UTC (rev 11680) @@ -8,7 +8,7 @@ # This file is part of PLplot. # # PLplot is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Library Public License as published +# it under the terms of the GNU Library General Public License as published # by the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # Modified: trunk/bindings/tk/pldefaults.tcl =================================================================== --- trunk/bindings/tk/pldefaults.tcl 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/tk/pldefaults.tcl 2011-03-27 17:57:51 UTC (rev 11680) @@ -3,7 +3,7 @@ # This file is part of PLplot. # # PLplot is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Library Public License as published +# it under the terms of the GNU Library General Public License as published # by the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # Modified: trunk/bindings/tk/plframe.c =================================================================== --- trunk/bindings/tk/plframe.c 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/tk/plframe.c 2011-03-27 17:57:51 UTC (rev 11680) @@ -10,7 +10,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/bindings/tk/plserver.c =================================================================== --- trunk/bindings/tk/plserver.c 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/tk/plserver.c 2011-03-27 17:57:51 UTC (rev 11680) @@ -9,7 +9,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/bindings/tk/tcpip.c =================================================================== --- trunk/bindings/tk/tcpip.c 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/tk/tcpip.c 2011-03-27 17:57:51 UTC (rev 11680) @@ -42,7 +42,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/bindings/tk/tkMain.c =================================================================== --- trunk/bindings/tk/tkMain.c 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/tk/tkMain.c 2011-03-27 17:57:51 UTC (rev 11680) @@ -9,7 +9,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/bindings/tk/tkshell.c =================================================================== --- trunk/bindings/tk/tkshell.c 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/tk/tkshell.c 2011-03-27 17:57:51 UTC (rev 11680) @@ -11,7 +11,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/bindings/tk-x-plat/Plplotter_Init.c =================================================================== --- trunk/bindings/tk-x-plat/Plplotter_Init.c 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/tk-x-plat/Plplotter_Init.c 2011-03-27 17:57:51 UTC (rev 11680) @@ -5,7 +5,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/bindings/tk-x-plat/pkgIndex.tcl.in =================================================================== --- trunk/bindings/tk-x-plat/pkgIndex.tcl.in 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/tk-x-plat/pkgIndex.tcl.in 2011-03-27 17:57:51 UTC (rev 11680) @@ -8,7 +8,7 @@ # This file is part of PLplot. # # PLplot is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Library Public License as published +# it under the terms of the GNU Library General Public License as published # by the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # Modified: trunk/bindings/tk-x-plat/plplotter.c =================================================================== --- trunk/bindings/tk-x-plat/plplotter.c 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/tk-x-plat/plplotter.c 2011-03-27 17:57:51 UTC (rev 11680) @@ -4,7 +4,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/bindings/wxwidgets/wxPLplotstream.cpp =================================================================== --- trunk/bindings/wxwidgets/wxPLplotstream.cpp 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/wxwidgets/wxPLplotstream.cpp 2011-03-27 17:57:51 UTC (rev 11680) @@ -5,7 +5,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/bindings/wxwidgets/wxPLplotstream.h.in =================================================================== --- trunk/bindings/wxwidgets/wxPLplotstream.h.in 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/wxwidgets/wxPLplotstream.h.in 2011-03-27 17:57:51 UTC (rev 11680) @@ -5,7 +5,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/bindings/wxwidgets/wxPLplotwindow.cpp =================================================================== --- trunk/bindings/wxwidgets/wxPLplotwindow.cpp 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/wxwidgets/wxPLplotwindow.cpp 2011-03-27 17:57:51 UTC (rev 11680) @@ -5,7 +5,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/bindings/wxwidgets/wxPLplotwindow.h =================================================================== --- trunk/bindings/wxwidgets/wxPLplotwindow.h 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/bindings/wxwidgets/wxPLplotwindow.h 2011-03-27 17:57:51 UTC (rev 11680) @@ -5,7 +5,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/drivers/aqt.c =================================================================== --- trunk/drivers/aqt.c 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/drivers/aqt.c 2011-03-27 17:57:51 UTC (rev 11680) @@ -8,7 +8,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/drivers/cairo.c =================================================================== --- trunk/drivers/cairo.c 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/drivers/cairo.c 2011-03-27 17:57:51 UTC (rev 11680) @@ -8,7 +8,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/drivers/gd.c =================================================================== --- trunk/drivers/gd.c 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/drivers/gd.c 2011-03-27 17:57:51 UTC (rev 11680) @@ -8,7 +8,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/drivers/pdf.c =================================================================== --- trunk/drivers/pdf.c 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/drivers/pdf.c 2011-03-27 17:57:51 UTC (rev 11680) @@ -7,7 +7,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/drivers/ps.c =================================================================== --- trunk/drivers/ps.c 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/drivers/ps.c 2011-03-27 17:57:51 UTC (rev 11680) @@ -13,7 +13,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/drivers/psttf.cc =================================================================== --- trunk/drivers/psttf.cc 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/drivers/psttf.cc 2011-03-27 17:57:51 UTC (rev 11680) @@ -14,7 +14,7 @@ This file is part of PLplot. PLplot is free software; you can redistribute it and/or modify - it under the terms of the GNU General Library Public License as published + it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Modified: trunk/drivers/svg.c =================================================================== --- trunk/drivers/svg.c 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/drivers/svg.c 2011-03-27 17:57:51 UTC (rev 11680) @@ -7,7 +7,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/drivers/tk.c =================================================================== --- trunk/drivers/tk.c 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/drivers/tk.c 2011-03-27 17:57:51 UTC (rev 11680) @@ -13,7 +13,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/drivers/tkwin.c =================================================================== --- trunk/drivers/tkwin.c 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/drivers/tkwin.c 2011-03-27 17:57:51 UTC (rev 11680) @@ -8,7 +8,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/drivers/wingcc.c =================================================================== --- trunk/drivers/wingcc.c 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/drivers/wingcc.c 2011-03-27 17:57:51 UTC (rev 11680) @@ -7,7 +7,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/drivers/wxwidgets.cpp =================================================================== --- trunk/drivers/wxwidgets.cpp 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/drivers/wxwidgets.cpp 2011-03-27 17:57:51 UTC (rev 11680) @@ -7,7 +7,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/drivers/wxwidgets.h =================================================================== --- trunk/drivers/wxwidgets.h 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/drivers/wxwidgets.h 2011-03-27 17:57:51 UTC (rev 11680) @@ -5,7 +5,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/drivers/wxwidgets_agg.cpp =================================================================== --- trunk/drivers/wxwidgets_agg.cpp 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/drivers/wxwidgets_agg.cpp 2011-03-27 17:57:51 UTC (rev 11680) @@ -5,7 +5,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/drivers/wxwidgets_app.cpp =================================================================== --- trunk/drivers/wxwidgets_app.cpp 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/drivers/wxwidgets_app.cpp 2011-03-27 17:57:51 UTC (rev 11680) @@ -5,7 +5,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/drivers/wxwidgets_dc.cpp =================================================================== --- trunk/drivers/wxwidgets_dc.cpp 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/drivers/wxwidgets_dc.cpp 2011-03-27 17:57:51 UTC (rev 11680) @@ -7,7 +7,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/drivers/wxwidgets_gc.cpp =================================================================== --- trunk/drivers/wxwidgets_gc.cpp 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/drivers/wxwidgets_gc.cpp 2011-03-27 17:57:51 UTC (rev 11680) @@ -5,7 +5,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/drivers/xwin.c =================================================================== --- trunk/drivers/xwin.c 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/drivers/xwin.c 2011-03-27 17:57:51 UTC (rev 11680) @@ -10,7 +10,7 @@ // This file is part of PLplot. // // PLplot is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Library Public License as published +// it under the terms of the GNU Library General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // Modified: trunk/examples/ada/x01a.adb =================================================================== --- trunk/examples/ada/x01a.adb 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/examples/ada/x01a.adb 2011-03-27 17:57:51 UTC (rev 11680) @@ -7,7 +7,7 @@ -- This file is part of PLplot. -- PLplot is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Library Public License as published +-- it under the terms of the GNU Library General Public License as published -- by the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. Modified: trunk/examples/ada/x02a.adb =================================================================== --- trunk/examples/ada/x02a.adb 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/examples/ada/x02a.adb 2011-03-27 17:57:51 UTC (rev 11680) @@ -7,7 +7,7 @@ -- This file is part of PLplot. -- PLplot is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Library Public License as published +-- it under the terms of the GNU Library General Public License as published -- by the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. Modified: trunk/examples/ada/x03a.adb =================================================================== --- trunk/examples/ada/x03a.adb 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/examples/ada/x03a.adb 2011-03-27 17:57:51 UTC (rev 11680) @@ -8,7 +8,7 @@ -- This file is part of PLplot. -- PLplot is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Library Public License as published +-- it under the terms of the GNU Library General Public License as published -- by the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. Modified: trunk/examples/ada/x04a.adb =================================================================== --- trunk/examples/ada/x04a.adb 2011-03-27 17:32:42 UTC (rev 11679) +++ trunk/examples/ada/x04a.adb 2011-03-27 17:57:51 UTC (rev 11680) @@ -7,7 +7,7 @@ -- This file is part of PLplot. -- PLplot is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Library Public License as published +-- it under the terms of the GNU Library General Public License as published -- by the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. Modified: trunk/examples/ada/x05a.adb =============... [truncated message content] |
From: <jb...@us...> - 2011-03-29 09:30:50
|
Revision: 11681 http://plplot.svn.sourceforge.net/plplot/?rev=11681&view=rev Author: jbauck Date: 2011-03-29 09:30:43 +0000 (Tue, 29 Mar 2011) Log Message: ----------- Ada: Tweak bindings. Update examples 04, 26, 27. Modified Paths: -------------- trunk/bindings/ada/plplot.adb trunk/bindings/ada/plplot.ads trunk/bindings/ada/plplot_auxiliary.adb trunk/bindings/ada/plplot_auxiliary.ads trunk/bindings/ada/plplot_traditional.adb trunk/bindings/ada/plplot_traditional.ads trunk/examples/ada/x04a.adb trunk/examples/ada/x26a.adb trunk/examples/ada/x27a.adb trunk/examples/ada/xthick04a.adb trunk/examples/ada/xthick26a.adb trunk/examples/ada/xthick27a.adb Modified: trunk/bindings/ada/plplot.adb =================================================================== --- trunk/bindings/ada/plplot.adb 2011-03-27 17:57:51 UTC (rev 11680) +++ trunk/bindings/ada/plplot.adb 2011-03-29 09:30:43 UTC (rev 11681) @@ -1867,7 +1867,7 @@ Text_Offset, Text_Scale, Text_Spacing : Long_Float; Text_Justification : Long_Float; Text_Colors : Integer_Array_1D; - Label_Text : in out Legend_String_Array_Type; + Label_Text : Legend_String_Array_Type; Box_Colors, Box_Patterns : Integer_Array_1D; Box_Scales : Real_Vector; Box_Line_Widths : Integer_Array_1D; @@ -1875,13 +1875,14 @@ Symbol_Colors : Integer_Array_1D; Symbol_Scales : Real_Vector; Symbol_Numbers : Integer_Array_1D; - Symbols : in out Legend_String_Array_Type) + Symbols : Legend_String_Array_Type) is Number_Entries : Integer := Label_Text'length; L : Integer; -- Used to check lengths of arrays. PL_Label_Text, PL_Symbols : PL_Legend_String_Array(Label_Text'range); C_Legend_String_Array : array(Label_Text'range) of PL_Legend_String; C_Symbols_String_Array : array(Symbols'range) of PL_Legend_String; + Dum_Text : Legend_String_Array_Type(Label_Text'range); begin -- Check that all array lengths in the argument list are the same. L := Entry_Options'length; @@ -1902,13 +1903,15 @@ if Length(Label_Text(I)) >= Max_Legend_Label_Length then Put_Line("*** Warning: Legend label was truncated to" & Integer'Image(Max_Legend_Label_Length) & " characters. ***"); - Label_Text(I) := Head(Label_Text(I), Max_Legend_Label_Length); + Dum_Text(I) := Head(Label_Text(I), Max_Legend_Label_Length); + else + Dum_Text(I) := Label_Text(I); end if; -- Make the C-style string with null character immediately after the text. - C_Legend_String_Array(I) := To_C(To_String(Label_Text(I) + C_Legend_String_Array(I) := To_C(To_String(Dum_Text(I) & Character'val(0) - & (Max_Legend_Label_Length - Length(Label_Text(I))) * " "), False); + & (Max_Legend_Label_Length - Length(Dum_Text(I))) * " "), False); -- Set the I-th pointer in the array of pointers. PL_Label_Text(I) := C_Legend_String_Array(I)'Address; @@ -1921,13 +1924,15 @@ if Length(Symbols(I)) >= Max_Legend_Label_Length then Put_Line("*** Warning: Legend symbols label was truncated to" & Integer'Image(Max_Legend_Label_Length) & " characters. ***"); - Symbols(I) := Head(Symbols(I), Max_Legend_Label_Length); + Dum_Text(I) := Head(Symbols(I), Max_Legend_Label_Length); + else + Dum_Text(I) := Symbols(I); end if; -- Make the C-style string with null character immediately after the text. - C_Symbols_String_Array(I) := To_C(To_String(Symbols(I) + C_Symbols_String_Array(I) := To_C(To_String(Dum_Text(I) & Character'val(0) - & (Max_Legend_Label_Length - Length(Symbols(I))) * " "), False); + & (Max_Legend_Label_Length - Length(Dum_Text(I))) * " "), False); -- Set the I-th pointer in the array of pointers. PL_Symbols(I) := C_Symbols_String_Array(I)'Address; Modified: trunk/bindings/ada/plplot.ads =================================================================== --- trunk/bindings/ada/plplot.ads 2011-03-27 17:57:51 UTC (rev 11680) +++ trunk/bindings/ada/plplot.ads 2011-03-29 09:30:43 UTC (rev 11681) @@ -1244,7 +1244,7 @@ Text_Offset, Text_Scale, Text_Spacing : Long_Float; Text_Justification : Long_Float; Text_Colors : Integer_Array_1D; - Label_Text : in out Legend_String_Array_Type; + Label_Text : Legend_String_Array_Type; Box_Colors, Box_Patterns : Integer_Array_1D; Box_Scales : Real_Vector; Box_Line_Widths : Integer_Array_1D; @@ -1252,7 +1252,7 @@ Symbol_Colors : Integer_Array_1D; Symbol_Scales : Real_Vector; Symbol_Numbers : Integer_Array_1D; - Symbols : in out Legend_String_Array_Type); + Symbols : Legend_String_Array_Type); -- Sets position of the light source Modified: trunk/bindings/ada/plplot_auxiliary.adb =================================================================== --- trunk/bindings/ada/plplot_auxiliary.adb 2011-03-27 17:57:51 UTC (rev 11680) +++ trunk/bindings/ada/plplot_auxiliary.adb 2011-03-29 09:30:43 UTC (rev 11681) @@ -27,6 +27,23 @@ -- Utility procedures useful in compiling the examples -- -------------------------------------------------------------------------------- + -- Mimic C conversion of float to integer; something similar works in e.g. + -- plplot_thin.adb. + -- C truncates towards 0. Ada rounds to nearest integer; midway rounded + -- away from zero, e.g. Inteter(±3.5) is ±4. But any completely reliable + -- conversion is probalby not possible; indeed, this one exactly emulates C + -- when tested for values around ±2 to ±3. Both convert ±2.9999999999999997 + -- to ±2 and ±2.9999999999999998 to ±3. + function Trunc(a : Long_Float) return Integer is + begin + if a >= 0.0 then + return Integer(a - 0.4999999999999999); + else + return Integer(a + 0.4999999999999999); + end if; + end Trunc; + + -- Find minimum in a 1D array. function Vector_Min(x : Real_Vector) return Long_Float is Result : Long_Float; Modified: trunk/bindings/ada/plplot_auxiliary.ads =================================================================== --- trunk/bindings/ada/plplot_auxiliary.ads 2011-03-27 17:57:51 UTC (rev 11680) +++ trunk/bindings/ada/plplot_auxiliary.ads 2011-03-29 09:30:43 UTC (rev 11681) @@ -22,7 +22,7 @@ -- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA with - Ada.Strings.Bounded, + Ada.Strings.Bounded, -- fixme Probable cruft. Ada.Strings.Unbounded; use @@ -68,6 +68,15 @@ -- Utility procedures useful in compiling the examples -- -------------------------------------------------------------------------------- + -- Mimic C conversion of float to integer; something similar works in e.g. + -- plplot_thin.adb. + -- C truncates towards 0. Ada rounds to nearest integer; midway rounded + -- away from zero, e.g. Inteter(±3.5) is ±4. But any completely reliable + -- conversion is probalby not possible; indeed, this one exactly emulates C + -- when tested for values around ±2 to ±3. Both convert ±2.9999999999999997 + -- to ±2 and ±2.9999999999999998 to ±3. + function Trunc(a : Long_Float) return Integer; + -- Find minimum in a 1D array. function Vector_Min(x : Real_Vector) return Long_Float; Modified: trunk/bindings/ada/plplot_traditional.adb =================================================================== --- trunk/bindings/ada/plplot_traditional.adb 2011-03-27 17:57:51 UTC (rev 11680) +++ trunk/bindings/ada/plplot_traditional.adb 2011-03-29 09:30:43 UTC (rev 11681) @@ -1798,7 +1798,7 @@ Text_Offset, Text_Scale, Text_Spacing : Long_Float; Text_Justification : Long_Float; Text_Colors : Integer_Array_1D; -- Really Plot_Color_Type - Label_Text : in out Legend_String_Array_Type; + Label_Text : Legend_String_Array_Type; Box_Colors, Box_Patterns : Integer_Array_1D; Box_Scales : Real_Vector; Box_Line_Widths : Integer_Array_1D; @@ -1806,13 +1806,14 @@ Symbol_Colors : Integer_Array_1D; Symbol_Scales : Real_Vector; Symbol_Numbers : Integer_Array_1D; - Symbols : in out Legend_String_Array_Type) + Symbols : Legend_String_Array_Type) is Number_Entries : Integer := Label_Text'length; L : Integer; -- Used to check lengths of arrays. PL_Label_Text, PL_Symbols : PL_Legend_String_Array(Label_Text'range); C_Legend_String_Array : array(Label_Text'range) of PL_Legend_String; C_Symbols_String_Array : array(Symbols'range) of PL_Legend_String; + Dum_Text : Legend_String_Array_Type(Label_Text'range); begin -- Check that all array lengths in the argument list are the same. L := Entry_Options'length; @@ -1833,13 +1834,15 @@ if Length(Label_Text(I)) >= Max_Legend_Label_Length then Put_Line("*** Warning: Legend label was truncated to" & Integer'Image(Max_Legend_Label_Length) & " characters. ***"); - Label_Text(I) := Head(Label_Text(I), Max_Legend_Label_Length); + Dum_Text(I) := Head(Label_Text(I), Max_Legend_Label_Length); + else + Dum_Text(I) := Label_Text(I); end if; -- Make the C-style string with null character immediately after the text. - C_Legend_String_Array(I) := To_C(To_String(Label_Text(I) + C_Legend_String_Array(I) := To_C(To_String(Dum_Text(I) & Character'val(0) - & (Max_Legend_Label_Length - Length(Label_Text(I))) * " "), False); + & (Max_Legend_Label_Length - Length(Dum_Text(I))) * " "), False); -- Set the I-th pointer in the array of pointers. PL_Label_Text(I) := C_Legend_String_Array(I)'Address; @@ -1852,13 +1855,15 @@ if Length(Symbols(I)) >= Max_Legend_Label_Length then Put_Line("*** Warning: Legend symbols label was truncated to" & Integer'Image(Max_Legend_Label_Length) & " characters. ***"); - Symbols(I) := Head(Symbols(I), Max_Legend_Label_Length); + Dum_Text(I) := Head(Symbols(I), Max_Legend_Label_Length); + else + Dum_Text(I) := Symbols(I); end if; -- Make the C-style string with null character immediately after the text. - C_Symbols_String_Array(I) := To_C(To_String(Symbols(I) + C_Symbols_String_Array(I) := To_C(To_String(Dum_Text(I) & Character'val(0) - & (Max_Legend_Label_Length - Length(Symbols(I))) * " "), False); + & (Max_Legend_Label_Length - Length(Dum_Text(I))) * " "), False); -- Set the I-th pointer in the array of pointers. PL_Symbols(I) := C_Symbols_String_Array(I)'Address; Modified: trunk/bindings/ada/plplot_traditional.ads =================================================================== --- trunk/bindings/ada/plplot_traditional.ads 2011-03-27 17:57:51 UTC (rev 11680) +++ trunk/bindings/ada/plplot_traditional.ads 2011-03-29 09:30:43 UTC (rev 11681) @@ -1170,7 +1170,7 @@ Text_Offset, Text_Scale, Text_Spacing : Long_Float; Text_Justification : Long_Float; Text_Colors : Integer_Array_1D; - Label_Text : in out Legend_String_Array_Type; + Label_Text : Legend_String_Array_Type; Box_Colors, Box_Patterns : Integer_Array_1D; Box_Scales : Real_Vector; Box_Line_Widths : Integer_Array_1D; @@ -1178,7 +1178,7 @@ Symbol_Colors : Integer_Array_1D; Symbol_Scales : Real_Vector; Symbol_Numbers : Integer_Array_1D; - Symbols : in out Legend_String_Array_Type); + Symbols : Legend_String_Array_Type); -- Sets position of the light source Modified: trunk/examples/ada/x04a.adb =================================================================== --- trunk/examples/ada/x04a.adb 2011-03-27 17:57:51 UTC (rev 11680) +++ trunk/examples/ada/x04a.adb 2011-03-29 09:30:43 UTC (rev 11681) @@ -114,6 +114,7 @@ symbol_scales(0) := 1.0; -- Don't care; not used. symbol_numbers(0) := 4; -- Don't care; not used. symbols(0) := To_Unbounded_String("*"); -- Don't care; not used. + -- Second legend entry. opt_array(1) := Legend_Line + Legend_Symbol; text_colors(1) := 3; Modified: trunk/examples/ada/x26a.adb =================================================================== --- trunk/examples/ada/x26a.adb 2011-03-27 17:57:51 UTC (rev 11680) +++ trunk/examples/ada/x26a.adb 2011-03-29 09:30:43 UTC (rev 11681) @@ -2,7 +2,7 @@ -- Multi-lingual version of the first page of example 4. --- Copyright (C) 2008 Jerry Bauck +-- Copyright (C) 2008 - 2011 Jerry Bauck -- This file is part of PLplot. @@ -55,26 +55,31 @@ -- http://en.wikipedia.org/wiki/Decade_(log_scale) . with + Ada.Strings.Unbounded, Ada.Numerics, Ada.Numerics.Long_Elementary_Functions, PLplot_Auxiliary, PLplot_Traditional; use + Ada.Strings.Unbounded, Ada.Numerics, Ada.Numerics.Long_Elementary_Functions, PLplot_Auxiliary, PLplot_Traditional; - - procedure x26a is - function x_label(which : Integer) return String is - begin - if which = 0 then return "Frequency"; end if; - if which = 1 then return "Частота"; end if; - return "oops"; - end x_label; + -- Here we show two ways of passing strings for plot1... + -- ...a function... + --function x_label(which : Integer) return String is + --begin + -- if which = 0 then return "Frequency"; end if; + -- if which = 1 then return "Частота"; end if; + -- return "oops"; + --end x_label; + -- ...or an array of unbounded strings. + -- (TUB renames Ada.Strings.Unbounded.To_Unbounded_String in plplot_traditional.ads.) + x_label : array(0 .. 1) of Unbounded_String := (TUB("Frequency"), TUB("Частота")); function y_label(which : Integer) return String is @@ -93,6 +98,13 @@ end alty_label; + -- Short rearranged versions of y_label and alty_label. + -- (TUB renames Ada.Strings.Unbounded.To_Unbounded_String in plplot_traditional.ads.) + Legend_0 : Legend_String_Array_Type(0..1) := (TUB("Amplitude"), TUB("Phase shift")); + Legend_1 : Legend_String_Array_Type(0..1) := (TUB("Амплитуда"), TUB("Фазовый сдвиг")); + Legend_text : array(0 .. 1) of Legend_String_Array_Type(0..1) := (Legend_0, Legend_1); + + function title_label(which : Integer) return String is begin if which = 0 then return "Single Pole Low-Pass Filter"; end if; @@ -110,10 +122,22 @@ procedure plot1 - (x_label, y_label, alty_label, title_label, line_label : String) + (x_label, y_label, alty_label : String; + L_Text : Legend_String_Array_Type; + title_label, line_label : String) is freql, ampl, phase : Real_Vector(0 .. 100); f0, freq : Long_Float; + opt_array : Integer_Array_1D(0 .. 1); + text_colors, line_colors, line_styles, line_widths : Integer_Array_1D(0..1); + symbol_numbers, symbol_colors : Integer_Array_1D(0 .. 1); + symbol_scales : Real_Vector(0 .. 1); + symbols : Legend_String_Array_Type(0 .. 1); + legend_width, legend_height : Long_Float; + -- Dummy arrays for unused entities. C uses null arguments but we can't. + Box_Colors, Box_Patterns, Box_Line_Widths : Integer_Array_1D(0 .. 1) + := (others => 0); + Box_Scales : Real_Vector(0 .. 1):= (others => 1.0); begin pladv(0); f0 := 1.0; @@ -135,7 +159,7 @@ -- Plot ampl vs freq plcol0(2); plline(freql, ampl); - plcol0(1); + plcol0(2); plptex(1.6, -30.0, 1.0, -20.0, 0.5, line_label); -- Put labels on @@ -151,10 +175,46 @@ plbox("", 0.0, 0, "cmstv", 30.0, 3); plcol0(3); plline(freql, phase); + plstring(freql, phase, "*"); plcol0(3); plmtex("r", 5.0, 0.5, 0.5, alty_label); + + -- Draw a legend + -- First legend entry. + opt_array(0) := Legend_Line; + text_colors(0) := 2; + line_colors(0) := 2; + line_styles(0) := 1; + line_widths(0) := 1; + symbol_colors(0) := 3; -- Don't care; not used. + symbol_scales(0) := 1.0; -- Don't care; not used. + symbol_numbers(0) := 4; -- Don't care; not used. + symbols(0) := To_Unbounded_String("*"); -- Don't care; not used. + + -- Second legend entry. + opt_array(1) := Legend_Line + Legend_Symbol; + text_colors(1) := 3; + line_colors(1) := 3; + line_styles(1) := 1; + line_widths(1) := 1; + symbol_colors(1) := 3; + symbol_scales(1) := 1.0; + symbol_numbers(1) := 4; + symbols(1) := To_Unbounded_String("*"); + + plscol0a(15, 32, 32, 32, 0.70); + pllegend(legend_width, legend_height, + 0, Legend_Background + Legend_Bounding_Box, + 0.0, 0.0, 0.1, 15, + 1, 1, 0, 0, + opt_array, + 1.0, 1.0, 2.0, + 1.0, text_colors, L_Text, + Box_Colors, Box_Patterns, + Box_Scales, Box_Line_Widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols); end plot1; - begin -- Parse and process command line arguments */ plparseopts(PL_PARSE_FULL); @@ -165,7 +225,8 @@ -- Make log plots using two different styles. for i in 0 .. 1 loop - plot1(x_label(i), y_label(i), alty_label(i), title_label(i), line_label(i)); + plot1(To_String(x_label(i)), y_label(i), alty_label(i), legend_text(i), + title_label(i), line_label(i)); end loop; plend; Modified: trunk/examples/ada/x27a.adb =================================================================== --- trunk/examples/ada/x27a.adb 2011-03-27 17:57:51 UTC (rev 11680) +++ trunk/examples/ada/x27a.adb 2011-03-29 09:30:43 UTC (rev 11681) @@ -21,16 +21,16 @@ -- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA with + Ada.Numerics, Ada.Numerics.Long_Elementary_Functions, PLplot_Auxiliary, PLplot_Traditional; use + Ada.Numerics, Ada.Numerics.Long_Elementary_Functions, PLplot_Auxiliary, PLplot_Traditional; - - ------------------------------------------------------------------------------ -- Generates two kinds of plots: -- - construction of a cycloid (animated) @@ -39,6 +39,10 @@ procedure x27a is -- R, r, p, N + -- R and r should be integers to give correct termination of the + -- angle loop using gcd. + -- N.B. N is just a place holder since it is no longer used + -- (because we now have proper termination of the angle loop). params : Real_Matrix(0 .. 8, 0 .. 3) := ((21.0, 7.0, 7.0, 3.0), (21.0, 7.0, 10.0, 3.0), @@ -49,10 +53,23 @@ (20.0, 13.0, 7.0, 20.0), (20.0, 13.0, 20.0, 20.0), (20.0,-13.0, 20.0, 20.0)); + + fill : Boolean; - procedure spiro(params : Real_Matrix; row : Integer) is - NPNT : constant Integer := 20000; - xcoord, ycoord : Real_Vector(0 .. 20000); + -- To understand why spiro is written this way you need to understand the + -- C code from which this was derived. In the main C program, params + -- is a two-dimensional array with 9 rows numbered 0 .. 8 and 4 columns + -- numbered 0 .. 3. When spiro is called, it is passed the _address_ of the + -- element of params's ith row, 0th column--nothing else. Then, inside spiro, + -- the corresponding entity (also called params!) appears as a + -- _one-dimensional_ array whose 0th element shares the same address as what + -- was passed from the main program. So memory locations starting there, + -- and numbered from 0, represent the 1D array equivalent to the ith row of + -- params in the main program. Wilma, call Barney--we're programming a + -- micaprocessor here. + procedure spiro(params : Real_Matrix; row : Integer; fill : Boolean) is + NPNT : constant Integer := 2000; + xcoord, ycoord : Real_Vector(0 .. NPNT); windings : Integer; steps : Integer; phi : Long_Float; @@ -60,55 +77,78 @@ dphi : Long_Float; xmin : Long_Float; xmax : Long_Float; + xrange_adjust : Long_Float; ymin : Long_Float; ymax : Long_Float; - scale : Long_Float; - begin - -- Fill the coordinates - windings := Integer(params(row, 3)); - steps := NPNT / windings; - dphi := 8.0 * arccos(-1.0) / Long_Float(steps); + yrange_adjust : Long_Float; - xmin := 0.0; -- This initialisation is safe! - xmax := 0.0; - ymin := 0.0; - ymax := 0.0; + function Trunc(a : Long_Float) return Integer renames PLplot_Auxiliary.Trunc; + -- Calculate greatest common divisor following pseudo-code for the + -- Euclidian algorithm at http://en.wikipedia.org/wiki/Euclidean_algorithm + function gcd(a, b : Integer) return Integer is + t : Integer; + aa : Integer := a; + bb : Integer := b; + begin + aa := abs(aa); + bb := abs(bb); + while bb /= 0 loop + t := bb; + bb := aa mod bb; + aa := t; + end loop; + return aa; + end gcd; + + begin -- spiro + -- Fill the coordinates. + -- Proper termination of the angle loop very near the beginning + -- point, see http://mathforum.org/mathimages/index.php/Hypotrochoid + windings := Trunc(abs(params(row, 1)) / + Long_Float(gcd(Trunc(params(row, 0)), Trunc(params(row, 1))))); + steps := NPNT / windings; + dphi := 2.0 * pi / Long_Float(steps); for i in 0 .. windings * steps loop phi := Long_Float(i) * dphi; phiw := (params(row, 0) - params(row, 1)) / params(row, 1) * phi; - xcoord(i) := (params(row, 0) - params(row, 1)) * cos(phi) + params(row, 2) * cos(phiw); - ycoord(i) := (params(row, 0) - params(row, 1)) * sin(phi) - params(row, 2) * sin(phiw); - + xcoord(i) := (params(row, 0)-params(row, 1))*cos(phi)+params(row, 2)*cos(phiw); + ycoord(i) := (params(row, 0)-params(row, 1))*sin(phi)-params(row, 2)*sin(phiw); + if i = 0 then + xmin := xcoord(i); + xmax := xcoord(i); + ymin := ycoord(i); + ymax := ycoord(i); + end if; if xmin > xcoord(i) then xmin := xcoord(i); end if; if xmax < xcoord(i) then xmax := xcoord(i); end if; if ymin > ycoord(i) then ymin := ycoord(i); end if; if ymax < ycoord(i) then ymax := ycoord(i); end if; end loop; - if xmax - xmin > ymax - ymin then - scale := xmax - xmin; - else - scale := ymax - ymin; - end if; + xrange_adjust := 0.15 * (xmax - xmin); + xmin := xmin - xrange_adjust; + xmax := xmax + xrange_adjust; + yrange_adjust := 0.15 * (ymax - ymin); + ymin := ymin - yrange_adjust; + ymax := ymax + yrange_adjust; - xmin := - 0.65 * scale; - xmax := 0.65 * scale; - ymin := - 0.65 * scale; - ymax := 0.65 * scale; - plwind(xmin, xmax, ymin, ymax); plcol0(1); + declare xcoord_local, ycoord_local : Real_Vector(0 .. steps * windings); begin xcoord_local := xcoord(0 .. steps * windings); ycoord_local := ycoord(0 .. steps * windings); - plline(xcoord_local, ycoord_local); + if fill then + plfill(xcoord_local, ycoord_local); + else + plline(xcoord_local, ycoord_local); + end if; end; end spiro; - procedure cycloid is begin null; -- TODO @@ -128,19 +168,31 @@ -- First an overview, then all curves one by one plssub(3, 3) ; -- Three by three window + -- Overview + fill := False; for i in params'range(1) loop pladv(0); - plvpor( 0.0, 1.0, 0.0, 1.0 ); - spiro(params, i); + plvpor(0.0, 1.0, 0.0, 1.0); + spiro(params, i, fill); end loop; + -- Don't fill the curves. pladv(0) ; plssub(1, 1) ; -- One window per curve + for i in params'range(1) loop + pladv(0) ; + plvpor(0.0, 1.0, 0.0, 1.0); + spiro(params, i, fill); + end loop; + -- Fill the curves + fill := True; + pladv(0); + plssub(1, 1); -- One window per curve for i in params'range(1) loop pladv(0) ; - plvpor( 0.0, 1.0, 0.0, 1.0 ) ; - spiro(params, i); + plvpor(0.0, 1.0, 0.0, 1.0); + spiro(params, i, fill); end loop; -- Don't forget to call plend to finish off! Modified: trunk/examples/ada/xthick04a.adb =================================================================== --- trunk/examples/ada/xthick04a.adb 2011-03-27 17:57:51 UTC (rev 11680) +++ trunk/examples/ada/xthick04a.adb 2011-03-29 09:30:43 UTC (rev 11681) @@ -114,6 +114,7 @@ symbol_scales(0) := 1.0; -- Don't care; not used. symbol_numbers(0) := 4; -- Don't care; not used. symbols(0) := To_Unbounded_String("*"); -- Don't care; not used. + -- Second legend entry. opt_array(1) := Legend_Line + Legend_Symbol; text_colors(1) := Green; Modified: trunk/examples/ada/xthick26a.adb =================================================================== --- trunk/examples/ada/xthick26a.adb 2011-03-27 17:57:51 UTC (rev 11680) +++ trunk/examples/ada/xthick26a.adb 2011-03-29 09:30:43 UTC (rev 11681) @@ -55,26 +55,31 @@ -- http://en.wikipedia.org/wiki/Decade_(log_scale) . with + Ada.Strings.Unbounded, Ada.Numerics, Ada.Numerics.Long_Elementary_Functions, PLplot_Auxiliary, PLplot; use + Ada.Strings.Unbounded, Ada.Numerics, Ada.Numerics.Long_Elementary_Functions, PLplot_Auxiliary, PLplot; - - procedure xthick26a is - function x_label(which : Integer) return String is - begin - if which = 0 then return "Frequency"; end if; - if which = 1 then return "Частота"; end if; - return "oops"; - end x_label; + -- Here we show two ways of passing strings for plot1... + -- ...a function... + --function x_label(which : Integer) return String is + --begin + -- if which = 0 then return "Frequency"; end if; + -- if which = 1 then return "Частота"; end if; + -- return "oops"; + --end x_label; + -- ...or an array of unbounded strings. + -- (TUB renames Ada.Strings.Unbounded.To_Unbounded_String in plplot_traditional.ads.) + x_label : array(0 .. 1) of Unbounded_String := (TUB("Frequency"), TUB("Частота")); function y_label(which : Integer) return String is @@ -93,6 +98,13 @@ end alty_label; + -- Short rearranged versions of y_label and alty_label. + -- (TUB renames Ada.Strings.Unbounded.To_Unbounded_String in plplot_traditional.ads.) + Legend_0 : Legend_String_Array_Type(0..1) := (TUB("Amplitude"), TUB("Phase shift")); + Legend_1 : Legend_String_Array_Type(0..1) := (TUB("Амплитуда"), TUB("Фазовый сдвиг")); + Legend_text : array(0 .. 1) of Legend_String_Array_Type(0..1) := (Legend_0, Legend_1); + + function title_label(which : Integer) return String is begin if which = 0 then return "Single Pole Low-Pass Filter"; end if; @@ -110,10 +122,22 @@ procedure plot1 - (x_label, y_label, alty_label, title_label, line_label : String) + (x_label, y_label, alty_label : String; + L_Text : Legend_String_Array_Type; + title_label, line_label : String) is freql, ampl, phase : Real_Vector(0 .. 100); f0, freq : Long_Float; + opt_array : Integer_Array_1D(0 .. 1); + text_colors, line_colors, line_styles, line_widths : Integer_Array_1D(0..1); + symbol_numbers, symbol_colors : Integer_Array_1D(0 .. 1); + symbol_scales : Real_Vector(0 .. 1); + symbols : Legend_String_Array_Type(0 .. 1); + legend_width, legend_height : Long_Float; + -- Dummy arrays for unused entities. C uses null arguments but we can't. + Box_Colors, Box_Patterns, Box_Line_Widths : Integer_Array_1D(0 .. 1) + := (others => 0); + Box_Scales : Real_Vector(0 .. 1):= (others => 1.0); begin Advance_To_Subpage(Next_Subpage); f0 := 1.0; @@ -135,7 +159,7 @@ -- Plot ampl vs freq Set_Pen_Color(Yellow); Draw_Curve(freql, ampl); - Set_Pen_Color(Red); + Set_Pen_Color(Yellow); Write_Text_World(1.6, -30.0, 1.0, -20.0, 0.5, line_label); -- Put labels on @@ -151,10 +175,46 @@ Box_Around_Viewport("", 0.0, 0, "cmstv", 30.0, 3); Set_Pen_Color(Green); Draw_Curve(freql, phase); + Draw_String(freql, phase, "*"); Set_Pen_Color(Green); Write_Text_Viewport("r", 5.0, 0.5, 0.5, alty_label); + + -- Draw a legend + -- First legend entry. + opt_array(0) := Legend_Line; + text_colors(0) := 2; + line_colors(0) := 2; + line_styles(0) := 1; + line_widths(0) := 1; + symbol_colors(0) := 3; -- Don't care; not used. + symbol_scales(0) := 1.0; -- Don't care; not used. + symbol_numbers(0) := 4; -- Don't care; not used. + symbols(0) := To_Unbounded_String("*"); -- Don't care; not used. + + -- Second legend entry. + opt_array(1) := Legend_Line + Legend_Symbol; + text_colors(1) := 3; + line_colors(1) := 3; + line_styles(1) := 1; + line_widths(1) := 1; + symbol_colors(1) := 3; + symbol_scales(1) := 1.0; + symbol_numbers(1) := 4; + symbols(1) := To_Unbounded_String("*"); + + Set_One_Color_Map_0_And_Alpha(15, 32, 32, 32, 0.70); + Create_Legend(legend_width, legend_height, + 0, Legend_Background + Legend_Bounding_Box, + 0.0, 0.0, 0.1, 15, + 1, 1, 0, 0, + opt_array, + 1.0, 1.0, 2.0, + 1.0, text_colors, L_Text, + Box_Colors, Box_Patterns, + Box_Scales, Box_Line_Widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols); end plot1; - begin -- Parse and process command line arguments */ Parse_Command_Line_Arguments(Parse_Full); @@ -165,7 +225,8 @@ -- Make log plots using two different styles. for i in 0 .. 1 loop - plot1(x_label(i), y_label(i), alty_label(i), title_label(i), line_label(i)); + plot1(To_String(x_label(i)), y_label(i), alty_label(i), legend_text(i), + title_label(i), line_label(i)); end loop; End_PLplot; Modified: trunk/examples/ada/xthick27a.adb =================================================================== --- trunk/examples/ada/xthick27a.adb 2011-03-27 17:57:51 UTC (rev 11680) +++ trunk/examples/ada/xthick27a.adb 2011-03-29 09:30:43 UTC (rev 11681) @@ -21,16 +21,16 @@ -- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA with + Ada.Numerics, Ada.Numerics.Long_Elementary_Functions, PLplot_Auxiliary, PLplot; use + Ada.Numerics, Ada.Numerics.Long_Elementary_Functions, PLplot_Auxiliary, PLplot; - - ------------------------------------------------------------------------------ -- Generates two kinds of plots: -- - construction of a cycloid (animated) @@ -39,6 +39,10 @@ procedure xthick27a is -- R, r, p, N + -- R and r should be integers to give correct termination of the + -- angle loop using gcd. + -- N.B. N is just a place holder since it is no longer used + -- (because we now have proper termination of the angle loop). params : Real_Matrix(0 .. 8, 0 .. 3) := ((21.0, 7.0, 7.0, 3.0), (21.0, 7.0, 10.0, 3.0), @@ -50,9 +54,22 @@ (20.0, 13.0, 20.0, 20.0), (20.0,-13.0, 20.0, 20.0)); - procedure spiro(params : Real_Matrix; row : Integer) is - NPNT : constant Integer := 20000; - xcoord, ycoord : Real_Vector(0 .. 20000); + fill : Boolean; + + -- To understand why spiro is written this way you need to understand the + -- C code from which this was derived. In the main C program, params + -- is a two-dimensional array with 9 rows numbered 0 .. 8 and 4 columns + -- numbered 0 .. 3. When spiro is called, it is passed the _address_ of the + -- element of params's ith row, 0th column--nothing else. Then, inside spiro, + -- the corresponding entity (also called params!) appears as a + -- _one-dimensional_ array whose 0th element shares the same address as what + -- was passed from the main program. So memory locations starting there, + -- and numbered from 0, represent the 1D array equivalent to the ith row of + -- params in the main program. Wilma, call Barney--we're programming a + -- micaprocessor here. + procedure spiro(params : Real_Matrix; row : Integer; fill : Boolean) is + NPNT : constant Integer := 2000; + xcoord, ycoord : Real_Vector(0 .. NPNT); windings : Integer; steps : Integer; phi : Long_Float; @@ -60,55 +77,78 @@ dphi : Long_Float; xmin : Long_Float; xmax : Long_Float; + xrange_adjust : Long_Float; ymin : Long_Float; ymax : Long_Float; - scale : Long_Float; + yrange_adjust : Long_Float; + + function Trunc(a : Long_Float) return Integer renames PLplot_Auxiliary.Trunc; + + -- Calculate greatest common divisor following pseudo-code for the + -- Euclidian algorithm at http://en.wikipedia.org/wiki/Euclidean_algorithm + function gcd(a, b : Integer) return Integer is + t : Integer; + aa : Integer := a; + bb : Integer := b; begin - -- Fill the coordinates - windings := Integer(params(row, 3)); + aa := abs(aa); + bb := abs(bb); + while bb /= 0 loop + t := bb; + bb := aa mod bb; + aa := t; + end loop; + return aa; + end gcd; + + begin -- spiro + -- Fill the coordinates. + -- Proper termination of the angle loop very near the beginning + -- point, see http://mathforum.org/mathimages/index.php/Hypotrochoid + windings := Trunc(abs(params(row, 1)) / + Long_Float(gcd(Trunc(params(row, 0)), Trunc(params(row, 1))))); steps := NPNT / windings; - dphi := 8.0 * arccos(-1.0) / Long_Float(steps); - - xmin := 0.0; -- This initialisation is safe! - xmax := 0.0; - ymin := 0.0; - ymax := 0.0; - + dphi := 2.0 * pi / Long_Float(steps); for i in 0 .. windings * steps loop phi := Long_Float(i) * dphi; phiw := (params(row, 0) - params(row, 1)) / params(row, 1) * phi; xcoord(i) := (params(row, 0) - params(row, 1)) * cos(phi) + params(row, 2) * cos(phiw); ycoord(i) := (params(row, 0) - params(row, 1)) * sin(phi) - params(row, 2) * sin(phiw); - + if i = 0 then + xmin := xcoord(i); + xmax := xcoord(i); + ymin := ycoord(i); + ymax := ycoord(i); + end if; if xmin > xcoord(i) then xmin := xcoord(i); end if; if xmax < xcoord(i) then xmax := xcoord(i); end if; if ymin > ycoord(i) then ymin := ycoord(i); end if; if ymax < ycoord(i) then ymax := ycoord(i); end if; end loop; - if xmax - xmin > ymax - ymin then - scale := xmax - xmin; - else - scale := ymax - ymin; - end if; + xrange_adjust := 0.15 * (xmax - xmin); + xmin := xmin - xrange_adjust; + xmax := xmax + xrange_adjust; + yrange_adjust := 0.15 * (ymax - ymin); + ymin := ymin - yrange_adjust; + ymax := ymax + yrange_adjust; - xmin := - 0.65 * scale; - xmax := 0.65 * scale; - ymin := - 0.65 * scale; - ymax := 0.65 * scale; - Set_Viewport_World(xmin, xmax, ymin, ymax); Set_Pen_Color(Red); + declare xcoord_local, ycoord_local : Real_Vector(0 .. steps * windings); begin xcoord_local := xcoord(0 .. steps * windings); ycoord_local := ycoord(0 .. steps * windings); - Draw_Curve(xcoord_local, ycoord_local); + if fill then + Fill_Polygon(xcoord_local, ycoord_local); + else + Draw_Curve(xcoord_local, ycoord_local); + end if; end; end spiro; - procedure cycloid is begin null; -- TODO @@ -128,19 +168,31 @@ -- First an overview, then all curves one by one Set_Number_Of_Subpages(3, 3) ; -- Three by three window + -- Overview + fill := False; for i in params'range(1) loop Advance_To_Subpage(Next_Subpage); - Set_Viewport_Normalized( 0.0, 1.0, 0.0, 1.0 ); - spiro(params, i); + Set_Viewport_Normalized( 0.0, 1.0, 0.0, 1.0); + spiro(params, i, fill); end loop; - Advance_To_Subpage(Next_Subpage) ; + -- Don't fill the curves. + Advance_To_Subpage(Next_Subpage); Set_Number_Of_Subpages(1, 1) ; -- One window per curve + for i in params'range(1) loop + Advance_To_Subpage(Next_Subpage); + Set_Viewport_Normalized(0.0, 1.0, 0.0, 1.0); + spiro(params, i, fill); + end loop; + -- Fill the curves + fill := True; + Advance_To_Subpage(Next_Subpage); + Set_Number_Of_Subpages(1, 1); -- One window per curve for i in params'range(1) loop Advance_To_Subpage(Next_Subpage) ; Set_Viewport_Normalized( 0.0, 1.0, 0.0, 1.0 ) ; - spiro(params, i); + spiro(params, i, fill); end loop; -- Don't forget to call End_PLplot to finish off! This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-03-31 03:51:33
|
Revision: 11683 http://plplot.svn.sourceforge.net/plplot/?rev=11683&view=rev Author: airwin Date: 2011-03-31 03:51:26 +0000 (Thu, 31 Mar 2011) Log Message: ----------- Minor commentary style tweaks due to one more iteration of scripts/style_source.sh Modified Paths: -------------- trunk/bindings/java/PLStream.java trunk/examples/java/x33.java Modified: trunk/bindings/java/PLStream.java =================================================================== --- trunk/bindings/java/PLStream.java 2011-03-31 02:55:49 UTC (rev 11682) +++ trunk/bindings/java/PLStream.java 2011-03-31 03:51:26 UTC (rev 11683) @@ -564,7 +564,7 @@ // plplotjavac.plcolorbar( opt, x, y, length, width, ticks, subticks, // axis_opts, label, colors, values ); // } - // +// public void lightsource( double x, double y, double z ) { Modified: trunk/examples/java/x33.java =================================================================== --- trunk/examples/java/x33.java 2011-03-31 02:55:49 UTC (rev 11682) +++ trunk/examples/java/x33.java 2011-03-31 03:51:26 UTC (rev 11683) @@ -201,7 +201,7 @@ // pls.wind( 0.0, 1.0, 0.0, 1.0 ); // pls.ptex( 0.5, 0.5, 0.0, 0.0, 0.5, title ); // } - // +// //-------------------------------------------------------------------------- // x33 // @@ -845,7 +845,7 @@ // "Gradient Color Bars" ); // plcolorbar_example_2( PLStream.PL_COLORBAR_GRADIENT, 0.5, 5, 2, values_small, // "Gradient Color Bars" ); - // + // pls.end(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-03-31 04:15:41
|
Revision: 11684 http://plplot.svn.sourceforge.net/plplot/?rev=11684&view=rev Author: airwin Date: 2011-03-31 04:15:32 +0000 (Thu, 31 Mar 2011) Log Message: ----------- Move to the "//" style of commentary for D as well. This change brings our D commentary style into line with the commentary style of our C and C++ code. For a few of the D examples (e.g., x24d.d) I had to remove "\" escapes at the end of commentary lines in order to get scripts/convert_comment.py (called by scripts/style_source.sh) to convert the comments correctly. Modified Paths: -------------- trunk/bindings/d/plplot.d trunk/examples/d/x01d.d trunk/examples/d/x02d.d trunk/examples/d/x03d.d trunk/examples/d/x04d.d trunk/examples/d/x05d.d trunk/examples/d/x06d.d trunk/examples/d/x07d.d trunk/examples/d/x08d.d trunk/examples/d/x09d.d trunk/examples/d/x10d.d trunk/examples/d/x11d.d trunk/examples/d/x12d.d trunk/examples/d/x13d.d trunk/examples/d/x14d.d trunk/examples/d/x15d.d trunk/examples/d/x16d.d trunk/examples/d/x17d.d trunk/examples/d/x18d.d trunk/examples/d/x19d.d trunk/examples/d/x20d.d trunk/examples/d/x21d.d trunk/examples/d/x22d.d trunk/examples/d/x23d.d trunk/examples/d/x24d.d trunk/examples/d/x25d.d trunk/examples/d/x26d.d trunk/examples/d/x27d.d trunk/examples/d/x28d.d trunk/examples/d/x29d.d trunk/examples/d/x30d.d trunk/examples/d/x31d.d trunk/scripts/style_source.sh Modified: trunk/bindings/d/plplot.d =================================================================== --- trunk/bindings/d/plplot.d 2011-03-31 03:51:26 UTC (rev 11683) +++ trunk/bindings/d/plplot.d 2011-03-31 04:15:32 UTC (rev 11684) @@ -1,4 +1,4 @@ -/* Converted to D from plplot_d.h by htod */ +// Converted to D from plplot_d.h by htod module plplot; private import std.string; @@ -47,7 +47,7 @@ return c_a; } -/* Process options list using current options info. */ +// Process options list using current options info. int plparseopts( char[][] args, PLINT mode ) { char*[] c_args = new char*[args.length]; @@ -57,7 +57,7 @@ return c_plparseopts( &argc, cast(char**) c_args, mode ); } -/* simple arrow plotter. */ +// simple arrow plotter. void plvect( PLFLT[][] u, PLFLT[][] v, PLFLT scale, pltr_func pltr = null, PLPointer pltr_data = null ) { PLINT nx = u.length; @@ -120,15 +120,15 @@ c_plsvect( arrowx.ptr, arrowy.ptr, npts, fill ); } -/* This functions similarly to plbox() except that the origin of the axes */ -/* is placed at the user-specified point (x0, y0). */ +// This functions similarly to plbox() except that the origin of the axes +// is placed at the user-specified point (x0, y0). void plaxes( PLFLT x0, PLFLT y0, string xopt, PLFLT xtick, PLINT nxsub, string yopt, PLFLT ytick, PLINT nysub ) { c_plaxes( x0, y0, toStringz( xopt ), xtick, nxsub, toStringz( yopt ), ytick, nysub ); } -/* Plot a histogram using x to store data values and y to store frequencies */ +// Plot a histogram using x to store data values and y to store frequencies void plbin( PLFLT[] x, PLFLT[] y, PLINT opt ) { PLINT nbin = x.length; @@ -136,13 +136,13 @@ c_plbin( nbin, x.ptr, y.ptr, opt ); } -/* This draws a box around the current viewport. */ +// This draws a box around the current viewport. void plbox( string xopt, PLFLT xtick, PLINT nxsub, string yopt, PLFLT ytick, PLINT nysub ) { c_plbox( toStringz( xopt ), xtick, nxsub, toStringz( yopt ), ytick, nysub ); } -/* This is the 3-d analogue of plbox(). */ +// This is the 3-d analogue of plbox(). void plbox3( string xopt, string xlabel, PLFLT xtick, PLINT nsubx, string yopt, string ylabel, PLFLT ytick, PLINT nsuby, string zopt, string zlabel, PLFLT ztick, PLINT nsubz ) @@ -152,9 +152,9 @@ toStringz( zopt ), toStringz( zlabel ), ztick, nsubz ); } -/* Draws a contour plot from data in f(nx,ny). Is just a front-end to - * plfcont, with a particular choice for f2eval and f2eval_data. - */ +// Draws a contour plot from data in f(nx,ny). Is just a front-end to +// plfcont, with a particular choice for f2eval and f2eval_data. +// void plcont( PLFLT[][] f, PLINT kx, PLINT lx, PLINT ky, PLINT ly, PLFLT[] clevel, pltr_func pltr, PLPointer pltr_data = null ) { @@ -210,13 +210,13 @@ &pltr2, &c2 ); } -/* Draws a contour plot using the function evaluator f2eval and data stored - * by way of the f2eval_data pointer. This allows arbitrary organizations - * of 2d array data to be used. - */ +// Draws a contour plot using the function evaluator f2eval and data stored +// by way of the f2eval_data pointer. This allows arbitrary organizations +// of 2d array data to be used. +// //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); -/* Plot horizontal error bars (xmin(i),y(i)) to (xmax(i),y(i)) */ +// Plot horizontal error bars (xmin(i),y(i)) to (xmax(i),y(i)) void plerrx( PLFLT[] xmin, PLFLT[] xmax, PLFLT[] y ) { PLINT n = y.length; @@ -225,7 +225,7 @@ c_plerrx( n, xmin.ptr, xmax.ptr, y.ptr ); } -/* Plot vertical error bars (x,ymin(i)) to (x(i),ymax(i)) */ +// Plot vertical error bars (x,ymin(i)) to (x(i),ymax(i)) void plerry( PLFLT[] x, PLFLT[] ymin, PLFLT[] ymax ) { PLINT n = x.length; @@ -234,7 +234,7 @@ c_plerry( n, x.ptr, ymin.ptr, ymax.ptr ); } -/* Pattern fills the polygon bounded by the input points. */ +// Pattern fills the polygon bounded by the input points. void plfill( PLFLT[] x, PLFLT[] y ) { PLINT n = x.length; @@ -242,7 +242,7 @@ c_plfill( n, x.ptr, y.ptr ); } -/* Pattern fills the 3d polygon bounded by the input points. */ +// Pattern fills the 3d polygon bounded by the input points. void plfill3( PLFLT[] x, PLFLT[] y, PLFLT[] z ) { PLINT n = x.length; @@ -251,7 +251,7 @@ c_plfill3( n, x.ptr, y.ptr, z.ptr ); } -/* Get the current device (keyword) name */ +// Get the current device (keyword) name void plgdev( out string p_dev ) { p_dev.length = 1024; @@ -259,7 +259,7 @@ p_dev = toString( p_dev.ptr ); } -/* Get the (current) output file name. Must be preallocated to >80 bytes */ +// Get the (current) output file name. Must be preallocated to >80 bytes void plgfnam( out string fnam ) { fnam.length = 1024; @@ -267,7 +267,7 @@ fnam = toString( fnam.ptr ); } -/* Draw gradient in polygon. */ +// Draw gradient in polygon. void plgradient( PLFLT[] x, PLFLT[] y, PLFLT angle ) { PLINT n = x.length; @@ -275,7 +275,7 @@ c_plgradient( n, x.ptr, y.ptr, angle ); } -/* grid irregularly sampled data */ +// grid irregularly sampled data void plgriddata( PLFLT[] x, PLFLT[] y, PLFLT[] z, PLFLT[] xg, PLFLT[] yg, PLFLT[][] zg, PLINT type, PLFLT data ) { PLINT npts = x.length; @@ -290,7 +290,7 @@ c_plgriddata( x.ptr, y.ptr, z.ptr, npts, xg.ptr, nxg, yg.ptr, nyg, convert_array( zg ), type, data ); } -/* Get the current library version number */ +// Get the current library version number void plgver( out string p_ver ) { p_ver.length = 1024; @@ -298,13 +298,13 @@ p_ver = toString( p_ver.ptr ); } -/* Draws a histogram of n values of a variable in array data[0..n-1] */ +// Draws a histogram of n values of a variable in array data[0..n-1] void plhist( PLFLT[] data, PLFLT datmin, PLFLT datmax, PLINT nbin, PLINT opt ) { c_plhist( data.length, data.ptr, datmin, datmax, nbin, opt ); } -/* Simple routine for labelling graphs. */ +// Simple routine for labelling graphs. void pllab( string xlabel, string ylabel, string tlabel ) { c_pllab( toStringz( xlabel ), toStringz( ylabel ), toStringz( tlabel ) ); @@ -364,7 +364,7 @@ symbol_numbers.ptr, symbolsz.ptr ); } -/* Draws line segments connecting a series of points. */ +// Draws line segments connecting a series of points. void plline( PLFLT[] x, PLFLT[] y ) { PLINT n = x.length; @@ -372,7 +372,7 @@ c_plline( n, x.ptr, y.ptr ); } -/* Draws a line in 3 space. */ +// Draws a line in 3 space. void plline3( PLFLT[] x, PLFLT[] y, PLFLT[] z ) { PLINT n = x.length; @@ -381,14 +381,14 @@ c_plline3( n, x.ptr, y.ptr, z.ptr ); } -/* plot continental outline in world coordinates */ +// plot continental outline in world coordinates void plmap( mapform_func mapform, string type, PLFLT minlong, PLFLT maxlong, PLFLT minlat, PLFLT maxlat ) { c_plmap( mapform, toStringz( type ), minlong, maxlong, minlat, maxlat ); } -/* Plots a mesh representation of the function z[x][y]. */ +// Plots a mesh representation of the function z[x][y]. void plmesh( PLFLT[] x, PLFLT[] y, PLFLT[][] z, PLINT opt ) { PLINT nx = z.length; @@ -400,7 +400,7 @@ c_plmesh( x.ptr, y.ptr, convert_array( z ), nx, ny, opt ); } -/* Plots a mesh representation of the function z[x][y] with contour */ +// Plots a mesh representation of the function z[x][y] with contour void plmeshc( PLFLT[] x, PLFLT[] y, PLFLT[][] z, PLINT opt, PLFLT[] clevel ) { PLINT nx = z.length; @@ -412,19 +412,19 @@ c_plmeshc( x.ptr, y.ptr, convert_array( z ), nx, ny, opt, clevel.ptr, clevel.length ); } -/* Prints out "text" at specified position relative to viewport */ +// Prints out "text" at specified position relative to viewport void plmtex( string side, PLFLT disp, PLFLT pos, PLFLT just, string text ) { c_plmtex( toStringz( side ), disp, pos, just, toStringz( text ) ); } -/* Prints out "text" at specified position relative to viewport (3D)*/ +// Prints out "text" at specified position relative to viewport (3D) void plmtex3( string side, PLFLT disp, PLFLT pos, PLFLT just, string text ) { c_plmtex3( toStringz( side ), disp, pos, just, toStringz( text ) ); } -/* Plots a 3-d representation of the function z[x][y]. */ +// Plots a 3-d representation of the function z[x][y]. void plot3d( PLFLT[] x, PLFLT[] y, PLFLT[][] z, PLINT opt, PLBOOL side ) { PLINT nx = z.length; @@ -436,7 +436,7 @@ c_plot3d( x.ptr, y.ptr, convert_array( z ), nx, ny, opt, side ); } -/* Plots a 3-d representation of the function z[x][y] with contour. */ +// Plots a 3-d representation of the function z[x][y] with contour. void plot3dc( PLFLT[] x, PLFLT[] y, PLFLT[][] z, PLINT opt, PLFLT[] clevel ) { PLINT nx = z.length; @@ -448,8 +448,8 @@ c_plot3dc( x.ptr, y.ptr, convert_array( z ), nx, ny, opt, clevel.ptr, clevel.length ); } -/* Plots a 3-d representation of the function z[x][y] with contour and - * y index limits. */ +// Plots a 3-d representation of the function z[x][y] with contour and +// y index limits. void plot3dcl( PLFLT[] x, PLFLT[] y, PLFLT[][] z, PLINT opt, PLFLT[] clevel, PLINT ixstart, PLINT ixn, PLINT[] indexymin, PLINT[] indexymax ) { @@ -463,7 +463,7 @@ ixstart, ixn, indexymin.ptr, indexymax.ptr ); } -/* Set fill pattern directly. */ +// Set fill pattern directly. void plpat( PLINT[] inc, PLINT[] del ) { PLINT nlin = inc.length; @@ -471,7 +471,7 @@ c_plpat( nlin, inc.ptr, del.ptr ); } -/* Plots array y against x for n points using ASCII code "code".*/ +// Plots array y against x for n points using ASCII code "code". void plpoin( PLFLT[] x, PLFLT[] y, PLINT code ) { PLINT n = x.length; @@ -479,7 +479,7 @@ c_plpoin( n, x.ptr, y.ptr, code ); } -/* Draws a series of points in 3 space. */ +// Draws a series of points in 3 space. void plpoin3( PLFLT[] x, PLFLT[] y, PLFLT[] z, PLINT code ) { PLINT n = x.length; @@ -488,7 +488,7 @@ c_plpoin3( n, x.ptr, y.ptr, z.ptr, code ); } -/* Plots array y against x for n points using (UTF-8) text string*/ +// Plots array y against x for n points using (UTF-8) text string void plstring( PLFLT[] x, PLFLT[] y, string text ) { PLINT n = x.length; @@ -496,7 +496,7 @@ c_plstring( n, x.ptr, y.ptr, toStringz( text ) ); } -/* Draws a series of points (described by [UTF8] text string) in 3 space. */ +// Draws a series of points (described by [UTF8] text string) in 3 space. void plstring3( PLFLT[] x, PLFLT[] y, PLFLT[] z, string text ) { PLINT n = x.length; @@ -505,7 +505,7 @@ c_plstring3( n, x.ptr, y.ptr, z.ptr, toStringz( text ) ); } -/* Draws a polygon in 3 space. */ +// Draws a polygon in 3 space. void plpoly3( PLFLT[] x, PLFLT[] y, PLFLT[] z, PLBOOL[] draw, PLBOOL ifcc ) { PLINT n = x.length; @@ -515,32 +515,32 @@ c_plpoly3( n, x.ptr, y.ptr, z.ptr, draw.ptr, ifcc ); } -/* Prints out "text" at world cooordinate (x,y). */ +// Prints out "text" at world cooordinate (x,y). void plptex( PLFLT x, PLFLT y, PLFLT dx, PLFLT dy, PLFLT just, string text ) { c_plptex( x, y, dx, dy, just, toStringz( text ) ); } -/* Prints out "text" at world cooordinate (x,y,z). */ +// Prints out "text" at world cooordinate (x,y,z). void plptex3( PLFLT wx, PLFLT wy, PLFLT wz, PLFLT dx, PLFLT dy, PLFLT dz, PLFLT sx, PLFLT sy, PLFLT sz, PLFLT just, string text ) { c_plptex3( wx, wy, wz, dx, dy, dz, sx, sy, sz, just, toStringz( text ) ); } -/* Set the colors for color table 0 from a cmap0 file */ +// Set the colors for color table 0 from a cmap0 file void plspal0( string filename ) { c_plspal0( toStringz( filename ) ); } -/* Set the colors for color table 1 from a cmap1 file */ +// Set the colors for color table 1 from a cmap1 file void plspal1( string filename, PLBOOL interpolate ) { c_plspal1( toStringz( filename ), interpolate ); } -/* Set color map 0 colors by 8 bit RGB values */ +// Set color map 0 colors by 8 bit RGB values void plscmap0( PLINT[] r, PLINT[] g, PLINT[] b ) { PLINT ncol0 = r.length; @@ -549,7 +549,7 @@ c_plscmap0( r.ptr, g.ptr, b.ptr, ncol0 ); } -/* Set color map 0 colors by 8 bit RGB values and alpha values */ +// Set color map 0 colors by 8 bit RGB values and alpha values void plscmap0a( PLINT[] r, PLINT[] g, PLINT[] b, PLFLT[] a ) { PLINT ncol0 = r.length; @@ -559,7 +559,7 @@ c_plscmap0a( r.ptr, g.ptr, b.ptr, a.ptr, ncol0 ); } -/* Set color map 1 colors by 8 bit RGB values */ +// Set color map 1 colors by 8 bit RGB values void plscmap1( PLINT[] r, PLINT[] g, PLINT[] b ) { PLINT ncol1 = r.length; @@ -568,7 +568,7 @@ c_plscmap1( r.ptr, g.ptr, b.ptr, ncol1 ); } -/* Set color map 1 colors by 8 bit RGB and alpha values */ +// Set color map 1 colors by 8 bit RGB and alpha values void plscmap1a( PLINT[] r, PLINT[] g, PLINT[] b, PLFLT[] a ) { PLINT ncol1 = r.length; @@ -578,8 +578,8 @@ c_plscmap1a( r.ptr, g.ptr, b.ptr, a.ptr, ncol1 ); } -/* 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. */ +// 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 = null ) { @@ -597,9 +597,9 @@ } -/* 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. */ -/* Will also linear interpolate alpha values. */ +// 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. +// Will also linear interpolate alpha values. void plscmap1la( PLBOOL itype, PLFLT[] intensity, PLFLT[] coord1, PLFLT[] coord2, PLFLT[] coord3, PLFLT[] a, PLBOOL[] rev = null ) { @@ -617,19 +617,19 @@ c_plscmap1la( itype, npts, intensity.ptr, coord1.ptr, coord2.ptr, coord3.ptr, a.ptr, null ); } -/* Set the device (keyword) name */ +// Set the device (keyword) name void plsdev( string devname ) { c_plsdev( toStringz( devname ) ); } -/* Set the output file name. */ +// Set the output file name. void plsfnam( string fnam ) { c_plsfnam( toStringz( fnam ) ); } -/* Shade region. */ +// Shade region. 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, @@ -702,13 +702,13 @@ fill_width, cont_color, cont_width, &c_plfill, rectangular, &pltr2, &c2 ); } -/* Initialize PLplot, passing the device name and windows/page settings. */ +// Initialize PLplot, passing the device name and windows/page settings. void plstart( string devname, PLINT nx, PLINT ny ) { c_plstart( toStringz( devname ), nx, ny ); } -/* Create 1d stripchart */ +// Create 1d stripchart void plstripc( PLINT* id, string xspec, string 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, string[] legline, @@ -729,7 +729,7 @@ toStringz( labx ), toStringz( laby ), toStringz( labtop ) ); } -/* plots a 2d image (or a matrix too large for plshade() ) */ +// plots a 2d image (or a matrix too large for plshade() ) void plimagefr( PLFLT[][] idata, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT zmin, PLFLT zmax, PLFLT valuemin, PLFLT valuemax, pltr_func pltr = null, PLPointer pltr_data = null ) @@ -741,7 +741,7 @@ valuemin, valuemax, pltr, pltr_data ); } -/* plots a 2d image (or a matrix too large for plshade() ) */ +// plots a 2d image (or a matrix too large for plshade() ) void plimagefr( PLFLT[][] idata, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT zmin, PLFLT zmax, PLFLT valuemin, PLFLT valuemax, PLcGrid cgrid ) { @@ -760,7 +760,7 @@ valuemin, valuemax, &pltr1, &c ); } -/* plots a 2d image (or a matrix too large for plshade() ) */ +// plots a 2d image (or a matrix too large for plshade() ) void plimagefr( PLFLT[][] idata, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT zmin, PLFLT zmax, PLFLT valuemin, PLFLT valuemax, PLcGrid2 cgrid2 ) { @@ -788,8 +788,8 @@ valuemin, valuemax, &pltr2, &c2 ); } -/* plots a 2d image (or a matrix too large for plshade() ) - colors - * automatically scaled */ +// plots a 2d image (or a matrix too large for plshade() ) - colors +// automatically scaled void plimage( PLFLT[][] idata, PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT zmin, PLFLT zmax, PLFLT Dxmin, PLFLT Dxmax, PLFLT Dymin, PLFLT Dymax ) { @@ -800,7 +800,7 @@ Dymin, Dymax ); } -/* Set up a new line style */ +// Set up a new line style void plstyl( PLINT[] mark, PLINT[] space ) { PLINT nms = mark.length; @@ -808,7 +808,7 @@ c_plstyl( nms, mark.ptr, space.ptr ); } -/* Plots the 3d surface representation of the function z[x][y]. */ +// Plots the 3d surface representation of the function z[x][y]. void plsurf3d( PLFLT[] x, PLFLT[] y, PLFLT[][] z, PLINT opt, PLFLT[] clevel = null ) { PLINT nx = z.length; @@ -822,8 +822,8 @@ c_plsurf3d( x.ptr, y.ptr, convert_array( z ), nx, ny, opt, null, 0 ); } -/* Plots the 3d surface representation of the function z[x][y] with y - * index limits. */ +// Plots the 3d surface representation of the function z[x][y] with y +// index limits. void plsurf3dl( PLFLT[] x, PLFLT[] y, PLFLT[][] z, PLINT opt, PLFLT[] clevel, PLINT ixstart, PLINT ixn, PLINT[] indexymin, PLINT[] indexymax ) { @@ -836,7 +836,7 @@ ixstart, ixn, indexymin.ptr, indexymax.ptr ); } -/* Plots array y against x for n points using Hershey symbol "code" */ +// Plots array y against x for n points using Hershey symbol "code" void plsym( PLFLT[] x, PLFLT[] y, PLINT code ) { PLINT n = x.length; @@ -844,109 +844,109 @@ c_plsym( n, x.ptr, y.ptr, code ); } -/* Set the format for date / time labels */ +// Set the format for date / time labels void pltimefmt( string fmt ) { c_pltimefmt( toStringz( fmt ) ); } -/*--------------------------------------------------------------------------* - * Functions for use from C or C++ only - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// Functions for use from C or C++ only +//-------------------------------------------------------------------------- -/* Returns a list of file-oriented device names and their menu strings */ +// Returns a list of file-oriented device names and their menu strings //void plgFileDevs(char ***p_menustr, char ***p_devname, int *p_ndev); -/* Returns a list of all device names and their menu strings */ +// Returns a list of all device names and their menu strings //void plgDevs(char ***p_menustr, char ***p_devname, int *p_ndev); -/* Set the function pointer for the keyboard event handler */ +// Set the function pointer for the keyboard event handler //void plsKeyEH(void function(PLGraphicsIn *, void *, int *)KeyEH, void *KeyEH_data); -/* Set the function pointer for the (mouse) button event handler */ +// Set the function pointer for the (mouse) button event handler //void plsButtonEH(void function(PLGraphicsIn *, void *, int *)ButtonEH, void *ButtonEH_data); -/* Sets an optional user bop handler */ +// Sets an optional user bop handler //void plsbopH(void function(void *, int *)handler, void *handler_data); -/* Sets an optional user eop handler */ +// Sets an optional user eop handler //void plseopH(void function(void *, int *)handler, void *handler_data); -/* Set the variables to be used for storing error info */ +// Set the variables to be used for storing error info //void plsError(PLINT *errcode, char *errmsg) //{ //} -/* Sets an optional user exit handler. */ +// Sets an optional user exit handler. //void plsexit(int function(char *)handler); -/* Sets an optional user abort handler. */ +// Sets an optional user abort handler. //void plsabort(void function(char *)handler); -/* Function evaluators */ +// Function evaluators -/* Does a lookup from a 2d function array. Array is of type (PLFLT **), */ -/* and is column dominant (normal C ordering). */ +// Does a lookup from a 2d function array. Array is of type (PLFLT **), +// and is column dominant (normal C ordering). //PLFLT plf2eval2(PLINT ix, PLINT iy, PLPointer plf2eval_data); -/* Does a lookup from a 2d function array. Array is of type (PLFLT *), */ -/* and is column dominant (normal C ordering). */ +// Does a lookup from a 2d function array. Array is of type (PLFLT *), +// and is column dominant (normal C ordering). //PLFLT plf2eval(PLINT ix, PLINT iy, PLPointer plf2eval_data); -/* Does a lookup from a 2d function array. Array is of type (PLFLT *), */ -/* and is row dominant (Fortran ordering). */ +// Does a lookup from a 2d function array. Array is of type (PLFLT *), +// and is row dominant (Fortran ordering). //PLFLT plf2evalr(PLINT ix, PLINT iy, PLPointer plf2eval_data); -/* Command line parsing utilities */ +// Command line parsing utilities -/* Merge user option table into internal info structure. */ +// Merge user option table into internal info structure. //int plMergeOpts(PLOptionTable *options, char *name, char **notes); -/* Set the strings used in usage and syntax messages. */ +// Set the strings used in usage and syntax messages. //void plSetUsage(char *program_string, char *usage_string); -/* Process input strings, treating them as an option and argument pair. */ -/* The first is for the external API, the second the work routine declared - * here for backward compatibilty. */ +// Process input strings, treating them as an option and argument pair. +// The first is for the external API, the second the work routine declared +// here for backward compatibilty. int plsetopt( string opt, string optarg ) { return c_plsetopt( toStringz( opt ), toStringz( optarg ) ); } -/* Miscellaneous */ +// Miscellaneous -/* Get the escape character for text strings. */ +// Get the escape character for text strings. //void plgesc(char *p_esc); -/* Front-end to driver escape function. */ +// Front-end to driver escape function. //void pl_cmd(PLINT op, void *ptr); -/* Return full pathname for given file if executable */ +// Return full pathname for given file if executable //int plFindName(char *p); -/* Looks for the specified executable file according to usual search path. */ +// Looks for the specified executable file according to usual search path. //char * plFindCommand(char *fn); -/* Gets search name for file by concatenating the dir, subdir, and file */ -/* name, allocating memory as needed. */ +// Gets search name for file by concatenating the dir, subdir, and file +// name, allocating memory as needed. //void plGetName(char *dir, char *subdir, char *filename, char **filespec); -/* Prompts human to input an integer in response to given message. */ +// Prompts human to input an integer in response to given message. //PLINT plGetInt(char *s); -/* Prompts human to input a float in response to given message. */ +// Prompts human to input a float in response to given message. //PLFLT plGetFlt(char *s); -/* Find the maximum and minimum of a 2d matrix allocated with plAllc2dGrid(). */ +// Find the maximum and minimum of a 2d matrix allocated with plAllc2dGrid(). void plMinMax2dGrid( PLFLT[][] f, out PLFLT fmax, out PLFLT fmin ) { plMinMax2dGrid( convert_array( f ), f.length, f[0].length, &fmax, &fmin ); } -/* Wait for graphics input event and translate to world coordinates */ +// Wait for graphics input event and translate to world coordinates //int plGetCursor(PLGraphicsIn *gin); -/* Translates relative device coordinates to world coordinates. */ +// Translates relative device coordinates to world coordinates. //int plTranslateCursor(PLGraphicsIn *gin); @@ -955,24 +955,24 @@ alias double PLFLT; -/* This is apparently portable if stdint.h exists. */ -/* A reasonable back-up in case stdint.h does not exist on the platform. */ +// This is apparently portable if stdint.h exists. +// A reasonable back-up in case stdint.h does not exist on the platform. alias uint PLUNICODE; alias int PLINT; -/* For identifying logical (boolean) arguments */ +// For identifying logical (boolean) arguments alias PLINT PLBOOL; -/* For passing user data, as with X's XtPointer */ +// For passing user data, as with X's XtPointer alias void* PLPointer; -/*--------------------------------------------------------------------------* - * Complex data types and other good stuff - \*--------------------------------------------------------------------------*/ +//-------------------------------------------------------------------------- +// Complex data types and other good stuff +//-------------------------------------------------------------------------- -/* Switches for escape function call. */ -/* Some of these are obsolete but are retained in order to process - * old metafiles. */ +// Switches for escape function call. +// Some of these are obsolete but are retained in order to process +// old metafiles. const PLESC_SET_RGB = 1; const PLESC_ALLOC_NCOL = 2; @@ -1001,44 +1001,44 @@ const PLESC_SETBGFG = 25; const PLESC_DEVINIT = 26; -/* image operations */ +// image operations const ZEROW2B = 1; const ZEROW2D = 2; const ONEW2B = 3; const ONEW2D = 4; -/* Window parameter tags */ +// Window parameter tags const PLSWIN_DEVICE = 1; const PLSWIN_WORLD = 2; -/* Axis label tags */ -const PL_X_AXIS = 1; /* The x-axis */ -const PL_Y_AXIS = 2; /* The y-axis */ -const PL_Z_AXIS = 3; /* The z-axis */ +// Axis label tags +const PL_X_AXIS = 1; // The x-axis +const PL_Y_AXIS = 2; // The y-axis +const PL_Z_AXIS = 3; // The z-axis -/* PLplot Option table & support constants */ +// PLplot Option table & support constants -/* Option-specific settings */ +// Option-specific settings const PL_OPT_ENABLED = 0x0001; const PL_OPT_ARG = 0x0002; const PL_OPT_NODELETE = 0x0004; const PL_OPT_INVISIBLE = 0x0008; const PL_OPT_DISABLED = 0x0010; -/* Option-processing settings -- mutually exclusive */ +// Option-processing settings -- mutually exclusive const PL_OPT_FUNC = 0x0100; const PL_OPT_BOOL = 0x0200; const PL_OPT_INT = 0x0400; const PL_OPT_FLOAT = 0x0800; const PL_OPT_STRING = 0x1000; -/* Global mode settings */ -/* These override per-option settings */ +// Global mode settings +// These override per-option settings const PL_PARSE_PARTIAL = 0x0000; const PL_PARSE_FULL = 0x0001; const PL_PARSE_QUIET = 0x0002; -/* processing */ +// processing const PL_PARSE_NODELETE = 0x0004; const PL_PARSE_SHOWALL = 0x0008; const PL_PARSE_OVERRIDE = 0x0010; @@ -1046,37 +1046,37 @@ const PL_PARSE_NODASH = 0x0040; const PL_PARSE_SKIP = 0x0080; -/* FCI (font characterization integer) related constants. */ +// FCI (font characterization integer) related constants. const PL_FCI_MARK = 0x80000000; const PL_FCI_IMPOSSIBLE = 0x00000000; const PL_FCI_HEXDIGIT_MASK = 0xf; const PL_FCI_HEXPOWER_MASK = 0x7; -/* These define hexpower values corresponding to each font attribute. */ +// These define hexpower values corresponding to each font attribute. const PL_FCI_HEXPOWER_IMPOSSIBLE = 0xf; const PL_FCI_FAMILY = 0x0; const PL_FCI_STYLE = 0x1; -/* These are legal values for font family attribute */ +// These are legal values for font family attribute const PL_FCI_WEIGHT = 0x2; const PL_FCI_SANS = 0x0; const PL_FCI_SERIF = 0x1; const PL_FCI_MONO = 0x2; const PL_FCI_SCRIPT = 0x3; -/* These are legal values for font style attribute */ +// These are legal values for font style attribute const PL_FCI_SYMBOL = 0x4; const PL_FCI_UPRIGHT = 0x0; const PL_FCI_ITALIC = 0x1; -/* These are legal values for font weight attribute */ +// These are legal values for font weight attribute const PL_FCI_MEDIUM = 0x0; const PL_FCI_BOLD = 0x1; const PL_FCI_OBLIQUE = 0x2; -/* Obsolete names */ +// Obsolete names -/* Option table definition */ +// Option table definition struct _N1 { @@ -1090,7 +1090,7 @@ } alias _N1 PLOptionTable; -/* PLplot Graphics Input structure */ +// PLplot Graphics Input structure const PL_MAXKEY = 16; @@ -1111,7 +1111,7 @@ } alias _N2 PLGraphicsIn; -/* Structure for describing the plot window */ +// Structure for describing the plot window const PL_MAXWINDOWS = 64; @@ -1128,8 +1128,8 @@ } alias _N3 PLWindow; -/* Structure for doing display-oriented operations via escape commands */ -/* May add other attributes in time */ +// Structure for doing display-oriented operations via escape commands +// May add other attributes in time struct _N4 { @@ -1140,18 +1140,18 @@ } alias _N4 PLDisplay; -/* Macro used (in some cases) to ignore value of argument */ -/* I don't plan on changing the value so you can hard-code it */ +// Macro used (in some cases) to ignore value of argument +// I don't plan on changing the value so you can hard-code it const int PL_NOTSET = -42; -/* See plcont.c for examples of the following */ +// See plcont.c for examples of the following -/* - * PLfGrid is for passing (as a pointer to the first element) an arbitrarily - * dimensioned array. The grid dimensions MUST be stored, with a maximum of 3 - * dimensions assumed for now. - */ +// +// PLfGrid is for passing (as a pointer to the first element) an arbitrarily +// dimensioned array. The grid dimensions MUST be stored, with a maximum of 3 +// dimensions assumed for now. +// struct _N5 { @@ -1162,10 +1162,10 @@ } alias _N5 PLfGrid; -/* - * PLfGrid2 is for passing (as an array of pointers) a 2d function array. The - * grid dimensions are passed for possible bounds checking. - */ +// +// PLfGrid2 is for passing (as an array of pointers) a 2d function array. The +// grid dimensions are passed for possible bounds checking. +// struct _N6 { @@ -1175,16 +1175,16 @@ } alias _N6 PLfGrid2; -/* - * NOTE: a PLfGrid3 is a good idea here but there is no way to exploit it yet - * so I'll leave it out for now. - */ +// +// NOTE: a PLfGrid3 is a good idea here but there is no way to exploit it yet +// so I'll leave it out for now. +// -/* - * PLcGrid is for passing (as a pointer to the first element) arbitrarily - * dimensioned coordinate transformation arrays. The grid dimensions MUST be - * stored, with a maximum of 3 dimensions assumed for now. - */ +// +// PLcGrid is for passing (as a pointer to the first element) arbitrarily +// dimensioned coordinate transformation arrays. The grid dimensions MUST be +// stored, with a maximum of 3 dimensions assumed for now. +// struct _N7 { @@ -1197,11 +1197,11 @@ } alias _N7 c_PLcGrid; -/* - * PLcGrid2 is for passing (as arrays of pointers) 2d coordinate - * transformation arrays. The grid dimensions are passed for possible bounds - * checking. - */ +// +// PLcGrid2 is for passing (as arrays of pointers) 2d coordinate +// transformation arrays. The grid dimensions are passed for possible bounds +// checking. +// struct _N8 { @@ -1213,12 +1213,12 @@ } alias _N8 c_PLcGrid2; -/* - * NOTE: a PLcGrid3 is a good idea here but there is no way to exploit it yet - * so I'll leave it out for now. - */ +// +// NOTE: a PLcGrid3 is a good idea here but there is no way to exploit it yet +// so I'll leave it out for now. +// -/* PLColor is the usual way to pass an rgb color value. */ +// PLColor is the usual way to pass an rgb color value. struct _N9 { @@ -1230,7 +1230,7 @@ } alias _N9 PLColor; -/* PLControlPt is how cmap1 control points are represented. */ +// PLControlPt is how cmap1 control points are represented. struct _N10 { @@ -1243,8 +1243,8 @@ } alias _N10 PLControlPt; -/* A PLBufferingCB is a control block for interacting with devices - * that support double buffering. */ +// A PLBufferingCB is a control block for interacting with devices +// that support double buffering. struct _N11 { @@ -1258,53 +1258,53 @@ const PLESC_DOUBLEBUFFERING_QUERY = 3; -/*--------------------------------------------------------------------------* * BRAINDEAD-ness - * - * Some systems allow the Fortran & C namespaces to clobber each other. - * For PLplot to work from Fortran on these systems, we must name the the - * externally callable C functions something other than their Fortran entry - * names. In order to make this as easy as possible for the casual user, - * yet reversible to those who abhor my solution, I have done the - * following: - * - * The C-language bindings are actually different from those - * described in the manual. Macros are used to convert the - * documented names to the names used in this package. The - * user MUST include plplot.h in order to get the name - * redefinition correct. - * - * Sorry to have to resort to such an ugly kludge, but it is really the - * best way to handle the situation at present. If all available - * compilers offer a way to correct this stupidity, then perhaps we can - * eventually reverse it. - * - * If you feel like screaming at someone (I sure do), please - * direct it at your nearest system vendor who has a braindead shared - * C/Fortran namespace. Some vendors do offer compiler switches that - * change the object names, but then everybody who wants to use the - * package must throw these same switches, leading to no end of trouble. - * - * Note that this definition should not cause any noticable effects except - * when debugging PLplot calls, in which case you will need to remember - * the real function names (same as before but with a 'c_' prepended). - * - * Also, to avoid macro conflicts, the BRAINDEAD part must not be expanded - * in the stub routines. - * - * Aside: the reason why a shared Fortran/C namespace is deserving of the - * BRAINDEAD characterization is that it completely precludes the the kind - * of universal API that is attempted (more or less) with PLplot, without - * Herculean efforts (e.g. remapping all of the C bindings by macros as - * done here). The vendors of such a scheme, in order to allow a SINGLE - * type of argument to be passed transparently between C and Fortran, - * namely, a pointer to a conformable data type, have slammed the door on - * insertion of stub routines to handle the conversions needed for other - * data types. Intelligent linkers could solve this problem, but these are - * not anywhere close to becoming universal. So meanwhile, one must live - * with either stub routines for the inevitable data conversions, or a - * different API. The former is what is used here, but is made far more - * difficult in a braindead shared Fortran/C namespace. - \*--------------------------------------------------------------------------*/ +//--------------------------------------------------------------------------* * BRAINDEAD-ness +// +// Some systems allow the Fortran & C namespaces to clobber each other. +// For PLplot to work from Fortran on these systems, we must name the the +// externally callable C functions something other than their Fortran entry +// names. In order to make this as easy as possible for the casual user, +// yet reversible to those who abhor my solution, I have done the +// following: +// +// The C-language bindings are actually different from those +// described in the manual. Macros are used to convert the +// documented names to the names used in this package. The +// user MUST include plplot.h in order to get the name +// redefinition correct. +// +// Sorry to have to resort to such an ugly kludge, but it is really the +// best way to handle the situation at present. If all available +// compilers offer a way to correct this stupidity, then perhaps we can +// eventually reverse it. +// +// If you feel like screaming at someone (I sure do), please +// direct it at your nearest system vendor who has a braindead shared +// C/Fortran namespace. Some vendors do offer compiler switches that +// change the object names, but then everybody who wants to use the +// package must throw these same switches, leading to no end of trouble. +// +// Note that this definition should not cause any noticable effects except +// when debugging PLplot calls, in which case you will need to remember +// the real function names (same as before but with a 'c_' prepended). +// +// Also, to avoid macro conflicts, the BRAINDEAD part must not be expanded +// in the stub routines. +// +// Aside: the reason why a shared Fortran/C namespace is deserving of the +// BRAINDEAD characterization is that it completely precludes the the kind +// of universal API that is attempted (more or less) with PLplot, without +// Herculean efforts (e.g. remapping all of the C bindings by macros as +// done here). The vendors of such a scheme, in order to allow a SINGLE +// type of argument to be passed transparently between C and Fortran, +// namely, a pointer to a conformable data type, have slammed the door on +// insertion of stub routines to handle the conversions needed for other +// data types. Intelligent linkers could solve this problem, but these are +// not anywhere close to becoming universal. So meanwhile, one must live +// with either stub routines for the inevitable data conversions, or a +// different API. The former is what is used here, but is made far more +// difficult in a braindead shared Fortran/C namespace. +//-------------------------------------------------------------------------- @@ -1477,7 +1477,7 @@ alias c_plxormod plxormod; -/* Redefine some old function names for backward compatibility */ +// Redefine some old function names for backward compatibility alias pleop plclr; @@ -1491,211 +1491,211 @@ alias plgvpw plP_gvpw; -/*--------------------------------------------------------------------------* * Function Prototypes -\*--------------------------------------------------------------------------*/ +//--------------------------------------------------------------------------* * Function Prototypes +//-------------------------------------------------------------------------- -/* All void types */ -/* C routines callable from stub routines come first */ +// All void types +// C routines callable from stub routines come first -/* set the format of the contour labels */ +// set the format of the contour labels void c_pl_setcontlabelformat( PLINT lexp, PLINT sigdig ); -/* set offset and spacing of contour labels */ +// set offset and spacing of contour labels void c_pl_setcontlabelparam( PLFLT offset, PLFLT size, PLFLT spacing, PLINT active ); -/* Advance to subpage "page", or to the next one if "page" = 0. */ +// Advance to subpage "page", or to the next one if "page" = 0. void c_pladv( PLINT page ); -/* simple arrow plotter. */ +// simple arrow plotter. void c_plvect( PLFLT **u, PLFLT **v, PLINT nx, PLINT ny, PLFLT scale, void function( PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer ) pltr, PLPointer pltr_data ); void c_plsvect( PLFLT *arrowx, PLFLT *arrowy, PLINT npts, PLBOOL fill ); -/* This functions similarly to plbox() except that the origin of the axes */ -/* is placed at the user-specified point (x0, y0). */ +// This functions similarly to plbox() except that the origin of the axes +// is placed at the user-specified point (x0, y0). void c_plaxes( PLFLT x0, PLFLT y0, char *xopt, PLFLT xtick, PLINT nxsub, char *yopt, PLFLT ytick, PLINT nysub ); -/* Flags for plbin() - opt argument */ +// Flags for plbin() - opt argument const PL_BIN_DEFAULT = 0; const PL_BIN_CENTRED = 1; const PL_BIN_NOEXPAND = 2; const PL_BIN_NOEMPTY = 4; -/* Plot a histogram using x to store data values and y to store frequencies */ +// Plot a histogram using x to store data values and y to store frequencies void c_plbin( PLINT nbin, PLFLT *x, PLFLT *y, PLINT opt ); -/* Start new page. Should only be used with pleop(). */ +// Start new page. Should only be used with pleop(). void c_plbop(); -/* This draws a box around the current viewport. */ +// This draws a box around the current viewport. void c_plbox( char *xopt, PLFLT xtick, PLINT nxsub, char *yopt, PLFLT ytick, PLINT nysub ); -/* This is the 3-d analogue of plbox(). */ +// This is the 3-d analogue of plbox(). void c_plbox3( char *xopt, char *xlabel, PLFLT xtick, PLINT nsubx, char *yopt, char *ylabel, PLFLT ytick, PLINT nsuby, char *zopt, char *zlabel, PLFLT ztick, PLINT nsubz ); -/* Calculate broken-down time from continuous time for current stream. */ +// Calculate broken-down time from continuous time for current stream. void c_plbtime( PLINT *year, PLINT *month, PLINT *day, PLINT *hour, PLINT *min, PLFLT *sec, PLFLT ctime ); -/* Setup a user-provided custom labeling function */ +// Setup a user-provided custom labeling function void c_plslabelfunc( void function( PLINT, PLFLT, char*, PLINT, PLPointer ) labelfunc, PLPointer label_data ); -/* Calculate world coordinates and subpage from relative device coordinates. */ +// Calculate world coordinates and subpage from relative device coordinates. void c_plcalc_world( PLFLT rx, PLFLT ry, PLFLT *wx, PLFLT *wy, PLINT *window ); -/* Plot an arc */ +// Plot an arc void c_plarc( PLFLT x, PLFLT y, PLFLT a, PLFLT b, PLFLT angle1, PLFLT angle2, PLFLT rotate, PLBOOL fill ); -/* Clear current subpage. */ +// Clear current subpage. void c_plclear(); -/* Set color, map 0. Argument is integer between 0 and 15. */ +// Set color, map 0. Argument is integer between 0 and 15. void c_plcol0( PLINT icol0 ); -/* Set color, map 1. Argument is a float between 0. and 1. */ +// Set color, map 1. Argument is a float between 0. and 1. void c_plcol1( PLFLT col1 ); -/* Configure transformation between continuous and broken-down time (and - * vice versa) for current stream. */ +// Configure transformation between continuous and broken-down time (and +// vice versa) for current stream. void c_plconfigtime( PLFLT scale, PLFLT offset1, PLFLT offset2, PLINT ccontrol, PLBOOL ifbtime_offset, PLINT year, PLINT month, PLINT day, PLINT hour, PLINT min, PLFLT sec ); -/* Draws a contour plot from data in f(nx,ny). Is just a front-end to - * plfcont, with a particular choice for f2eval and f2eval_data. - */ +// Draws a contour plot from data in f(nx,ny). Is just a front-end to +// plfcont, with a particular choice for f2eval and f2eval_data. +// void c_plcont( PLFLT **f, 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 ); -/* Draws a contour plot using the function evaluator f2eval and data stored - * by way of the f2eval_data pointer. This allows arbitrary organizations - * of 2d array data to be used. - */ +// Draws a contour plot using the function evaluator f2eval and data stored +// by way of the f2eval_data pointer. This allows arbitrary organizations +// of 2d array data to be used. +// 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 ); -/* Copies state parameters from the reference stream to the current stream. */ +// Copies state parameters from the reference stream to the current stream. void c_plcpstrm( PLINT iplsr, PLBOOL flags ); -/* Calculate continuous time from broken-down time for current stream. */ +// Calculate continuous time from broken-down time for current stream. void c_plctime( PLINT year, PLINT month, PLINT day, PLINT hour, PLINT min, PLFLT sec, PLFLT *ctime ); -/* Converts input values from relative device coordinates to relative plot */ -/* coordinates. */ +// Converts input values from relative device coordinates to relative plot +// coordinates. void pldid2pc( PLFLT *xmin, PLFLT *ymin, PLFLT *xmax, PLFLT *ymax ); -/* Converts input values from relative plot coordinates to relative */ -/* device coordinates. */ +// Converts input values from relative plot coordinates to relative +// device coordinates. void pldip2dc( PLFLT *xmin, PLFLT *ymin, PLFLT *xmax, PLFLT *ymax ); -/* End a plotting session for all open streams. */ +// End a plotting session for all open streams. void c_plend(); -/* End a plotting session for the current stream only. */ +// End a plotting session for the current stream only. void c_plend1(); -/* Simple interface for defining viewport and window. */ +// Simple interface for defining viewport and window. void c_plenv( PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLINT just, PLINT axis ); -/* similar to plenv() above, but in multiplot mode does not advance the subpage, - * instead the current subpage is cleared */ +// similar to plenv() above, but in multiplot mode does not advance the subpage, +// instead the current subpage is cleared void c_plenv0( PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax, PLINT just, PLINT axis ); -/* End current page. Should only be used with plbop(). */ +// End current page. Should only be used with plbop(). void c_pleop(); -/* Plot horizontal error bars (xmin(i),y(i)) to (xmax(i),y(i)) */ +// Plot horizontal error bars (xmin(i),y(i)) to (xmax(i),y(i)) void c_plerrx( PLINT n, PLFLT *xmin, PLFLT *xmax, PLFLT *y ); -/* Plot vertical error bars (x,ymin(i)) to (x(i),ymax(i)) */ +// Plot vertical error bars (x,ymin(i)) to (x(i),ymax(i)) void c_plerry( PLINT n, PLFLT *x, PLFLT *ymin, PLFLT *ymax ); -/* Advance to the next family file on the next new page */ +// Advance to the next family file on the next new page void c_plfamadv(); -/* Pattern fills the polygon bounded by the input points. */ +// Pattern fills the polygon bounded by the input points. void c_plfill( PLINT n, PLFLT *x, PLFLT *y ); -/* Pattern fills the 3d polygon bounded by the input points. */ +// Pattern fills the 3d polygon bounded by the input points. void c_plfill3( PLINT n, PLFLT *x, PLFLT *y, PLFLT *z ); -/* Flushes the output stream. Use sparingly, if at all. */ +// Flushes the output stream. Use sparingly, if at all. void c_plflush(); -/* Sets the global font flag to 'ifont'. */ +// Sets the global font flag to 'ifont'. void c_plfont( PLINT ifont ); -/* Load specified font set. */ +// Load specified font set. void c_plfontld( PLINT fnt ); -/* Get character default height and current (scaled) height */ +// Get character default height and current (scaled) height void c_plgchr( PLFLT *p_def, PLFLT *p_ht ); -/* Returns 8 bit RGB values for given color from color map 0 */ +// Returns 8 bit RGB values for given color from color map 0 void c_plgcol0( PLINT icol0, PLINT *r, PLINT *g, PLINT *b ); -/* Returns 8 bit RGB values for given color from color map 0 and alpha value */ +// Returns 8 bit RGB values for given color from color map 0 and alpha value void c_plgcol0a( PLINT icol0, PLINT *r, PLINT *g, PLINT *b, PLFLT *a ); -/* Returns the background color by 8 bit RGB value */ +// Returns the background color by 8 bit RGB value void c_plgcolbg( PLINT *r, PLINT *g, PLINT *b ); -/* Returns the background color by 8 bit RGB value and alpha value */ +// Returns the background color by 8 bit RGB value and alpha value void c_plgcolbga( PLINT *r, PLINT *g, PLINT *b, PLFLT *a ); -/* Returns the current compression setting */ +// Returns the current compression setting void c_plgcompression( PLINT *compression ); -/* Get the current device (keyword) name */ +// Get the current device (keyword) name void c_plgdev( char *p_dev ); -/* Retrieve current window into device space */ +// Retrieve current window into device space void c_plgdidev( PLFLT *p_mar, PLFLT *p_aspect, PLFLT *p_jx, PLFLT *p_jy ); -/* Get plot orientation */ +// Get plot orientation void c_plgdiori( PLFLT *p_rot ); -/* Retrieve current window into plot space */ +// Retrieve current window into plot space void c_plgdiplt( PLFLT *p_xmin, PLFLT *p_ymin, PLFLT *p_xmax, PLFLT *p_ymax ); -/* Get FCI (font characterization integer) */ +// Get FCI (font characterization integer) void c_plgfci( PLUNICODE *pfci ); -/* Get family file parameters */ +// Get family file parameters void c_plgfam( PLINT *p_fam, PLINT *p_num, PLINT *p_bmax ); -/* Get the (current) output file name. Must be preallocated to >80 bytes */ +// Get the (current) output file name. Must be preallocated to >80 bytes void c_plgfnam( char *fnam ); -/* Get the current font family, style and weight */ +// Get the current font family, style and weight void c_plgfont( PLINT *p_family, PLINT *p_style, PLINT *p_weight ); -/* Get the (current) run level. */ +// Get the (current) run level. void c_plglevel( PLINT *p_level ); -/* Get output device parameters. */ +// Get output device parameters. void c_plgpage( PLFLT *p_xp, PLFLT *p_yp, PLINT *p_xleng, PLINT *p_yleng, PLINT *p_xoff, PLINT *p_yoff ); -/* Switches to graphics screen. */ +// Switches to graphics screen. void c_plgra(); -/* Draw gradient in polygon. */ +// Draw gradient in polygon. void c_plgradient( PLINT n, PLFLT *x, PLFLT *y, PLFLT angle ); -/* grid irregularly sampled data */ +// grid irregularly sampled data void c_plgriddata( PLFLT *x, PLFLT *y, PLFLT *z, PLINT npts, PLFLT *xg, PLINT nptsx, PLFLT *yg, PLINT nptsy, PLFLT **zg, PLINT type, PLFLT data ); -/* type of gridding algorithm for plgriddata() */ +// type of gridding algorithm for plgriddata() const GRID_CSA = 1; const GRID_DTLI = 2; const GRID_NNI = 3; @@ -1703,54 +1703,54 @@ const GRID_NNLI = 5; const GRID_NNAIDW = 6; -/* Get subpage boundaries in absolute coordinates */ +// Get subpage boundaries in absolute coordinates void c_plgspa( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax ); -/* Get current stream number. */ +// Get current stream number. void c_plgstrm( PLINT *p_strm ); -/* Get the current library version number */ +// Get the current library version number void c_plgver( char *p_ver ); -/* Get viewport boundaries in normalized device coordinates */ +// Get viewport boundaries in normalized device coordinates void c_plgvpd( PLFLT *p_xmin, PLFLT *p_xmax, PLFLT *p_ymin, PLFLT *p_ymax ); -/* Get viewport boundaries in world coordinates */ +// Get viewport boundaries in world coordinates void c_plgvpw( PLFLT *p_xmin, PLFLT *p_xmax, PLFLT *p_ymin, PLFLT *p_ymax ); -/* Get x axis labeling parameters */ +// Get x axis labeling parameters void c_plgxax( PLINT *p_digmax, PLINT *p_digits ); -/* Get y axis labeling parameters */ +// Get y axis labeling parameters void c_plgyax( PLINT *p_digmax, PLINT *p_digits ); -/* Get z axis labeling parameters */ +// Get z axis labeling parameters void c_plgzax( PLINT *p_digmax, PLINT *p_digits ); -/* Flags for plhist() - opt argument; note: some flags are passed to - * plbin() for the actual plotting */ +// Flags for plhist() - opt argument; note: some flags are passed to +// plbin() for the actual plotting const PL_HIST_DEFAULT = 0; const PL_HIST_NOSCALING = 1; const PL_HIST_IGNORE_OUTLIERS = 2; const PL_HIST_NOEXPAND = 8; const PL_HIST_NOEMPTY = 16; -/* Draws a histogram of n values of a variable in array data[0..n-1] */ +// Draws a histogram of n values of a variable in array data[0..n-1] void c_plhist( PLINT n, PLFLT *data, PLFLT datmin, PLFLT datmax, PLINT nbin, PLINT opt ); -/* Set current color (map 0) by hue, lightness, and saturation. */ +// Set current color (map 0) by hue, lightness, and saturation. void c_plhls( PLFLT h, PLFLT l, PLFLT s ); -/* Functions for converting between HLS and RGB color space */ +// Functions for converting between HLS and RGB color space void c_plhlsrgb( PLFLT h, PLFLT l, PLFLT s, PLFLT *p_r, PLFLT *p_g, PLFLT *p_b ); -/* Initializes PLplot, using preset or default options */ +// Initializes PLplot, using preset or default options void c_plinit(); -/* Draws a line segment from (x1, y1) to (x2, y2). */ +// Draws a line segment from (x1, y1) to (x2, y2). void c_pljoin( PLFLT x1, PLFLT y1, PLFLT x2, PLFLT y2 ); -/* Simple routine for labelling graphs. */ +// Simple routine for labelling graphs. void c_pllab( char *xlabel, char *ylabel, char *tlabel ); // Flags used for position argument of both pllegend and plcolorbar @@ -1801,226 +1801,226 @@ PLINT *symbol_colors, PLFLT *symbol_scales, PLINT *symbol_numbers, char **symbols ); -/* Sets position of the light source */ +// Sets position of the light source void c_pllightsource( PLFLT x, PLFLT y, PLFLT z ); -/* Draws line segments connecting a series of points. */ +// Draws line segments connecting a series of points. void c_plline( PLINT n, PLFLT *x, PLFLT *y ); -/* Draws a line in 3 space. */ +// Draws a line in 3 space. void c_plline3( PLINT n, PLFLT *x, PLFLT *y, PLFLT *z ); -/* Set line style. */ +// Set line style. void c_pllsty( PLINT lin ); -/* plot continental outline in world coordinates */ +// plot continental outline in world coordinates void c_plmap( void function( PLINT, PLFLT *, PLFLT* ) mapform, char *type, PLFLT minlong, PLFLT maxlong, PLFLT minlat, PLFLT maxlat ); -/* Plot the latitudes and longitudes on the background. */ +// Plot the latitudes and longitudes on the background. void c_plmeridians( void function( PLINT, PLFLT *, PLFLT* ) mapform, PLFLT dlong, PLFLT dlat, PLFLT minlong, PLFLT maxlong, PLFLT minlat, PLFLT maxlat ); -/* Plots a mesh representation of the function z[x][y]. */ +// Plots a mesh representation of the function z[x][y]. void c_plmesh( PLFLT *x, PLFLT *y, PLFLT **z, PLINT nx, PLINT ny, PLINT opt ); -/* Plots a mesh representation of the function z[x][y] with contour */ +// Plots a mesh representation of the function z[x][y] with contour void c_plmeshc( PLFLT *x, PLFLT *y, PLFLT **z, PLINT nx, PLINT ny, PLINT opt, PLFLT *clevel, PLINT nlevel ); -/* Creates a new stream and makes it the default. */ +// Creates a new stream and makes it the default. void c_plmkstrm( PLINT *p_strm ); -/* Prints out "text" at specified position relative to viewport */ +// Prints out "text" at specified position relative to viewport void c_plmtex( char *side, PLFLT disp, PLFLT pos, PLFLT just, char *text ); -/* Prints out "text" at specified position relative to viewport (3D)*/ +// Prints out "text" at specified position relative to viewport (3D) void c_plmtex3( char *side, PLFLT disp, PLFLT pos, PLFLT just, char *text ); -/* Plots a 3-d representation of the function z[x][y]. */ +// Plots a 3-d representation of the function z[x][y]. void c_plot3d( PLFLT *x, PLFLT *y, PLFLT **z, PLINT nx, PLINT ny, PLINT opt, PLBOOL side ); -/* Plots a 3-d representation of the function z[x][y] with contour. */ +// Plots a 3-d representation of the function z[x][y] with contour. void c_plot3dc( PLFLT *x, PLFLT *y, PLFLT **z, PLINT nx, PLINT ny, PLINT opt, PLFLT *clevel, PLINT nlevel ); -/* Plots a 3-d representation of the function z[x][y] with contour and - * y index limits. */ +// Plots a 3-d representation of the function z[x][y] with contour and +// y index limits. void c_plot3dcl( PLFLT *x, PLFLT *y, PLFLT **z, PLINT nx, PLINT ny, PLINT opt, PLFLT *clevel, PLINT nlevel, PLINT ixstart, PLINT ixn, PLINT *indexymin, PLINT *indexymax ); -/* - * definitions for the opt argument in plot3dc() and plsurf3d() - * - * DRAW_LINEX *must* be 1 and DRAW_LINEY *must* be 2, because of legacy code! - */ -const DRAW_LINEX = 1 << 0; /* draw lines parallel to the X axis */ -const DRAW_LINEY = 1 << 1; /* draw lines parallel to the Y axis */ -const DRAW_LINEXY = DRAW_LINEX | DRAW_LINEY; /* draw lines parallel to both the X and Y axis */ -const MAG_COLOR = 1 << 2; /* draw the mesh with a color dependent of the magnitude */ -const BASE_CONT = 1 << 3; /* draw contour plot at bottom xy plane */ -const TOP_CONT = 1 << 4; /* draw contour plot at top xy plane */ -const SURF_CONT = 1 << 5; /* draw contour plot at surface */ -const DRAW_SIDES = 1 << 6; /* draw sides */ -const FACETED = 1 << 7; /* draw outline for each square that makes up the surface */ -const MESH = 1 << 8; /* draw mesh */ +// +// definitions for the opt argument in plot3dc() and plsurf3d() +// +// DRAW_LINEX *must* be 1 and DRAW_LINEY *must* be 2, because of legacy code! +// +const DRAW_LINEX = 1 << 0; // draw lines parallel to the X axis +const DRAW_LINEY = 1 << 1; // draw lines parallel to the Y axis +const DRAW_LINEXY = DRAW_LINEX | DRAW_LINEY; // draw lines parallel to both the X and Y axis +const MAG_COLOR = 1 << 2; // draw the mesh with a color dependent of the magnitude +const BASE_CONT = 1 << 3; // draw contour plot at bottom xy plane +const TOP_CONT = 1 << 4; // draw contour plot at top xy plane +const SURF_CONT = 1 << 5; // draw contour plot at surface +const DRAW_SIDES = 1 << 6; // draw sides +const FACETED = 1 << 7; // draw outline for each square that makes up the surface +const MESH = 1 << 8; // draw mesh -/* - * valid options for plot3dc(): - * - * DRAW_SIDES, BASE_CONT, TOP_CONT (not yet), - * MAG_COLOR, DRAW_LINEX, DRAW_LINEY, DRAW_LINEXY. - * - * valid options for plsurf3d(): - * - * MAG_COLOR, BASE_CONT, SURF_CONT, FACETED, DRAW_SIDES. - */ +// +// valid options for plot3dc(): +// +// DRAW_SIDES, BASE_CONT, TOP_CONT (not yet), +// MAG_COLOR, DRAW_LINEX, DRAW_LINEY, DRAW_LINEXY. +// +// valid options for plsurf3d(): +// +// MAG_COLOR, BASE_CONT, SURF_CONT, FACETED,... [truncated message content] |
From: <jb...@us...> - 2011-04-07 07:30:40
|
Revision: 11687 http://plplot.svn.sourceforge.net/plplot/?rev=11687&view=rev Author: jbauck Date: 2011-04-07 07:30:32 +0000 (Thu, 07 Apr 2011) Log Message: ----------- Well, that was excruciating. Modified Paths: -------------- trunk/bindings/ada/plplot.adb trunk/bindings/ada/plplot.ads trunk/bindings/ada/plplot_traditional.adb trunk/bindings/ada/plplot_traditional.ads Added Paths: ----------- trunk/examples/ada/x33a.adb trunk/examples/ada/xthick33a.adb Modified: trunk/bindings/ada/plplot.adb =================================================================== --- trunk/bindings/ada/plplot.adb 2011-04-04 01:12:42 UTC (rev 11686) +++ trunk/bindings/ada/plplot.adb 2011-04-07 07:30:32 UTC (rev 11687) @@ -1851,7 +1851,8 @@ -- Arrays that could have elements of Plot_Color_Type are merely arrays of -- integers; we have not defined special arrays (e.g., array(somerange) of -- Plot_Color_Type) for the arguments Text_Colors, Box_Colors, Line_Colors, - -- or Symbol_Colors. + -- or Symbol_Colors. Similarly for Entry_Options which could be an array + -- of Legend_Flag_Type and some other arguments. fixme -- Routine for drawing discrete line, symbol, or cmap0 legends -- pllegend procedure Create_Legend @@ -1862,7 +1863,6 @@ Background_Color, Bounding_Box_Color : Plot_Color_Type; Bounding_Box_Style : Legend_Flag_Type; Number_Rows, Number_Columns : Integer; - -- fixme Entry_Options could (should?) be an array of Legend_Flag_Type. Entry_Options : Integer_Array_1D; Text_Offset, Text_Scale, Text_Spacing : Long_Float; Text_Justification : Long_Float; @@ -1871,7 +1871,7 @@ Box_Colors, Box_Patterns : Integer_Array_1D; Box_Scales : Real_Vector; Box_Line_Widths : Integer_Array_1D; - Line_Colors, Line_Styles, Line_Widths : Integer_Array_1D; --fixme Arrays of types? + Line_Colors, Line_Styles, Line_Widths : Integer_Array_1D; Symbol_Colors : Integer_Array_1D; Symbol_Scales : Real_Vector; Symbol_Numbers : Integer_Array_1D; Modified: trunk/bindings/ada/plplot.ads =================================================================== --- trunk/bindings/ada/plplot.ads 2011-04-04 01:12:42 UTC (rev 11686) +++ trunk/bindings/ada/plplot.ads 2011-04-07 07:30:32 UTC (rev 11687) @@ -320,6 +320,30 @@ Parse_No_Dash : constant Parse_Mode_Type := 64; -- Set if leading dash NOT required Parse_Skip : constant Parse_Mode_Type := 128; -- Skip over unrecognized args + -- FCI (font characterization integer) related constants. + FCI_Mark : constant Integer := 16#10000000#; + FCI_Impossible : constant Integer := 16#00000000#; + FCI_Hexdigit_Mask : constant Integer := 16#f#; + FCI_Hexpower_Mask : constant Integer := 16#7#; + FCI_Hexpower_Impossible : constant Integer := 16#f#; + -- These define hexpower values corresponding to each font attribute. + FCI_Family : constant Integer := 16#0#; + FCI_Style : constant Integer := 16#1#; + FCI_Weight : constant Integer := 16#2#; + -- These are legal values for font family attribute + FCI_Sans : constant Integer := 16#0#; + FCI_Serif : constant Integer := 16#1#; + FCI_Mono : constant Integer := 16#2#; + FCI_Script : constant Integer := 16#3#; + FCI_Symbol : constant Integer := 16#4#; + -- These are legal values for font style attribute + FCI_Upright : constant Integer := 16#0#; + FCI_Italic : constant Integer := 16#1#; + FCI_Oblique : constant Integer := 16#2#; + -- These are legal values for font weight attribute + FCI_Medium : constant Integer := 16#0#; + FCI_Bold : constant Integer := 16#1#; + -- Descriptions of map outlines for continents, countries, and US states. type Map_Type is (Continents, USA_and_States, Continents_and_Countries, USA_States_and_Continents); @@ -371,7 +395,31 @@ PL_PARSE_NODASH : constant Parse_Mode_Type := 16#0040#; -- Set if leading dash NOT required PL_PARSE_SKIP : constant Parse_Mode_Type := 16#0080#; -- Skip over unrecognized args - -- definitions for the opt argument in plot3dc() and plsurf3d() + -- FCI (font characterization integer) related constants. + PL_FCI_MARK : constant Integer := 16#10000000#; + PL_FCI_IMPOSSIBLE : constant Integer := 16#00000000#; + PL_FCI_HEXDIGIT_MASK : constant Integer := 16#f#; + PL_FCI_HEXPOWER_MASK : constant Integer := 16#7#; + PL_FCI_HEXPOWER_IMPOSSIBLE : constant Integer := 16#f#; + -- These define hexpower values corresponding to each font attribute. + PL_FCI_FAMILY : constant Integer := 16#0#; + PL_FCI_STYLE : constant Integer := 16#1#; + PL_FCI_WEIGHT : constant Integer := 16#2#; + -- These are legal values for font family attribute + PL_FCI_SANS : constant Integer := 16#0#; + PL_FCI_SERIF : constant Integer := 16#1#; + PL_FCI_MONO : constant Integer := 16#2#; + PL_FCI_SCRIPT : constant Integer := 16#3#; + PL_FCI_SYMBOL : constant Integer := 16#4#; + -- These are legal values for font style attribute + PL_FCI_UPRIGHT : constant Integer := 16#0#; + PL_FCI_ITALIC : constant Integer := 16#1#; + PL_FCI_OBLIQUE : constant Integer := 16#2#; + -- These are legal values for font weight attribute + PL_FCI_MEDIUM : constant Integer := 16#0#; + PL_FCI_BOLD : constant Integer := 16#1#; + + -- Definitions for the opt argument in plot3dc() and plsurf3d() DRAW_LINEX : constant Integer := 1; -- draw lines parallel to the X axis DRAW_LINEY : constant Integer := 2; -- draw lines parallel to the Y axis DRAW_LINEXY : constant Integer := 3; -- draw lines parallel to both the X and Y axis @@ -1228,7 +1276,8 @@ -- Arrays that could have elements of Plot_Color_Type are merely arrays of -- integers; we have not defined special arrays (e.g., array(somerange) of -- Plot_Color_Type) for the arguments Text_Colors, Box_Colors, Line_Colors, - -- or Symbol_Colors. + -- or Symbol_Colors. Similarly for Entry_Options which could be an array + -- of Legend_Flag_Type and some other arguments. fixme -- Routine for drawing discrete line, symbol, or cmap0 legends -- pllegend procedure Create_Legend @@ -1239,7 +1288,6 @@ Background_Color, Bounding_Box_Color : Plot_Color_Type; Bounding_Box_Style : Legend_Flag_Type; Number_Rows, Number_Columns : Integer; - -- fixme Entry_Options could (should?) be an array of Legend_Flag_Type. Entry_Options : Integer_Array_1D; Text_Offset, Text_Scale, Text_Spacing : Long_Float; Text_Justification : Long_Float; Modified: trunk/bindings/ada/plplot_traditional.adb =================================================================== --- trunk/bindings/ada/plplot_traditional.adb 2011-04-04 01:12:42 UTC (rev 11686) +++ trunk/bindings/ada/plplot_traditional.adb 2011-04-07 07:30:32 UTC (rev 11687) @@ -1783,7 +1783,8 @@ -- Arrays that could have elements of Plot_Color_Type are merely arrays of -- integers; we have not defined special arrays (e.g., array(somerange) of -- Plot_Color_Type) for the arguments Text_Colors, Box_Colors, Line_Colors, - -- or Symbol_Colors. + -- or Symbol_Colors. Similarly for Entry_Options which could be an array + -- of Legend_Flag_Type and some other arguments. fixme -- Routine for drawing discrete line, symbol, or cmap0 legends procedure pllegend (Legend_Width, Legend_Height : out Long_Float; @@ -1793,16 +1794,15 @@ Background_Color, Bounding_Box_Color : Plot_Color_Type; Bounding_Box_Style : Legend_Flag_Type; Number_Rows, Number_Columns : Integer; - -- fixme Entry_Options could (should?) be an array of Legend_Flag_Type. Entry_Options : Integer_Array_1D; Text_Offset, Text_Scale, Text_Spacing : Long_Float; Text_Justification : Long_Float; - Text_Colors : Integer_Array_1D; -- Really Plot_Color_Type + Text_Colors : Integer_Array_1D; Label_Text : Legend_String_Array_Type; Box_Colors, Box_Patterns : Integer_Array_1D; Box_Scales : Real_Vector; Box_Line_Widths : Integer_Array_1D; - Line_Colors, Line_Styles, Line_Widths : Integer_Array_1D; --fixme Arrays of types? + Line_Colors, Line_Styles, Line_Widths : Integer_Array_1D; Symbol_Colors : Integer_Array_1D; Symbol_Scales : Real_Vector; Symbol_Numbers : Integer_Array_1D; Modified: trunk/bindings/ada/plplot_traditional.ads =================================================================== --- trunk/bindings/ada/plplot_traditional.ads 2011-04-04 01:12:42 UTC (rev 11686) +++ trunk/bindings/ada/plplot_traditional.ads 2011-04-07 07:30:32 UTC (rev 11687) @@ -318,6 +318,30 @@ Parse_No_Dash : constant Parse_Mode_Type := 64; -- Set if leading dash NOT required Parse_Skip : constant Parse_Mode_Type := 128; -- Skip over unrecognized args + -- FCI (font characterization integer) related constants. + FCI_Mark : constant Integer := 16#10000000#; + FCI_Impossible : constant Integer := 16#00000000#; + FCI_Hexdigit_Mask : constant Integer := 16#f#; + FCI_Hexpower_Mask : constant Integer := 16#7#; + FCI_Hexpower_Impossible : constant Integer := 16#f#; + -- These define hexpower values corresponding to each font attribute. + FCI_Family : constant Integer := 16#0#; + FCI_Style : constant Integer := 16#1#; + FCI_Weight : constant Integer := 16#2#; + -- These are legal values for font family attribute + FCI_Sans : constant Integer := 16#0#; + FCI_Serif : constant Integer := 16#1#; + FCI_Mono : constant Integer := 16#2#; + FCI_Script : constant Integer := 16#3#; + FCI_Symbol : constant Integer := 16#4#; + -- These are legal values for font style attribute + FCI_Upright : constant Integer := 16#0#; + FCI_Italic : constant Integer := 16#1#; + FCI_Oblique : constant Integer := 16#2#; + -- These are legal values for font weight attribute + FCI_Medium : constant Integer := 16#0#; + FCI_Bold : constant Integer := 16#1#; + -- Descriptions of map outlines for continents, countries, and US states. type Map_Type is (Continents, USA_and_States, Continents_and_Countries, USA_States_and_Continents); @@ -369,7 +393,31 @@ PL_PARSE_NODASH : constant Parse_Mode_Type := 16#0040#; -- Set if leading dash NOT required PL_PARSE_SKIP : constant Parse_Mode_Type := 16#0080#; -- Skip over unrecognized args - -- definitions for the opt argument in plot3dc() and plsurf3d() + -- FCI (font characterization integer) related constants. + PL_FCI_MARK : constant Integer := 16#10000000#; + PL_FCI_IMPOSSIBLE : constant Integer := 16#00000000#; + PL_FCI_HEXDIGIT_MASK : constant Integer := 16#f#; + PL_FCI_HEXPOWER_MASK : constant Integer := 16#7#; + PL_FCI_HEXPOWER_IMPOSSIBLE : constant Integer := 16#f#; + -- These define hexpower values corresponding to each font attribute. + PL_FCI_FAMILY : constant Integer := 16#0#; + PL_FCI_STYLE : constant Integer := 16#1#; + PL_FCI_WEIGHT : constant Integer := 16#2#; + -- These are legal values for font family attribute + PL_FCI_SANS : constant Integer := 16#0#; + PL_FCI_SERIF : constant Integer := 16#1#; + PL_FCI_MONO : constant Integer := 16#2#; + PL_FCI_SCRIPT : constant Integer := 16#3#; + PL_FCI_SYMBOL : constant Integer := 16#4#; + -- These are legal values for font style attribute + PL_FCI_UPRIGHT : constant Integer := 16#0#; + PL_FCI_ITALIC : constant Integer := 16#1#; + PL_FCI_OBLIQUE : constant Integer := 16#2#; + -- These are legal values for font weight attribute + PL_FCI_MEDIUM : constant Integer := 16#0#; + PL_FCI_BOLD : constant Integer := 16#1#; + + -- Definitions for the opt argument in plot3dc() and plsurf3d() DRAW_LINEX : constant Integer := 1; -- draw lines parallel to the X axis DRAW_LINEY : constant Integer := 2; -- draw lines parallel to the Y axis DRAW_LINEXY : constant Integer := 3; -- draw lines parallel to both the X and Y axis @@ -1155,7 +1203,8 @@ -- Arrays that could have elements of Plot_Color_Type are merely arrays of -- integers; we have not defined special arrays (e.g., array(somerange) of -- Plot_Color_Type) for the arguments Text_Colors, Box_Colors, Line_Colors, - -- or Symbol_Colors. + -- or Symbol_Colors. Similarly for Entry_Options which could be an array + -- of Legend_Flag_Type and some other arguments. fixme -- Routine for drawing discrete line, symbol, or cmap0 legends procedure pllegend (Legend_Width, Legend_Height : out Long_Float; @@ -1165,7 +1214,6 @@ Background_Color, Bounding_Box_Color : Plot_Color_Type; Bounding_Box_Style : Legend_Flag_Type; Number_Rows, Number_Columns : Integer; - -- fixme Entry_Options could (should?) be an array of Legend_Flag_Type. Entry_Options : Integer_Array_1D; Text_Offset, Text_Scale, Text_Spacing : Long_Float; Text_Justification : Long_Float; Added: trunk/examples/ada/x33a.adb =================================================================== --- trunk/examples/ada/x33a.adb (rev 0) +++ trunk/examples/ada/x33a.adb 2011-04-07 07:30:32 UTC (rev 11687) @@ -0,0 +1,895 @@ +-- -*- coding: utf-8; -*- +-- +-- $Id: x33c.c 11680 2011-03-27 17:57:51Z airwin $ +-- +-- Demonstrate most pllegend capability including unicode symbols. +-- +-- Copyright (C) 2011 Jerry Bauck +-- +-- This file is part of PLplot. +-- +-- PLplot is free software; you can redistribute it and/or modify +-- it under the terms of the GNU Library General Public License as published +-- by the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- PLplot is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU Library General Public License for more details. +-- +-- You should have received a copy of the GNU Library General Public License +-- along with PLplot; if not, write to the Free Software +-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +-- + +-- This example designed just for devices (e.g., the cairo-related and +-- qt-related devices) where the best choice of glyph is automatically +-- selected by the related libraries (pango/cairo or Qt4) for each +-- unicode character depending on what system fonts are installed. Of +-- course, you must have the appropriate TrueType fonts installed to +-- have access to all the required glyphs. + +-- Ada note: The function TUB is Ada.Strings.Unbounded.To_Unbounded_String +-- renamed. See PLplot_Traditional.ads or PLplot.ads. + +with + Ada.Strings.Unbounded, + Ada.Strings, + Ada.Strings.Fixed, + PLplot_Auxiliary, + PLplot_Traditional; +use + Ada.Strings.Unbounded, + Ada.Strings, + Ada.Strings.Fixed, + PLplot_Auxiliary, + PLplot_Traditional; + +procedure x33a is + position_options : Integer_Array_1D(0 .. 15) := + (PL_POSITION_LEFT + PL_POSITION_TOP + PL_POSITION_OUTSIDE, + PL_POSITION_TOP + PL_POSITION_OUTSIDE, + PL_POSITION_RIGHT + PL_POSITION_TOP + PL_POSITION_OUTSIDE, + PL_POSITION_RIGHT + PL_POSITION_OUTSIDE, + PL_POSITION_RIGHT + PL_POSITION_BOTTOM + PL_POSITION_OUTSIDE, + PL_POSITION_BOTTOM + PL_POSITION_OUTSIDE, + PL_POSITION_LEFT + PL_POSITION_BOTTOM + PL_POSITION_OUTSIDE, + PL_POSITION_LEFT + PL_POSITION_OUTSIDE, + PL_POSITION_LEFT + PL_POSITION_TOP + PL_POSITION_INSIDE, + PL_POSITION_TOP + PL_POSITION_INSIDE, + PL_POSITION_RIGHT + PL_POSITION_TOP + PL_POSITION_INSIDE, + PL_POSITION_RIGHT + PL_POSITION_INSIDE, + PL_POSITION_RIGHT + PL_POSITION_BOTTOM + PL_POSITION_INSIDE, + PL_POSITION_BOTTOM + PL_POSITION_INSIDE, + PL_POSITION_LEFT + PL_POSITION_BOTTOM + PL_POSITION_INSIDE, + PL_POSITION_LEFT + PL_POSITION_INSIDE); + + -- Pick 5 arbitrary UTF-8 symbols useful for plotting points (✠✚✱✪✽✺✰✴✦). + special_symbols : Legend_String_Array_Type(0 .. 4) := + (TUB("✰"), TUB("✴"), TUB("✱"), TUB("✽"), TUB("✦")); + + colorbar : Boolean := False; -- By default do not plot plcolorbar pages + -- for now while we are working out the API. + +-- static PLOptionTable options() := { +-- { +-- "colorbar", -- Turns on pages showing colorbars +-- NULL, +-- NULL, +-- &colorbar, +-- PL_OPT_BOOL, +-- "-colorbar", +-- "Plot the \"color bar\" pages." +-- }, +-- { +-- NULL, -- option +-- NULL, -- handler +-- NULL, -- client data +-- NULL, -- address of variable to set +-- 0, -- mode flag +-- NULL, -- short syntax +-- NULL +-- } -- long syntax +-- }; + +--const char *notes() := { "Make sure you get it right!", NULL }; + + --procedure plcolorbar_example_1(PLINT bar_type, PLINT cont_color, PLINT cont_width, PLFLT ticks, PLINT sub_ticks, PLINT n, PLFLT *values, const char *title) + + + -- procedure plcolorbar_example_1 + -- (bar_type, cont_color, cont_width : Integer; + -- ticks : Long_Float; + -- sub_ticks, n : Integer; + -- values : Real_Vector; + -- title : Unbounded_String) + -- is + -- colors : Real_Vector(0 .. n - 1); + -- i : Integer; + -- color_step, color_offset : Long_Float; + -- position, opt : Integer; + -- axis_opts_1, axis_opts_2 : Unbounded_String; + -- begin + -- pladv(0); + -- + -- -- Set up color palette 1. + -- plspal1("cmap1_blue_red.pal", True); + -- + -- color_step := 1.0 / Long_Float(n - 1); + -- for i in 0 .. n - 1 loop + -- colors(i) := color_offset + color_step * Long_Float(i); -- COLOR_OFFSET NOT DEFINED! + -- end loop; + -- + -- position := PL_POSITION_LEFT; + -- opt := bar_type + PL_COLORBAR_LABEL_LEFT + PL_COLORBAR_CAP_HIGH; + -- + -- if bar_type and PL_COLORBAR_SHADE_LABEL then + -- axis_opts_1 := To_Unbounded_String("iv"); + -- axis_opts_2 := To_Unbounded_String("i"); + -- else + -- if sub_ticks /= 0 then + -- axis_opts_1 := To_Unbounded_String("stv"); + -- axis_opts_2 := To_Unbounded_String("st"); + -- else + -- axis_opts_1 := To_Unbounded_String("tv"); + -- axis_opts_2 := To_Unbounded_String("t"); + -- end if; + -- end if; + -- + -- plcolorbar(position, opt, 0.1, 0.1, 0.5, 0.1, -- fixme + -- cont_color, cont_width, + -- ticks, sub_ticks, + -- axis_opts_1, "Test label - Left, High Cap", + -- n, colors, values); + -- + -- position := PL_POSITION_RIGHT; + -- opt := bar_type + PL_COLORBAR_LABEL_RIGHT + PL_COLORBAR_CAP_LOW; + -- + -- plcolorbar(position, opt, 0.1, 0.4, 0.5, 0.1, -- fixme etc. + -- cont_color, cont_width, + -- ticks, sub_ticks, + -- axis_opts_1, "Test label - Right, Low Cap", + -- n, colors, values); + -- + -- position := PL_POSITION_TOP; + -- opt := bar_type + PL_COLORBAR_LABEL_TOP + PL_COLORBAR_CAP_HIGH; + -- + -- plcolorbar(position, opt, 0.1, 0.1, 0.5, 0.1, + -- cont_color, cont_width, + -- ticks, sub_ticks, + -- axis_opts_2, "Test label - Top, High Cap", + -- n, colors, values); + -- + -- position := PL_POSITION_BOTTOM; + -- opt := bar_type + PL_COLORBAR_LABEL_BOTTOM + PL_COLORBAR_CAP_LOW; + -- + -- plcolorbar(position, opt, 0.4, 0.1, 0.5, 0.1, + -- cont_color, cont_width, + -- ticks, sub_ticks, + -- axis_opts_2, "Test label - Bottom, Low Cap", + -- n, colors, values); + -- + -- plvpor(0.0, 1.0, 0.0, 1.0); + -- plwind(0.0, 1.0, 0.0, 1.0); + -- plptex(0.5, 0.5, 0.0, 0.0, 0.5, To_String(title)); + -- end plcolorbar_example_1; + -- + -- + -- procedure plcolorbar_example_2 + -- (bar_type, cont_color, cont_width : Integer; + -- ticks, sub_ticks : Long_Float; + -- n : Integer; + -- values : Real_Vector; + -- title : Unbounded_String) + -- is + -- colors : Long_Float(0 .. n - 1); + -- i : Integer; + -- color_step, color_offset : Long_Float; + -- position, opt : Integer; + -- axis_opts_1, axis_opts_2 : Unbounded_String; + -- begin + -- pladv(0); + -- + -- -- Set up color palette 1. + -- plspal1("cmap1_blue_yellow.pal", True); + -- + -- color_step := 1.0 / Long_Float(n - 1); + -- for i in 0 .. n - 1 loop + -- if i = 0 then + -- color_offset := 0.01; + -- elsif i = n - 1 then + -- color_offset := -0.01; + -- else + -- color_offset := 0.0; + -- end if; + -- colors(i) := color_offset + color_step * Long_Float(i); + -- end loop; + -- + -- position := PL_POSITION_LEFT; + -- opt := bar_type + PL_COLORBAR_LABEL_LEFT + PL_COLORBAR_CAP_LOW; + -- + -- if bar_type = PL_COLORBAR_SHADE_LABEL then + -- axis_opts_1 := ""; + -- axis_opts_2 := ""; + -- else + -- if sub_ticks /= 0 then + -- axis_opts_1 := "stv"; + -- axis_opts_2 := "st"; + -- else + -- axis_opts_1 := "tv"; + -- axis_opts_2 := "t"; + -- end if; + -- end if; + -- + -- plcolorbar(position, opt, 0.1, 0.1, 0.5, 0.1, + -- cont_color, cont_width, + -- ticks, sub_ticks, + -- axis_opts_1, "Test label - Left, Low Cap", + -- n, colors, values); + -- + -- position := PL_POSITION_RIGHT; + -- opt := bar_type + PL_COLORBAR_LABEL_RIGHT + PL_COLORBAR_CAP_HIGH; + -- + -- plcolorbar(position, opt, 0.1, 0.4, 0.5, 0.1, + -- cont_color, cont_width, + -- ticks, sub_ticks, + -- axis_opts_1, "Test label - Right, High Cap", + -- n, colors, values); + -- + -- position := PL_POSITION_TOP; + -- opt := bar_type + PL_COLORBAR_LABEL_TOP + PL_COLORBAR_CAP_LOW; + -- + -- plcolorbar(position, opt, 0.1, 0.1, 0.5, 0.1, + -- cont_color, cont_width, + -- ticks, sub_ticks, + -- axis_opts_2, "Test label - Top, Low Cap", + -- n, colors, values); + -- + -- position := PL_POSITION_BOTTOM; + -- opt := bar_type + PL_COLORBAR_LABEL_BOTTOM + PL_COLORBAR_CAP_HIGH; + -- + -- plcolorbar(position, opt, 0.4, 0.1, 0.5, 0.1, + -- cont_color, cont_width, + -- ticks, sub_ticks, + -- axis_opts_2, "Test label - Bottom, High Cap", + -- n, colors, values); + -- + -- plvpor(0.0, 1.0, 0.0, 1.0); + -- plwind(0.0, 1.0, 0.0, 1.0); + -- plptex(0.5, 0.5, 0.0, 0.0, 0.5, To_String(title)); + -- end plcolorbar_example_2; + +---------------------------------------------------------------------------- +-- Demonstrate most pllegend capability including unicode symbols. +---------------------------------------------------------------------------- + + opt : Integer; + nlegend : Integer; + nturn : Integer; + legend_width, legend_height, x, y, xstart, ystart : Long_Float; + max_height, text_scale : Long_Float; + position, opt_base, nrow, ncolumn : Integer; + +begin -- main + plparseopts(PL_PARSE_FULL); + + -- Initialize plplot + plinit; + + -- First page illustrating the 16 standard positions. + declare + nlegend : constant Integer := 1; + opt_array : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + text_colors : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + box_colors : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + box_patterns : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + box_scales : Real_Vector (0 .. nlegend - 1) := (others => 0.0); + box_line_widths : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + line_colors : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + line_styles : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + line_widths : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + symbol_numbers : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + symbol_colors : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + symbol_scales : Real_Vector (0 .. nlegend - 1) := (others => 0.0); + text : Legend_String_Array_Type(0 .. nlegend - 1) := (others => TUB(" ")); + symbols : Legend_String_Array_Type(0 .. nlegend - 1) := (others => TUB(" ")); + begin + pladv(0); + plvpor(0.25, 0.75, 0.25, 0.75); + plwind(0.0, 1.0, 0.0, 1.0); + plbox("bc", 0.0, 0, "bc", 0.0, 0); + plsfont(PL_FCI_SANS, -1, -1); + plmtex("t", 8.0, 0.5, 0.5, "The 16 standard legend positions with"); + plmtex("t", 6.0, 0.5, 0.5, "the same (0.05) offset in x and y"); + + -- Only specify legend data that are required according to the + -- value of opt_array for that entry. + opt_base := PL_LEGEND_BACKGROUND + PL_LEGEND_BOUNDING_BOX; + opt_array(0) := PL_LEGEND_LINE + PL_LEGEND_SYMBOL; + line_styles(0) := 1; + line_widths(0) := 1; + symbol_scales(0) := 1.0; + symbol_numbers(0) := 4; + symbols(0) := TUB("*"); + + -- Use monotype fonts so that all legends are the same size. + plsfont(PL_FCI_MONO, -1, -1); + plscol0a(15, 32, 32, 32, 0.70); + + for k in 0 .. 15 loop + position := position_options(k); + opt := opt_base; + -- Make a 2-digit string with leading 0 for 0 .. 9. + if k >= 10 then + text(0) := To_Unbounded_String(Trim(Integer'image(k), Left)); + else + text(0) := To_Unbounded_String("0" & Trim(Integer'image(k), Left)); + end if; + text_colors(0) := 1 + (k mod 8); + line_colors(0) := 1 + (k mod 8); + symbol_colors(0) := 1 + (k mod 8); + + pllegend(legend_width, legend_height, position, opt, 0.05, 0.05, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, 1.0, 2.0, + 1.0, text_colors, text, + Box_Colors, Box_Patterns, + Box_Scales, Box_Line_Widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols); + end loop; + end; -- declare + + -- Second page illustrating effect of nrow, ncolumn for the same legend data. + declare + nlegend : constant Integer := 7; + opt_array : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + text_colors : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + box_colors : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + box_patterns : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + box_scales : Real_Vector (0 .. nlegend - 1) := (others => 0.0); + box_line_widths : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + line_colors : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + line_styles : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + line_widths : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + symbol_numbers : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + symbol_colors : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + symbol_scales : Real_Vector (0 .. nlegend - 1) := (others => 0.0); + text : Legend_String_Array_Type(0 .. nlegend - 1) := (others => TUB(" ")); + symbols : Legend_String_Array_Type(0 .. nlegend - 1) := (others => TUB(" ")); + begin + pladv(0); + plvpor(0.25, 0.75, 0.25, 0.75); + plwind(0.0, 1.0, 0.0, 1.0); + plbox("bc", 0.0, 0, "bc", 0.0, 0); + plsfont(PL_FCI_SANS, -1, -1); + plmtex("t", 8.0, 0.5, 0.5, "The effect of nrow, ncolumn, PL_LEGEND_ROW_MAJOR,"); + plmtex("t", 6.0, 0.5, 0.5, "and position for the same legend data"); + + -- Only specify legend data that are required according to the + -- value of opt_array for that entry. + opt_base := PL_LEGEND_BACKGROUND + PL_LEGEND_BOUNDING_BOX; + for k in 0 .. nlegend - 1 loop + opt_array(k) := PL_LEGEND_LINE + PL_LEGEND_SYMBOL; + line_styles(k) := 1; + line_widths(k) := 1; + symbol_scales(k) := 1.0; + symbol_numbers(k) := 2; + symbols(k) := TUB("*"); + -- Make 2-digit strings with leading 0 for 0 .. 9. + if k >= 10 then + text(k) := To_Unbounded_String(Trim(Integer'image(k), Left)); + else + text(k) := To_Unbounded_String("0" & Trim(Integer'image(k), Left)); + end if; + text_colors(k) := 1 + (k mod 8); + line_colors(k) := 1 + (k mod 8); + symbol_colors(k) := 1 + (k mod 8); + end loop; + + -- Use monotype fonts so that all legends are the same size. + plsfont(PL_FCI_MONO, -1, -1); + plscol0a(15, 32, 32, 32, 0.70); + + position := PL_POSITION_TOP + PL_POSITION_OUTSIDE; + opt := opt_base; + x := 0.0; + y := 0.1; + nrow := 1; + ncolumn := nlegend; + pllegend(legend_width, legend_height, position, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + opt_array, 1.0, 1.0, 2.0, + 1.0, text_colors, text, + Box_Colors, Box_Patterns, + Box_Scales, Box_Line_Widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols); + + position := PL_POSITION_BOTTOM + PL_POSITION_OUTSIDE; + opt := opt_base; + x := 0.0; + y := 0.1; + nrow := 1; + ncolumn := nlegend; + pllegend(legend_width, legend_height, position, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + opt_array, 1.0, 1.0, 2.0, + 1.0, text_colors, text, + Box_Colors, Box_Patterns, + Box_Scales, Box_Line_Widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols); + + position := PL_POSITION_LEFT + PL_POSITION_OUTSIDE; + opt := opt_base; + x := 0.1; + y := 0.0; + nrow := nlegend; + ncolumn := 1; + pllegend(legend_width, legend_height, position, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + opt_array, 1.0, 1.0, 2.0, + 1.0, text_colors, text, + Box_Colors, Box_Patterns, + Box_Scales, Box_Line_Widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols); + + position := PL_POSITION_RIGHT + PL_POSITION_OUTSIDE; + opt := opt_base; + x := 0.1; + y := 0.0; + nrow := nlegend; + ncolumn := 1; + pllegend(legend_width, legend_height, position, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + opt_array, 1.0, 1.0, 2.0, + 1.0, text_colors, text, + Box_Colors, Box_Patterns, + Box_Scales, Box_Line_Widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols); + + position := PL_POSITION_LEFT + PL_POSITION_TOP + PL_POSITION_INSIDE; + opt := opt_base; + x := 0.0; + y := 0.0; + nrow := 6; + ncolumn := 2; + pllegend(legend_width, legend_height, position, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + opt_array, 1.0, 1.0, 2.0, + 1.0, text_colors, text, + Box_Colors, Box_Patterns, + Box_Scales, Box_Line_Widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols); + + position := PL_POSITION_RIGHT + PL_POSITION_TOP + PL_POSITION_INSIDE; + opt := opt_base + PL_LEGEND_ROW_MAJOR; + x := 0.0; + y := 0.0; + nrow := 6; + ncolumn := 2; + pllegend(legend_width, legend_height, position, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + opt_array, 1.0, 1.0, 2.0, + 1.0, text_colors, text, + Box_Colors, Box_Patterns, + Box_Scales, Box_Line_Widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols); + + position := PL_POSITION_BOTTOM + PL_POSITION_INSIDE; + opt := opt_base + PL_LEGEND_ROW_MAJOR; + x := 0.0; + y := 0.0; + nrow := 3; + ncolumn := 3; + pllegend(legend_width, legend_height, position, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + opt_array, 1.0, 1.0, 2.0, + 1.0, text_colors, text, + Box_Colors, Box_Patterns, + Box_Scales, Box_Line_Widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols); + end; -- declare + + -- Third page demonstrating legend alignment + pladv(0); + plvpor(0.0, 1.0, 0.0, 0.9); + plwind(0.0, 1.0, 0.0, 1.0); + plsfont(PL_FCI_SANS, -1, -1); + plmtex("t", 2.0, 0.5, 0.5, "Demonstrate legend alignment"); + + x := 0.1; + y := 0.1; + nturn := 4; + nlegend := 0; + position := PL_POSITION_TOP + PL_POSITION_LEFT + PL_POSITION_SUBPAGE; + opt_base := PL_LEGEND_BACKGROUND + PL_LEGEND_BOUNDING_BOX; + opt := opt_base; + for i in 0 .. 8 loop + + -- Set up legend arrays with the correct size, type. + if i <= nturn then + nlegend := nlegend + 1; + else + nlegend := nlegend - 1; + end if; + nlegend := Integer'max(1, nlegend); + declare + opt_array : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + text_colors : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + box_colors : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + box_patterns : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + box_scales : Real_Vector (0 .. nlegend - 1) := (others => 0.0); + box_line_widths : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + line_colors : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + line_styles : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + line_widths : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + symbol_numbers : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + symbol_colors : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + symbol_scales : Real_Vector (0 .. nlegend - 1) := (others => 0.0); + text : Legend_String_Array_Type(0 .. nlegend - 1) := (others => TUB(" ")); + symbols : Legend_String_Array_Type(0 .. nlegend - 1) := (others => TUB(" ")); + begin + -- Only specify legend data that are required according to the + -- value of opt_array for that entry. + for k in 0 .. nlegend - 1 loop + opt_array(k) := PL_LEGEND_LINE + PL_LEGEND_SYMBOL; + line_styles(k) := 1; + line_widths(k) := 1; + symbol_scales(k) := 1.0; + symbol_numbers(k) := 2; + symbols(k) := TUB("*"); + -- Make 2-digit strings with leading 0 for 0 .. 9. + if k >= 10 then + text(k) := To_Unbounded_String(Trim(Integer'image(k), Left)); + else + text(k) := To_Unbounded_String("0" & Trim(Integer'image(k), Left)); + end if; + text_colors(k) := 1 + (k mod 8); + line_colors(k) := 1 + (k mod 8); + symbol_colors(k) := 1 + (k mod 8); + end loop; -- k + + -- Use monotype fonts so that all legends are the same size. + plsfont(PL_FCI_MONO, -1, -1); + plscol0a(15, 32, 32, 32, 0.70); + + nrow := Integer'min(3, nlegend); + ncolumn := 0; + + pllegend(legend_width, legend_height, position, opt, x, y, + 0.025, 15, 1, 1, nrow, ncolumn, + opt_array, 1.0, 1.0, 1.5, + 1.0, text_colors, text, + Box_Colors, Box_Patterns, + Box_Scales, Box_Line_Widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols); + + if i = nturn then + position := PL_POSITION_TOP + PL_POSITION_RIGHT + PL_POSITION_SUBPAGE; + opt := opt_base; + x := 1.0 - x; + y := y + legend_height; + else + x := x + legend_width; + y := y + legend_height; + end if; + end; -- declare + end loop; -- i + + -- Fourth page illustrating various kinds of legends + declare + nlegend : constant Integer := 5; + opt_array : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + text_colors : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + box_colors : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + box_patterns : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + box_scales : Real_Vector (0 .. nlegend - 1) := (others => 0.0); + box_line_widths : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + line_colors : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + line_styles : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + line_widths : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + symbol_numbers : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + symbol_colors : Integer_Array_1D(0 .. nlegend - 1) := (others => 0); + symbol_scales : Real_Vector (0 .. nlegend - 1) := (others => 0.0); + text : Legend_String_Array_Type(0 .. nlegend - 1) := (others => TUB(" ")); + symbols : Legend_String_Array_Type(0 .. nlegend - 1) := (others => TUB(" ")); + begin + max_height := 0.0; + xstart := 0.0; + ystart := 0.1; + x := xstart; + y := ystart; + text_scale := 0.90; + pladv(0); + plvpor(0.0, 1.0, 0.0, 0.90); + plwind(0.0, 1.0, 0.0, 1.0); + plsfont(PL_FCI_SANS, -1, -1); + plmtex("t", 2.0, 0.5, 0.5, "Demonstrate Various Kinds of Legends"); + + -- Only specify legend data that are required according to the + -- value of opt_array for that entry. + position := PL_POSITION_LEFT + PL_POSITION_TOP; + opt_base := PL_LEGEND_BACKGROUND + PL_LEGEND_BOUNDING_BOX + PL_LEGEND_TEXT_LEFT; + + -- Set up None, Box, Line, Symbol, and Line & Symbol legend entries. + opt_array(0) := PL_LEGEND_NONE; + text(0) := TUB("None"); + text_colors(0) := 1; + + opt_array(1) := PL_LEGEND_COLOR_BOX; + text(1) := TUB("Box"); + text_colors(1) := 2; + box_colors(1) := 2; + box_patterns(1) := 0; + box_scales(1) := 0.8; + box_line_widths(1) := 1; + + opt_array(2) := PL_LEGEND_LINE; + text(2) := TUB("Line"); + text_colors(2) := 3; + line_colors(2) := 3; + line_styles(2) := 1; + line_widths(2) := 1; + + opt_array(3) := PL_LEGEND_SYMBOL; + text(3) := TUB("Symbol"); + text_colors(3) := 4; + symbol_colors(3) := 4; + symbol_scales(3) := text_scale; + symbol_numbers(3) := 4; + symbols(3) := special_symbols(2); + + opt_array(4) := PL_LEGEND_SYMBOL + PL_LEGEND_LINE; + text(4) := TUB("L & S"); + text_colors(4) := 5; + line_colors(4) := 5; + line_styles(4) := 1; + line_widths(4) := 1; + symbol_colors(4) := 5; + symbol_scales(4) := text_scale; + symbol_numbers(4) := 4; + symbols(4) := special_symbols(2); + + opt := opt_base; + plscol0a(15, 32, 32, 32, 0.70); + + pllegend(legend_width, legend_height, position, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, text_scale, 2.0, + 0.0, text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols); + max_height := Long_Float'max(max_height, legend_height); + + -- Set up symbol legend entries with various symbols. + for i in 0 .. nlegend - 1 loop + opt_array(i) := PL_LEGEND_SYMBOL; + text(i) := TUB("Symbol ") & special_symbols(i); + text_colors(i) := i + 1; + symbol_colors(i) := i + 1; + symbol_scales(i) := text_scale; + symbol_numbers(i) := 4; + symbols(i) := special_symbols(i); + end loop; + + opt := opt_base; + x := x + legend_width; + plscol0a(15, 32, 32, 32, 0.70); + + pllegend(legend_width, legend_height, position, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, text_scale, 2.0, + 0.0, text_colors, text, + Box_Colors, Box_Patterns, + Box_Scales, Box_Line_Widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols); + max_height := Long_Float'max(max_height, legend_height); + + -- Set up symbol legend entries with various numbers of symbols. + for i in 0 .. nlegend - 1 loop + opt_array(i) := PL_LEGEND_SYMBOL; + text(i) := TUB("Symbol Number" & Integer'image(i + 2)); + text_colors(i) := i + 1; + symbol_colors(i) := i + 1; + symbol_scales(i) := text_scale; + symbol_numbers(i) := i + 2; + symbols(i) := special_symbols(2); + end loop; + + opt := opt_base; + x := x + legend_width; + plscol0a(15, 32, 32, 32, 0.70); + + pllegend(legend_width, legend_height, position, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, text_scale, 2.0, + 0.0, text_colors, text, + Box_Colors, Box_Patterns, + Box_Scales, Box_Line_Widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols); + max_height := Long_Float'max(max_height, legend_height); + + -- Set up box legend entries with various colours. + for i in 0 .. nlegend - 1 loop + opt_array(i) := PL_LEGEND_COLOR_BOX; + text(i) := TUB("Box Color" & Integer'image(i + 1)); + text_colors(i) := i + 1; + box_colors(i) := i + 1; + box_patterns(i) := 0; + box_scales(i) := 0.8; + box_line_widths(i) := 1; + end loop; + + opt := opt_base; + -- Use new origin + x := xstart; + y := y + max_height; + max_height := 0.0; + plscol0a(15, 32, 32, 32, 0.70); + + pllegend(legend_width, legend_height, position, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, text_scale, 2.0, + 0.0, text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols); + max_height := Long_Float'max(max_height, legend_height); + + -- Set up box legend entries with various patterns. + for i in 0 .. nlegend - 1 loop + opt_array(i) := PL_LEGEND_COLOR_BOX; + text(i) := TUB("Box Pattern" & Integer'image(i)); + text_colors(i) := 2; + box_colors(i) := 2; + box_patterns(i) := i; + box_scales(i) := 0.8; + box_line_widths(i) := 1; + end loop; + + opt := opt_base; + x := x + legend_width; + plscol0a(15, 32, 32, 32, 0.70); + + pllegend(legend_width, legend_height, position, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, text_scale, 2.0, + 0.0, text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols); + max_height := Long_Float'max(max_height, legend_height); + + -- Set up box legend entries with various box pattern line widths. + for i in 0 .. nlegend - 1 loop + opt_array(i) := PL_LEGEND_COLOR_BOX; + text(i) := TUB("Box Line Width" & Integer'image(i + 1)); + text_colors(i) := 2; + box_colors(i) := 2; + box_patterns(i) := 3; + box_scales(i) := 0.8; + box_line_widths(i) := i + 1; + end loop; + + opt := opt_base; + x := x + legend_width; + plscol0a(15, 32, 32, 32, 0.70); + + pllegend(legend_width, legend_height, position, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, text_scale, 2.0, + 0.0, text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols); + max_height := Long_Float'max(max_height, legend_height); + + -- Set up line legend entries with various colours. + for i in 0 .. nlegend - 1 loop + opt_array(i) := PL_LEGEND_LINE; + text(i) := TUB("Line Color" & Integer'image(i + 1)); + text_colors(i) := i + 1; + line_colors(i) := i + 1; + line_styles(i) := 1; + line_widths(i) := 1; + end loop; + + opt := opt_base; + -- Use new origin + x := xstart; + y := y + max_height; + max_height := 0.0; + plscol0a(15, 32, 32, 32, 0.70); + + pllegend(legend_width, legend_height, position, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, text_scale, 2.0, + 0.0, text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols); + max_height := Long_Float'max(max_height, legend_height); + + -- Set up line legend entries with various styles. + for i in 0 .. nlegend - 1 loop + opt_array(i) := PL_LEGEND_LINE; + text(i) := TUB("Line Style" & Integer'image(i + 1)); + text_colors(i) := 2; + line_colors(i) := 2; + line_styles(i) := i + 1; + line_widths(i) := 1; + end loop; + + opt := opt_base; + x := x + legend_width; + plscol0a(15, 32, 32, 32, 0.70); + + pllegend(legend_width, legend_height, position, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, text_scale, 2.0, + 0.0, text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols); + max_height := Long_Float'max(max_height, legend_height); + + -- Set up line legend entries with various widths. + for i in 0 .. nlegend - 1 loop + opt_array(i) := PL_LEGEND_LINE; + text(i) := TUB("Line Width" & Integer'image(i + 1)); + text_colors(i) := 2; + line_colors(i) := 2; + line_styles(i) := 1; + line_widths(i) := i + 1; + end loop; + + opt := opt_base; + x := x + legend_width; + plscol0a(15, 32, 32, 32, 0.70); + + pllegend(legend_width, legend_height, position, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, text_scale, 2.0, + 0.0, text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols); + max_height := Long_Float'max(max_height, legend_height); + end; -- declare + +-- if colorbar then + -- -- Color bar examples + -- values_small : Real_Vector(0 .. 1) := (0.0, 1.0); + -- values_uneven : Real_Vector(0 .. 8) := (0.0, 2.0, 2.6, 3.4, 6.0, 7.0, 8.0, 9.0, 10.0); + -- values_even : Real_Vector(0 .. 8) := (0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0); + -- plcolorbar_example_1(PL_COLORBAR_IMAGE, 0, 0, 0.0, 0, 2, values_small, "Image Color Bars"); + -- plcolorbar_example_2(PL_COLORBAR_IMAGE, 0, 0, 0.0, 0, 2, values_small, "Image Color Bars"); + -- plcolorbar_example_1(PL_COLORBAR_SHADE + PL_COLORBAR_SHADE_LABEL, 0, 0, 0.0, 0, 9, values_uneven, + -- "Shade Color Bars - Uneven Steps"); + -- plcolorbar_example_2(PL_COLORBAR_SHADE, 0, 0, 3.0, 3, 9, values_even, + -- "Shade Color Bars - Even Steps"); + -- plcolorbar_example_1(PL_COLORBAR_SHADE + PL_COLORBAR_SHADE_LABEL, 2, 1, 0.0, 0, 9, values_uneven, + -- "Shade Color Bars - Uneven Steps, Contours"); + -- plcolorbar_example_2(PL_COLORBAR_SHADE, 2, 3, 3.0, 3, 9, values_even, + -- "Shade Color Bars - Even Steps, Contours"); + -- plcolorbar_example_1(PL_COLORBAR_GRADIENT, 0, 0, 0.5, 5, 2, values_small, + -- "Gradient Color Bars"); + -- plcolorbar_example_2(PL_COLORBAR_GRADIENT, 0, 0, 0.5, 5, 2, values_small, + -- "Gradient Color Bars"); +-- end if; + + plend; +end x33a; + Added: trunk/examples/ada/xthick33a.adb =================================================================== --- trunk/examples/ada/xthick33a.adb (rev 0) +++ trunk/examples/ada/xthick33a.adb 2011-04-07 07:30:32 UTC (rev 11687) @@ -0,0 +1,897 @@ +-- -*- coding: utf-8; -*- +-- +-- $Id: x33c.c 11680 2011-03-27 17:57:51Z airwin $ +-- +-- Demonstrate most Create_Legend capability including unicode symbols. +-- +-- Copyright (C) 2011 Jerry Bauck +-- +-- This file is part of PLplot. +-- +-- PLplot is free software; you can redistribute it and/or modify +-- it under the terms of the GNU Library General Public License as published +-- by the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- PLplot is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU Library General Public License for more details. +-- +-- You should have received a copy of the GNU Library General Public License +-- along with PLplot; if not, write to the Free Software +-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +-- + +-- This example designed just for devices (e.g., the cairo-related and +-- qt-related devices) where the best choice of glyph is automatically +-- selected by the related libraries (pango/cairo or Qt4) for each +-- unicode character depending on what system fonts are installed. Of +-- course, you must have the appropriate TrueType fonts installed to +-- have access to all the required glyphs. + +-- Ada note: The function TUB is Ada.Strings.Unbounded.To_Unbounded_String +-- renamed. See PLplot_Traditional.ads or PLplot.ads. +-- Also, several arguments to Create_Legend have been left in their integer +-- forms when specialized meanings are available, e.g., 15 instead of White. + +with + Ada.Strings.Unbounded, + Ada.Strings, + Ada.Strings.Fixed, + PLplot_Auxiliary, + PLplot; +use + Ada.Strings.Unbounded, + Ada.Strings, + Ada.Strings.Fixed, + PLplot_Auxiliary, + PLplot; + +procedure xthick33a is + position_options : Integer_Array_1D(0 .. 15) := + (Legend_Position_Left + Legend_Position_Top + Legend_Position_Outside, + Legend_Position_Top + Legend_Position_Outside, + Legend_Position_Right + Legend_Position_Top + Legend_Position_Outside, + Legend_Position_Right + Legend_Position_Outside, + Legend_Position_Right + Legend_Position_Bottom + Legend_Position_Outside, + Legend_Position_Bottom + Legend_Position_Outside, + Legend_Position_Left + Legend_Position_Bottom + Legend_Position_Outside, + Legend_Position_Left + Legend_Position_Outside, + Legend_Position_Left + Legend_Position_Top + Legend_Position_Inside, + Legend_Position_Top + Legend_Position_Inside, + Legend_Position_Right + Legend_Position_Top + Legend_Position_Inside, + Legend_Position_Right + Legend_Position_Inside, + Legend_Position_Right + Legend_Position_Bottom + Legend_Position_Inside, + Legend_Position_Bottom + Legend_Position_Inside, + Legend_Position_Left + Legend_Position_Bottom + Legend_Position_Inside, + Legend_Position_Left + Legend_Position_Inside); + + -- Pick 5 arbitrary UTF-8 symbols useful for plotting points (✠✚✱✪✽✺✰✴✦). + special_symbols : Legend_String_Array_Type(0 .. 4) := + (TUB("✰"), TUB("✴"), TUB("✱"), TUB("✽"), TUB("✦")); + + colorbar : Boolean := False; -- By default do not plot plcolorbar pages + -- for now while we are working out the API. + +-- static PLOptionTable options() := { +-- { +-- "colorbar", -- Turns on pages showing colorbars +-- NULL, +-- NULL, +-- &colorbar, +-- PL_OPT_BOOL, +-- "-colorbar", +-- "Plot the \"color bar\" pages." +-- }, +-- { +-- NULL, -- option +-- NULL, -- handler +-- NULL, -- client data +-- NULL, -- address of variable to set +-- 0, -- mode flag +-- NULL, -- short syntax +-- NULL +-- } -- long syntax +-- }; + +--const char *notes() := { "Make sure you get it right!", NULL }; + + --procedure plcolorbar_example_1(PLINT bar_type, PLINT cont_color, PLINT cont_width, PLFLT ticks, PLINT sub_ticks, PLINT n, PLFLT *values, const char *title) + + + -- procedure plcolorbar_example_1 + -- (bar_type, cont_color, cont_width : Integer; + -- ticks : Long_Float; + -- sub_ticks, n : Integer; + -- values : Real_Vector; + -- title : Unbounded_String) + -- is + -- colors : Real_Vector(0 .. n - 1); + -- i : Integer; + -- color_step, color_offset : Long_Float; + -- position, opt : Integer; + -- axis_opts_1, axis_opts_2 : Unbounded_String; + -- begin + -- Advance_To_Subpage(0); + -- + -- -- Set up color palette 1. + -- Set_Color_Map_1_From_File("cmap1_blue_red.pal", True); + -- + -- color_step := 1.0 / Long_Float(n - 1); + -- for i in 0 .. n - 1 loop + -- colors(i) := color_offset + color_step * Long_Float(i); -- COLOR_OFFSET NOT DEFINED! + -- end loop; + -- + -- position := Legend_Position_Left; + -- opt := bar_type + Colorbar_Label_Left + Colorbar_Cap_High; + -- + -- if bar_type and Colorbar_Shade_Label then + -- axis_opts_1 := To_Unbounded_String("iv"); + -- axis_opts_2 := To_Unbounded_String("i"); + -- else + -- if sub_ticks /= 0 then + -- axis_opts_1 := To_Unbounded_String("stv"); + -- axis_opts_2 := To_Unbounded_String("st"); + -- else + -- axis_opts_1 := To_Unbounded_String("tv"); + -- axis_opts_2 := To_Unbounded_String("t"); + -- end if; + -- end if; + -- + -- plcolorbar(position, opt, 0.1, 0.1, 0.5, 0.1, -- fixme + -- cont_color, cont_width, + -- ticks, sub_ticks, + -- axis_opts_1, "Test label - Left, High Cap", + -- n, colors, values); + -- + -- position := Legend_Position_Right; + -- opt := bar_type + Colorbar_Label_Right + Colorbar_Cap_Low; + -- + -- plcolorbar(position, opt, 0.1, 0.4, 0.5, 0.1, -- fixme etc. + -- cont_color, cont_width, + -- ticks, sub_ticks, + -- axis_opts_1, "Test label - Right, Low Cap", + -- n, colors, values); + -- + -- position := Legend_Position_Top; + -- opt := bar_type + Colorbar_Label_Top + Colorbar_Cap_High; + -- + -- plcolorbar(position, opt, 0.1, 0.1, 0.5, 0.1, + -- cont_color, cont_width, + -- ticks, sub_ticks, + -- axis_opts_2, "Test label - Top, High Cap", + -- n, colors, values); + -- + -- position := Legend_Position_Bottom; + -- opt := bar_type + Colorbar_Label_Bottom + Colorbar_Cap_Low; + -- + -- plcolorbar(position, opt, 0.4, 0.1, 0.5, 0.1, + -- cont_color, cont_width, + -- ticks, sub_ticks, + -- axis_opts_2, "Test label - Bottom, Low Cap", + -- n, colors, values); + -- + -- Set_Viewport_Normalized(0.0, 1.0, 0.0, 1.0); + -- Set_Viewport_World(0.0, 1.0, 0.0, 1.0); + -- Write_Text_World(0.5, 0.5, 0.0, 0.0, 0.5, To_String(title)); + -- end plcolorbar_example_1; + -- + -- + -- procedure plcolorbar_example_2 + -- (bar_type, cont_color, cont_width : Integer; + ... [truncated message content] |
From: <ai...@us...> - 2011-04-09 07:37:57
|
Revision: 11689 http://plplot.svn.sourceforge.net/plplot/?rev=11689&view=rev Author: airwin Date: 2011-04-09 07:37:51 +0000 (Sat, 09 Apr 2011) Log Message: ----------- Incorporate new Ada example 33 into build and test system. Modified Paths: -------------- trunk/examples/ada/CMakeLists.txt trunk/examples/ada/Makefile.examples.in trunk/plplot_test/test_ada.sh.in Modified: trunk/examples/ada/CMakeLists.txt =================================================================== --- trunk/examples/ada/CMakeLists.txt 2011-04-08 19:13:16 UTC (rev 11688) +++ trunk/examples/ada/CMakeLists.txt 2011-04-09 07:37:51 UTC (rev 11689) @@ -56,6 +56,7 @@ "29" "30" "31" + "33" "thick01" "thick02" "thick03" @@ -87,6 +88,7 @@ "thick29" "thick30" "thick31" + "thick33" ) if(CORE_BUILD) Modified: trunk/examples/ada/Makefile.examples.in =================================================================== --- trunk/examples/ada/Makefile.examples.in 2011-04-08 19:13:16 UTC (rev 11688) +++ trunk/examples/ada/Makefile.examples.in 2011-04-09 07:37:51 UTC (rev 11689) @@ -61,6 +61,7 @@ x29a$(EXEEXT) \ x30a$(EXEEXT) \ x31a$(EXEEXT) \ + x33a$(EXEEXT) \ xthick01a$(EXEEXT) \ xthick02a$(EXEEXT) \ xthick03a$(EXEEXT) \ @@ -91,7 +92,8 @@ xthick28a$(EXEEXT) \ xthick29a$(EXEEXT) \ xthick30a$(EXEEXT) \ - xthick31a$(EXEEXT) + xthick31a$(EXEEXT) \ + xthick33a$(EXEEXT) all: $(EXECUTABLES_list) Modified: trunk/plplot_test/test_ada.sh.in =================================================================== --- trunk/plplot_test/test_ada.sh.in 2011-04-08 19:13:16 UTC (rev 11688) +++ trunk/plplot_test/test_ada.sh.in 2011-04-09 07:37:51 UTC (rev 11689) @@ -32,10 +32,10 @@ for index in \ 01 02 03 04 05 06 07 08 09 \ 10 11 12 13 14 15 16 17 18 19 20 \ - 21 22 23 24 25 26 27 28 29 30 31 \ + 21 22 23 24 25 26 27 28 29 30 31 33 \ thick01 thick02 thick03 thick04 thick05 thick06 thick07 thick08 thick09 \ thick10 thick11 thick12 thick13 thick14 thick15 thick16 thick17 thick18 thick19 thick20 \ - thick21 thick22 thick23 thick24 thick25 thick26 thick27 thick28 thick29 thick30 thick31; do + thick21 thick22 thick23 thick24 thick25 thick26 thick27 thick28 thick29 thick30 thick31 thick33; do if [ "$verbose_test" ] ; then echo "x${index}" fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hez...@us...> - 2011-04-11 03:15:13
|
Revision: 11694 http://plplot.svn.sourceforge.net/plplot/?rev=11694&view=rev Author: hezekiahcarty Date: 2011-04-11 03:15:07 +0000 (Mon, 11 Apr 2011) Log Message: ----------- OCaml: Change plsfont to take variants rather than integers The result should be more readable and matches the C API more clearly. Modified Paths: -------------- trunk/bindings/ocaml/plplot.mli trunk/bindings/ocaml/plplot_core.idl trunk/bindings/ocaml/plplot_h trunk/bindings/ocaml/plplot_h.inc trunk/examples/ocaml/x23.ml Modified: trunk/bindings/ocaml/plplot.mli =================================================================== --- trunk/bindings/ocaml/plplot.mli 2011-04-10 20:59:22 UTC (rev 11693) +++ trunk/bindings/ocaml/plplot.mli 2011-04-11 03:15:07 UTC (rev 11694) @@ -628,6 +628,22 @@ | PL_COLORBAR_CAP_HIGH | PL_COLORBAR_SHADE_LABEL and plplot_colorbar_opt = plplot_colorbar_enum list +and plplot_fci_family_enum = + | PL_FCI_FAMILY_UNCHANGED + | PL_FCI_SANS + | PL_FCI_SERIF + | PL_FCI_MONO + | PL_FCI_SCRIPT + | PL_FCI_SYMBOL +and plplot_fci_style_enum = + | PL_FCI_STYLE_UNCHANGED + | PL_FCI_UPRIGHT + | PL_FCI_ITALIC + | PL_FCI_OBLIQUE +and plplot_fci_weight_enum = + | PL_FCI_WEIGHT_UNCHANGED + | PL_FCI_MEDIUM + | PL_FCI_BOLD external pl_setcontlabelformat : int -> int -> unit = "camlidl_plplot_core_c_pl_setcontlabelformat" external pl_setcontlabelparam : float -> float -> float -> int -> unit @@ -848,7 +864,8 @@ external plsfam : int -> int -> int -> unit = "camlidl_plplot_core_c_plsfam" external plsfci : int64 -> unit = "camlidl_plplot_core_c_plsfci" external plsfnam : string -> unit = "camlidl_plplot_core_c_plsfnam" -external plsfont : int -> int -> int -> unit +external plsfont : plplot_fci_family_enum -> plplot_fci_style_enum -> + plplot_fci_weight_enum -> unit = "camlidl_plplot_core_c_plsfont" external plsmaj : float -> float -> unit = "camlidl_plplot_core_c_plsmaj" external plsmin : float -> float -> unit = "camlidl_plplot_core_c_plsmin" Modified: trunk/bindings/ocaml/plplot_core.idl =================================================================== --- trunk/bindings/ocaml/plplot_core.idl 2011-04-10 20:59:22 UTC (rev 11693) +++ trunk/bindings/ocaml/plplot_core.idl 2011-04-11 03:15:07 UTC (rev 11694) @@ -96,6 +96,29 @@ }; typedef [set] enum plplot_colorbar_enum plplot_colorbar_opt; +enum plplot_fci_family_enum { + // = These are legal values for font family attribute + PL_FCI_FAMILY_UNCHANGED = -1, + PL_FCI_SANS = 0x0, + PL_FCI_SERIF = 0x1, + PL_FCI_MONO = 0x2, + PL_FCI_SCRIPT = 0x3, + PL_FCI_SYMBOL = 0x4 +}; +enum plplot_fci_style_enum { + // = These are legal values for font style attribute + PL_FCI_STYLE_UNCHANGED = -1, + PL_FCI_UPRIGHT = 0x0, + PL_FCI_ITALIC = 0x1, + PL_FCI_OBLIQUE = 0x2 +}; +enum plplot_fci_weight_enum { + // = These are legal values for font weight attribute + PL_FCI_WEIGHT_UNCHANGED = -1, + PL_FCI_MEDIUM = 0x0, + PL_FCI_BOLD = 0x1 +}; + // Any function which has a nonzero_error_int return type will raise // an Invalid_argument error if the return value is <> 0. typedef [errorcheck(plplot_check_nonzero_result), errorcode] int nonzero_error_int; Modified: trunk/bindings/ocaml/plplot_h =================================================================== --- trunk/bindings/ocaml/plplot_h 2011-04-10 20:59:22 UTC (rev 11693) +++ trunk/bindings/ocaml/plplot_h 2011-04-11 03:15:07 UTC (rev 11694) @@ -463,7 +463,7 @@ c_plsfnam(const char *fnam); void -c_plsfont(PLINT family, PLINT style, PLINT weight); +c_plsfont( enum plplot_fci_family_enum family, enum plplot_fci_style_enum style, enum plplot_fci_weight_enum weight); /* void Modified: trunk/bindings/ocaml/plplot_h.inc =================================================================== --- trunk/bindings/ocaml/plplot_h.inc 2011-04-10 20:59:22 UTC (rev 11693) +++ trunk/bindings/ocaml/plplot_h.inc 2011-04-11 03:15:07 UTC (rev 11694) @@ -108,7 +108,7 @@ [mlname(plsfam)] void c_plsfam ( int fam, int num, int bmax ); [mlname(plsfci)] void c_plsfci ( long long fci ); [mlname(plsfnam)] void c_plsfnam ( [string] const char * fnam ); -[mlname(plsfont)] void c_plsfont ( int family, int style, int weight ); +[mlname(plsfont)] void c_plsfont ( enum plplot_fci_family_enum family, enum plplot_fci_style_enum style, enum plplot_fci_weight_enum weight ); [mlname(plsmaj)] void c_plsmaj ( double def, double scale ); [mlname(plsmin)] void c_plsmin ( double def, double scale ); [mlname(plsori)] void c_plsori ( int ori ); Modified: trunk/examples/ocaml/x23.ml =================================================================== --- trunk/examples/ocaml/x23.ml 2011-04-10 20:59:22 UTC (rev 11693) +++ trunk/examples/ocaml/x23.ml 2011-04-11 03:15:07 UTC (rev 11694) @@ -215,6 +215,25 @@ "bold"; |] +let family_of_int = [| + PL_FCI_SANS; + PL_FCI_SERIF; + PL_FCI_MONO; + PL_FCI_SCRIPT; + PL_FCI_SYMBOL; +|] + +let style_of_int = [| + PL_FCI_UPRIGHT; + PL_FCI_ITALIC; + PL_FCI_OBLIQUE; +|] + +let weight_of_int = [| + PL_FCI_MEDIUM; + PL_FCI_BOLD; +|] + let () = plparseopts Sys.argv [PL_PARSE_FULL]; @@ -320,7 +339,8 @@ style.(style_index) weight.(weight_index); | 12 -> - plsfont family_index style_index weight_index; + plsfont family_of_int.(family_index) style_of_int.(style_index) + weight_of_int.(weight_index); sprintf "Page 13, %s, %s, %s: The quick brown fox jumps over the lazy dog" family.(family_index) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hez...@us...> - 2011-04-11 03:16:24
|
Revision: 11695 http://plplot.svn.sourceforge.net/plplot/?rev=11695&view=rev Author: hezekiahcarty Date: 2011-04-11 03:16:17 +0000 (Mon, 11 Apr 2011) Log Message: ----------- Add OCaml example 33 (pllegend portion only) "make test_diff_psc" is clean again for OCaml. Modified Paths: -------------- trunk/examples/ocaml/CMakeLists.txt trunk/plplot_test/test_ocaml.sh.in Added Paths: ----------- trunk/examples/ocaml/x33.ml Modified: trunk/examples/ocaml/CMakeLists.txt =================================================================== --- trunk/examples/ocaml/CMakeLists.txt 2011-04-11 03:15:07 UTC (rev 11694) +++ trunk/examples/ocaml/CMakeLists.txt 2011-04-11 03:16:17 UTC (rev 11695) @@ -60,6 +60,7 @@ "29" "30" "31" + "33" "plot01" ) Added: trunk/examples/ocaml/x33.ml =================================================================== --- trunk/examples/ocaml/x33.ml (rev 0) +++ trunk/examples/ocaml/x33.ml 2011-04-11 03:16:17 UTC (rev 11695) @@ -0,0 +1,647 @@ +(* -*- coding: utf-8; -*- +$Id$ + +Demonstrate most pllegend capability including unicode symbols. + +Copyright (C) 2010 Alan Irwin +Copyright (C) 2011 Hezekiah M. Carty + +This file is part of PLplot. + +PLplot is free software; you can redistribute it and/or modify +it under the terms of the GNU Library General Public License as published +by the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +PLplot is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Library General Public License for more details. + +You should have received a copy of the GNU Library General Public License +along with PLplot; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *) + +(* This example designed just for devices (e.g., the cairo-related and + qt-related devices) where the best choice of glyph is automatically + selected by the related libraries (pango/cairo or Qt4) for each + unicode character depending on what system fonts are installed. Of + course, you must have the appropriate TrueType fonts installed to + have access to all the required glyphs. *) + +open Plplot +open Printf + +let position_options = [| + [PL_POSITION_LEFT; PL_POSITION_TOP; PL_POSITION_OUTSIDE]; + [PL_POSITION_TOP; PL_POSITION_OUTSIDE]; + [PL_POSITION_RIGHT; PL_POSITION_TOP; PL_POSITION_OUTSIDE]; + [PL_POSITION_RIGHT; PL_POSITION_OUTSIDE]; + [PL_POSITION_RIGHT; PL_POSITION_BOTTOM; PL_POSITION_OUTSIDE]; + [PL_POSITION_BOTTOM; PL_POSITION_OUTSIDE]; + [PL_POSITION_LEFT; PL_POSITION_BOTTOM; PL_POSITION_OUTSIDE]; + [PL_POSITION_LEFT; PL_POSITION_OUTSIDE]; + [PL_POSITION_LEFT; PL_POSITION_TOP; PL_POSITION_INSIDE]; + [PL_POSITION_TOP; PL_POSITION_INSIDE]; + [PL_POSITION_RIGHT; PL_POSITION_TOP; PL_POSITION_INSIDE]; + [PL_POSITION_RIGHT; PL_POSITION_INSIDE]; + [PL_POSITION_RIGHT; PL_POSITION_BOTTOM; PL_POSITION_INSIDE]; + [PL_POSITION_BOTTOM; PL_POSITION_INSIDE]; + [PL_POSITION_LEFT; PL_POSITION_BOTTOM; PL_POSITION_INSIDE]; + [PL_POSITION_LEFT; PL_POSITION_INSIDE]; +|] + +(* Pick 5 arbitrary UTF-8 symbols useful for plotting points (✠✚✱✪✽✺✰✴✦). *) +let special_symbols = [| + "✰"; + "✴"; + "✱"; + "✽"; + "✦"; +|] + +(* main + Demonstrate most pllegend capability including unicode symbols. *) + +let max_nlegend = 7 + +let () = + let opt_array = Array.make max_nlegend [] in + let box_colors = Array.make max_nlegend 0 in + let box_patterns = Array.make max_nlegend 0 in + let box_scales = Array.make max_nlegend 0.0 in + let box_line_widths = Array.make max_nlegend 0 in + let line_colors = Array.make max_nlegend 0 in + let line_styles = Array.make max_nlegend 0 in + let line_widths = Array.make max_nlegend 0 in + let symbol_numbers = Array.make max_nlegend 0 in + let symbol_colors = Array.make max_nlegend 0 in + let symbol_scales = Array.make max_nlegend 0.0 in + let symbols = Array.make max_nlegend "" in + let text = Array.make max_nlegend "" in + let text_colors = Array.make max_nlegend 0 in + + (* Parse and process command line arguments *) + plparseopts Sys.argv [PL_PARSE_FULL]; + + (* Initialize plplot *) + plinit (); + + (* First page illustrating the 16 standard positions. *) + pladv 0; + plvpor 0.25 0.75 0.25 0.75; + plwind 0.0 1.0 0.0 1.0; + plbox "bc" 0.0 0 "bc" 0.0 0; + plsfont PL_FCI_SANS PL_FCI_STYLE_UNCHANGED PL_FCI_WEIGHT_UNCHANGED; + plmtex "t" 8.0 0.5 0.5 "The 16 standard legend positions with"; + plmtex "t" 6.0 0.5 0.5 "the same (0.05) offset in x and y"; + + let nlegend = 1 in + (* Only specify legend data that are required according to the + value of opt_array for that entry. *) + let opt_base = [PL_LEGEND_BACKGROUND; PL_LEGEND_BOUNDING_BOX] in + opt_array.(0) <- [PL_LEGEND_LINE; PL_LEGEND_SYMBOL]; + line_styles.(0) <- 1; + line_widths.(0) <- 1; + symbol_scales.(0) <- 1.; + symbol_numbers.(0) <- 4; + symbols.(0) <- "*"; + + (* Use monotype fonts so that all legends are the same size. *) + plsfont PL_FCI_MONO PL_FCI_STYLE_UNCHANGED PL_FCI_WEIGHT_UNCHANGED; + plscol0a 15 32 32 32 0.70; + + for k = 0 to 15 do + let opt_array = Array.sub opt_array 0 nlegend in + let position = position_options.(k) in + let opt = opt_base in + text.(0) <- sprintf "%2.2d" k; + text_colors.(0) <- 1 + ( k mod 8 ); + line_colors.(0) <- 1 + ( k mod 8 ); + symbol_colors.(0) <- 1 + ( k mod 8 ); + + ignore ( + pllegend position opt 0.05 0.05 + 0.1 15 1 1 0 0 + opt_array 1.0 1.0 2.0 + 1.0 text_colors text + [||] [||] [||] [||] + line_colors line_styles line_widths + symbol_colors symbol_scales symbol_numbers symbols + ); + done; + + (* Second page illustrating effect of nrow, ncolumn for the same legend + data. *) + pladv 0; + plvpor 0.25 0.75 0.25 0.75; + plwind 0.0 1.0 0.0 1.0; + plbox "bc" 0.0 0 "bc" 0.0 0; + plsfont PL_FCI_SANS PL_FCI_STYLE_UNCHANGED PL_FCI_WEIGHT_UNCHANGED; + plmtex "t" 8.0 0.5 0.5 "The effect of nrow, ncolumn, PL_LEGEND_ROW_MAJOR,"; + plmtex "t" 6.0 0.5 0.5 "and position for the same legend data"; + + let nlegend = 7 in + + (* Only specify legend data that are required according to the + value of opt_array for that entry. *) + let opt_base = [PL_LEGEND_BACKGROUND; PL_LEGEND_BOUNDING_BOX] in + for k = 0 to nlegend - 1 do + opt_array.(k) <- [PL_LEGEND_LINE; PL_LEGEND_SYMBOL]; + line_styles.(k) <- 1; + line_widths.(k) <- 1; + symbol_scales.(k) <- 1.0; + symbol_numbers.(k) <- 2; + symbols.(k) <- "*"; + text.(k) <- sprintf "%2.2d" k; + text_colors.(k) <- 1 + (k mod 8); + line_colors.(k) <- 1 + (k mod 8); + symbol_colors.(k) <- 1 + (k mod 8); + done; + + (* Use monotype fonts so that all legends are the same size. *) + plsfont PL_FCI_MONO PL_FCI_STYLE_UNCHANGED PL_FCI_WEIGHT_UNCHANGED; + plscol0a 15 32 32 32 0.70; + + let position = [PL_POSITION_TOP; PL_POSITION_OUTSIDE] in + let opt = opt_base in + let x = 0.0 in + let y = 0.1 in + let nrow = 1 in + let ncolumn = nlegend in + ignore ( + let opt_array = Array.sub opt_array 0 nlegend in + pllegend position opt x y + 0.05 15 1 1 nrow ncolumn + opt_array 1.0 1.0 2.0 + 1.0 text_colors text + [||] [||] [||] [||] + line_colors line_styles line_widths + symbol_colors symbol_scales symbol_numbers symbols; + ); + + let position = [PL_POSITION_BOTTOM; PL_POSITION_OUTSIDE] in + let opt = opt_base in + let x = 0.0 in + let y = 0.1 in + let nrow = 1 in + let ncolumn = nlegend in + ignore ( + let opt_array = Array.sub opt_array 0 nlegend in + pllegend position opt x y + 0.05 15 1 1 nrow ncolumn + opt_array 1.0 1.0 2.0 + 1.0 text_colors text + [||] [||] [||] [||] + line_colors line_styles line_widths + symbol_colors symbol_scales symbol_numbers symbols + ); + + let position = [PL_POSITION_LEFT; PL_POSITION_OUTSIDE] in + let opt = opt_base in + let x = 0.1 in + let y = 0.0 in + let nrow = nlegend in + let ncolumn = 1 in + ignore ( + let opt_array = Array.sub opt_array 0 nlegend in + pllegend position opt x y + 0.05 15 1 1 nrow ncolumn + opt_array 1.0 1.0 2.0 + 1.0 text_colors text + [||] [||] [||] [||] + line_colors line_styles line_widths + symbol_colors symbol_scales symbol_numbers symbols; + ); + + let position = [PL_POSITION_RIGHT; PL_POSITION_OUTSIDE] in + let opt = opt_base in + let x = 0.1 in + let y = 0.0 in + let nrow = nlegend in + let ncolumn = 1 in + ignore ( + let opt_array = Array.sub opt_array 0 nlegend in + pllegend position opt x y + 0.05 15 1 1 nrow ncolumn + opt_array 1.0 1.0 2.0 + 1.0 text_colors text + [||] [||] [||] [||] + line_colors line_styles line_widths + symbol_colors symbol_scales symbol_numbers symbols + ); + + let position = [PL_POSITION_LEFT; PL_POSITION_TOP; PL_POSITION_INSIDE] in + let opt = opt_base in + let x = 0.0 in + let y = 0.0 in + let nrow = 6 in + let ncolumn = 2 in + ignore ( + let opt_array = Array.sub opt_array 0 nlegend in + pllegend position opt x y + 0.05 15 1 1 nrow ncolumn + opt_array 1.0 1.0 2.0 + 1.0 text_colors text + [||] [||] [||] [||] + line_colors line_styles line_widths + symbol_colors symbol_scales symbol_numbers symbols + ); + + let position = [PL_POSITION_RIGHT; PL_POSITION_TOP; PL_POSITION_INSIDE] in + let opt = PL_LEGEND_ROW_MAJOR :: opt_base in + let x = 0.0 in + let y = 0.0 in + let nrow = 6 in + let ncolumn = 2 in + ignore ( + let opt_array = Array.sub opt_array 0 nlegend in + pllegend position opt x y + 0.05 15 1 1 nrow ncolumn + opt_array 1.0 1.0 2.0 + 1.0 text_colors text + [||] [||] [||] [||] + line_colors line_styles line_widths + symbol_colors symbol_scales symbol_numbers symbols + ); + + let position = [PL_POSITION_BOTTOM; PL_POSITION_INSIDE] in + let opt = PL_LEGEND_ROW_MAJOR :: opt_base in + let x = 0.0 in + let y = 0.0 in + let nrow = 3 in + let ncolumn = 3 in + ignore ( + let opt_array = Array.sub opt_array 0 nlegend in + pllegend position opt x y + 0.05 15 1 1 nrow ncolumn + opt_array 1.0 1.0 2.0 + 1.0 text_colors text + [||] [||] [||] [||] + line_colors line_styles line_widths + symbol_colors symbol_scales symbol_numbers symbols + ); + + (* Third page demonstrating legend alignment *) + pladv 0; + plvpor 0.0 1.0 0.0 0.9; + plwind 0.0 1.0 0.0 1.0; + plsfont PL_FCI_SANS PL_FCI_STYLE_UNCHANGED PL_FCI_WEIGHT_UNCHANGED; + plmtex "t" 2.0 0.5 0.5 "Demonstrate legend alignment"; + + let x = ref 0.1 in + let y = ref 0.1 in + let nturn = 4 in + let nlegend = ref 0 in + let position = ref [PL_POSITION_TOP; PL_POSITION_LEFT; PL_POSITION_SUBPAGE] in + let opt_base = [PL_LEGEND_BACKGROUND; PL_LEGEND_BOUNDING_BOX] in + let opt = ref opt_base in + for i = 0 to 8 do + (* Set up legend arrays with the correct size, type. *) + if i <= nturn then + incr nlegend + else + decr nlegend; + nlegend := max 1 !nlegend; + (* Only specify legend data that are required according to the + value of opt_array for that entry. *) + for k = 0 to !nlegend - 1 do + opt_array.(k) <- [PL_LEGEND_LINE; PL_LEGEND_SYMBOL]; + line_styles.(k) <- 1; + line_widths.(k) <- 1; + symbol_scales.(k) <- 1.; + symbol_numbers.(k) <- 2; + symbols.(k) <- "*"; + text.(k) <- sprintf "%2.2d" k; + text_colors.(k) <- 1 + (k mod 8); + line_colors.(k) <- 1 + (k mod 8); + symbol_colors.(k) <- 1 + (k mod 8); + done; + (* Use monotype fonts so that all legends are the same size. *) + plsfont PL_FCI_MONO PL_FCI_STYLE_UNCHANGED PL_FCI_WEIGHT_UNCHANGED; + plscol0a 15 32 32 32 0.70; + + let nrow = min 3 !nlegend in + let ncolumn = 0 in + + let legend_width, legend_height = + let opt_array = Array.sub opt_array 0 !nlegend in + pllegend !position !opt !x !y + 0.025 15 1 1 nrow ncolumn + opt_array 1.0 1.0 1.5 + 1.0 text_colors text + [||] [||] [||] [||] + line_colors line_styles line_widths + symbol_colors symbol_scales symbol_numbers symbols + in + + if i = nturn then ( + position := [PL_POSITION_TOP; PL_POSITION_RIGHT; PL_POSITION_SUBPAGE]; + opt := opt_base; + x := 1.0 -. !x; + y := !y +. legend_height; + ) + else ( + x := !x +. legend_width; + y := !y +. legend_height; + ); + done; + + (* Fourth page illustrating various kinds of legends *) + let max_height = 0.0 in + let xstart = 0.0 in + let ystart = 0.1 in + let x = xstart in + let y = ystart in + let text_scale = 0.90 in + pladv 0; + plvpor 0.0 1.0 0.0 0.90; + plwind 0.0 1.0 0.0 1.0; + plsfont PL_FCI_SANS PL_FCI_STYLE_UNCHANGED PL_FCI_WEIGHT_UNCHANGED; + plmtex "t" 2.0 0.5 0.5 "Demonstrate Various Kinds of Legends"; + + let nlegend = 5 in + (* Only specify legend data that are required according to the + value of opt_array for that entry. *) + let position = [PL_POSITION_LEFT; PL_POSITION_TOP] in + let opt_base = [PL_LEGEND_BACKGROUND; PL_LEGEND_BOUNDING_BOX; PL_LEGEND_TEXT_LEFT] in + + (* Set up None, Box, Line, Symbol, and Line & Symbol legend entries. *) + opt_array.(0) <- [PL_LEGEND_NONE]; + text.(0) <- sprintf "%s" "None"; + text_colors.(0) <- 1; + + opt_array.(1) <- [PL_LEGEND_COLOR_BOX]; + text.(1) <- sprintf "%s" "Box"; + text_colors.(1) <- 2; + box_colors.(1) <- 2; + box_patterns.(1) <- 0; + box_scales.(1) <- 0.8; + box_line_widths.(1) <- 1; + + opt_array.(2) <- [PL_LEGEND_LINE]; + text.(2) <- sprintf "%s" "Line"; + text_colors.(2) <- 3; + line_colors.(2) <- 3; + line_styles.(2) <- 1; + line_widths.(2) <- 1; + + opt_array.(3) <- [PL_LEGEND_SYMBOL]; + text.(3) <- sprintf "%s" "Symbol"; + text_colors.(3) <- 4; + symbol_colors.(3) <- 4; + symbol_scales.(3) <- text_scale; + symbol_numbers.(3) <- 4; + symbols.(3) <- special_symbols.(2); + + opt_array.(4) <- [PL_LEGEND_SYMBOL; PL_LEGEND_LINE]; + text.(4) <- sprintf "%s" "L & S"; + text_colors.(4) <- 5; + line_colors.(4) <- 5; + line_styles.(4) <- 1; + line_widths.(4) <- 1; + symbol_colors.(4) <- 5; + symbol_scales.(4) <- text_scale; + symbol_numbers.(4) <- 4; + symbols.(4) <- special_symbols.(2); + + let opt = opt_base in + plscol0a 15 32 32 32 0.70; + + let legend_width, legend_height = + let opt_array = Array.sub opt_array 0 nlegend in + pllegend position opt x y + 0.1 15 1 1 0 0 + opt_array 1.0 text_scale 2.0 + 0.0 text_colors text + box_colors box_patterns box_scales box_line_widths + line_colors line_styles line_widths + symbol_colors symbol_scales symbol_numbers symbols + in + let max_height = max max_height legend_height in + + (* Set up symbol legend entries with various symbols. *) + for i = 0 to nlegend - 1 do + opt_array.(i) <- [PL_LEGEND_SYMBOL]; + text.(i) <- sprintf "%s%s" "Symbol " special_symbols.(i); + text_colors.(i) <- i + 1; + symbol_colors.(i) <- i + 1; + symbol_scales.(i) <- text_scale; + symbol_numbers.(i) <- 4; + symbols.(i) <- special_symbols.(i); + done; + + let opt = opt_base in + let x = x +. legend_width in + plscol0a 15 32 32 32 0.70; + + let legend_width, legend_height = + let opt_array = Array.sub opt_array 0 nlegend in + pllegend position opt x y + 0.1 15 1 1 0 0 + opt_array 1.0 text_scale 2.0 + 0.0 text_colors text + [||] [||] [||] [||] + [||] [||] [||] + symbol_colors symbol_scales symbol_numbers symbols + in + let max_height = max max_height legend_height in + + (* Set up symbol legend entries with various numbers of symbols. *) + for i = 0 to nlegend - 1 do + opt_array.(i) <- [PL_LEGEND_SYMBOL]; + text.(i) <- sprintf "%s %d" "Symbol Number" (i + 2); + text_colors.(i) <- i + 1; + symbol_colors.(i) <- i + 1; + symbol_scales.(i) <- text_scale; + symbol_numbers.(i) <- i + 2; + symbols.(i) <- special_symbols.(2); + done; + + let opt = opt_base in + let x = x +. legend_width in + plscol0a 15 32 32 32 0.70; + + let legend_width, legend_height = + let opt_array = Array.sub opt_array 0 nlegend in + pllegend position opt x y + 0.1 15 1 1 0 0 + opt_array 1.0 text_scale 2.0 + 0.0 text_colors text + [||] [||] [||] [||] + [||] [||] [||] + symbol_colors symbol_scales symbol_numbers symbols + in + let max_height = max max_height legend_height in + + (* Set up box legend entries with various colours. *) + for i = 0 to nlegend - 1 do + opt_array.(i) <- [PL_LEGEND_COLOR_BOX]; + text.(i) <- sprintf "%s %d" "Box Color" (i + 1); + text_colors.(i) <- i + 1; + box_colors.(i) <- i + 1; + box_patterns.(i) <- 0; + box_scales.(i) <- 0.8; + box_line_widths.(i) <- 1; + done; + + let opt = opt_base in + (* Use new origin *) + let x = xstart in + let y = y +. max_height in + let max_height = 0.0 in + plscol0a 15 32 32 32 0.70; + + let legend_width, legend_height = + let opt_array = Array.sub opt_array 0 nlegend in + pllegend position opt x y + 0.1 15 1 1 0 0 + opt_array 1.0 text_scale 2.0 + 0.0 text_colors text + box_colors box_patterns box_scales box_line_widths + [||] [||] [||] + [||] [||] [||] [||] + in + let max_height = max max_height legend_height in + + (* Set up box legend entries with various patterns. *) + for i = 0 to nlegend - 1 do + opt_array.(i) <- [PL_LEGEND_COLOR_BOX]; + text.(i) <- sprintf "%s %d" "Box Pattern" i; + text_colors.(i) <- 2; + box_colors.(i) <- 2; + box_patterns.(i) <- i; + box_scales.(i) <- 0.8; + box_line_widths.(i) <- 1; + done; + + let opt = opt_base in + let x = x +. legend_width in + plscol0a 15 32 32 32 0.70; + + let legend_width, legend_height = + let opt_array = Array.sub opt_array 0 nlegend in + pllegend position opt x y + 0.1 15 1 1 0 0 + opt_array 1.0 text_scale 2.0 + 0.0 text_colors text + box_colors box_patterns box_scales box_line_widths + [||] [||] [||] + [||] [||] [||] [||] + in + let max_height = max max_height legend_height in + + (* Set up box legend entries with various box pattern line widths. *) + for i = 0 to nlegend - 1 do + opt_array.(i) <- [PL_LEGEND_COLOR_BOX]; + text.(i) <- sprintf "%s %d" "Box Line Width" (i + 1); + text_colors.(i) <- 2; + box_colors.(i) <- 2; + box_patterns.(i) <- 3; + box_scales.(i) <- 0.8; + box_line_widths.(i) <- i + 1; + done; + + let opt = opt_base in + let x = x +. legend_width in + plscol0a 15 32 32 32 0.70; + + let legend_width, legend_height = + let opt_array = Array.sub opt_array 0 nlegend in + pllegend position opt x y + 0.1 15 1 1 0 0 + opt_array 1.0 text_scale 2.0 + 0.0 text_colors text + box_colors box_patterns box_scales box_line_widths + [||] [||] [||] + [||] [||] [||] [||] + in + let max_height = max max_height legend_height in + + (* Set up line legend entries with various colours. *) + for i = 0 to nlegend - 1 do + opt_array.(i) <- [PL_LEGEND_LINE]; + text.(i) <- sprintf "%s %d" "Line Color" (i + 1); + text_colors.(i) <- i + 1; + line_colors.(i) <- i + 1; + line_styles.(i) <- 1; + line_widths.(i) <- 1; + done; + + let opt = opt_base in + (* Use new origin *) + let x = xstart in + let y = y +. max_height in + let max_height = 0.0 in + plscol0a 15 32 32 32 0.70; + + let legend_width, legend_height = + let opt_array = Array.sub opt_array 0 nlegend in + pllegend position opt x y + 0.1 15 1 1 0 0 + opt_array 1.0 text_scale 2.0 + 0.0 text_colors text + [||] [||] [||] [||] + line_colors line_styles line_widths + [||] [||] [||] [||] + in + let max_height = max max_height legend_height in + + (* Set up line legend entries with various styles. *) + for i = 0 to nlegend - 1 do + opt_array.(i) <- [PL_LEGEND_LINE]; + text.(i) <- sprintf "%s %d" "Line Style" (i + 1); + text_colors.(i) <- 2; + line_colors.(i) <- 2; + line_styles.(i) <- i + 1; + line_widths.(i) <- 1; + done; + + let opt = opt_base in + let x = x +. legend_width in + plscol0a 15 32 32 32 0.70; + + let legend_width, legend_height = + let opt_array = Array.sub opt_array 0 nlegend in + pllegend position opt x y + 0.1 15 1 1 0 0 + opt_array 1.0 text_scale 2.0 + 0.0 text_colors text + [||] [||] [||] [||] + line_colors line_styles line_widths + [||] [||] [||] [||] + in + let max_height = max max_height legend_height in + + (* Set up line legend entries with various widths. *) + for i = 0 to nlegend - 1 do + opt_array.(i) <- [PL_LEGEND_LINE]; + text.(i) <- sprintf "%s %d" "Line Width" (i + 1); + text_colors.(i) <- 2; + line_colors.(i) <- 2; + line_styles.(i) <- 1; + line_widths.(i) <- i + 1; + done; + + let opt = opt_base in + let x = x +. legend_width in + plscol0a 15 32 32 32 0.70; + + let legend_width, legend_height = + let opt_array = Array.sub opt_array 0 nlegend in + pllegend position opt x y + 0.1 15 1 1 0 0 + opt_array 1.0 text_scale 2.0 + 0.0 text_colors text + [||] [||] [||] [||] + line_colors line_styles line_widths + [||] [||] [||] [||] + in + let max_height = max max_height legend_height in + (* Silence a warning, so the reset is here one the plcolorbar pages are + added. *) + ignore (max_height); + + plend(); + () + Modified: trunk/plplot_test/test_ocaml.sh.in =================================================================== --- trunk/plplot_test/test_ocaml.sh.in 2011-04-11 03:15:07 UTC (rev 11694) +++ trunk/plplot_test/test_ocaml.sh.in 2011-04-11 03:16:17 UTC (rev 11695) @@ -24,7 +24,7 @@ # Do the standard non-interactive examples. lang="ocaml" -for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31; do +for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33; do if [ "$verbose_test" ] ; then echo "x${index}ocaml" fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hez...@us...> - 2011-04-17 21:59:14
|
Revision: 11707 http://plplot.svn.sourceforge.net/plplot/?rev=11707&view=rev Author: hezekiahcarty Date: 2011-04-17 21:59:08 +0000 (Sun, 17 Apr 2011) Log Message: ----------- Add cmap1_min and cmap1_max attributes to the PLStream structure These values are intended for use by the continuous plot functions such as plshades, plimage, etc. They can be used to restrict the range of colors used by these functions to a subset of color map 1. Modified Paths: -------------- trunk/include/plstrm.h trunk/src/plcore.c Modified: trunk/include/plstrm.h =================================================================== --- trunk/include/plstrm.h 2011-04-15 18:11:24 UTC (rev 11706) +++ trunk/include/plstrm.h 2011-04-17 21:59:08 UTC (rev 11707) @@ -125,6 +125,8 @@ // tmpcolor RGB[] Temporary color storage // cmap0 RGB[] Color map 0: maximum of ncol0 RGB 8-bit values // cmap1 RGB[] Color map 1: maximum of ncol1 RGB 8-bit values +// cmap1_min PLFLT Minimum color map 1 color to use in continuous tone plots +// cmap1_max PLFLT Maximum color map 1 color to use in continuous tone plots // //-------------------------------------------------------------------------- // @@ -542,6 +544,8 @@ PLINT icol0, ncol0, icol1, ncol1, ncp1, curcmap; + PLFLT cmap1_min, cmap1_max; + PLColor curcolor, tmpcolor; PLColor *cmap0; PLColor *cmap1; Modified: trunk/src/plcore.c =================================================================== --- trunk/src/plcore.c 2011-04-15 18:11:24 UTC (rev 11706) +++ trunk/src/plcore.c 2011-04-17 21:59:08 UTC (rev 11707) @@ -2592,6 +2592,10 @@ if ( plsc->cmap1 == NULL ) plspal1( "", TRUE ); + + // Set continuous plots to use the full color map 1 range + plsc->cmap1_min = 0.0; + plsc->cmap1_max = 1.0; } plsc->psdoc = NULL; @@ -2704,6 +2708,8 @@ plsc->icol1 = plsr->icol1; plsc->ncol1 = plsr->ncol1; + plsc->cmap1_min = plsr->cmap1_min; + plsc->cmap1_max = plsr->cmap1_max; if ( plsc->cmap1 != NULL ) free( (void *) plsc->cmap1 ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hez...@us...> - 2011-04-17 22:00:19
|
Revision: 11708 http://plplot.svn.sourceforge.net/plplot/?rev=11708&view=rev Author: hezekiahcarty Date: 2011-04-17 22:00:13 +0000 (Sun, 17 Apr 2011) Log Message: ----------- Add plscmap1_range and plgcmap1_range These functions set/get the recently added color map 1 range stream attributes. Modified Paths: -------------- trunk/include/plplot.h trunk/src/plctrl.c Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2011-04-17 21:59:08 UTC (rev 11707) +++ trunk/include/plplot.h 2011-04-17 22:00:13 UTC (rev 11708) @@ -732,6 +732,8 @@ #define plscmap1l c_plscmap1l #define plscmap1la c_plscmap1la #define plscmap1n c_plscmap1n +#define plscmap1_range c_plscmap1_range +#define plgcmap1_range c_plgcmap1_range #define plscol0 c_plscol0 #define plscol0a c_plscol0a #define plscolbg c_plscolbg @@ -1531,6 +1533,16 @@ PLDLLIMPEXP void c_plscmap1n( PLINT ncol1 ); +// Set the color map 1 range used in continuous plots + +PLDLLIMPEXP void +c_plscmap1_range( PLFLT min_color, PLFLT max_color ); + +// Get the color map 1 range used in continuous plots + +PLDLLIMPEXP void +c_plgcmap1_range( PLFLT *min_color, PLFLT *max_color ); + // Set a given color from color map 0 by 8 bit RGB value PLDLLIMPEXP void Modified: trunk/src/plctrl.c =================================================================== --- trunk/src/plctrl.c 2011-04-17 21:59:08 UTC (rev 11707) +++ trunk/src/plctrl.c 2011-04-17 22:00:13 UTC (rev 11708) @@ -782,6 +782,56 @@ } //-------------------------------------------------------------------------- +//! Set the color map 1 value range to use in continuous color plots. +//! +//! @param min_color Specifies the minimum color to use. A value of 0.0 or +//! less indicates that the range should start at the lowest color map 1 +//! value available. +//! @param max_color Specifies the maximum color to use. A value of 1.0 or +//! greater indicates that the range should exten to the highest color map 1 +//! value available. +//! +//! If min_color > max_color or min_color is greater than 1.0 or max_color is +//! less than 0.0 then no change is made. +//-------------------------------------------------------------------------- + +void +c_plscmap1_range( PLFLT min_color, PLFLT max_color ) +{ + if ( min_color > max_color || max_color < 0.0 || min_color > 1.0 ) + { + plwarn( "plscmap1_range called with invalid color range" ); + return; + } + if ( min_color < 0.0 ) + { + plwarn( "plscmap1_range called with a negative minimum color value" ); + min_color = 0.0; + } + if ( max_color > 1.0 ) + { + plwarn( "plscmap1_range called with an out of range maximum color value" ); + max_color = 1.0; + } + plsc->cmap1_min = min_color; + plsc->cmap1_max = max_color; +} + +//-------------------------------------------------------------------------- +//! Get the color map 1 value range used in continuous color plots. +//! +//! @param min_color Specifies the minimum color used. +//! @param max_color Specifies the maximum color used. +//-------------------------------------------------------------------------- + +void +c_plgcmap1_range( PLFLT *min_color, PLFLT *max_color ) +{ + *min_color = plsc->cmap1_min; + *max_color = plsc->cmap1_max; +} + +//-------------------------------------------------------------------------- // plscmap0n() // // Set number of colors in cmap 0, (re-)allocate cmap 0, and fill with This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hez...@us...> - 2011-04-17 22:01:30
|
Revision: 11710 http://plplot.svn.sourceforge.net/plplot/?rev=11710&view=rev Author: hezekiahcarty Date: 2011-04-17 22:01:24 +0000 (Sun, 17 Apr 2011) Log Message: ----------- plcolorbar should now function properly according to the arguments given There is still work to be done if plcolorbar is going to use the same positioning logic as pllegend. Some general functionality tweaks and extra options may be desired as well. Modified Paths: -------------- trunk/include/plplot.h trunk/src/pllegend.c Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2011-04-17 22:00:53 UTC (rev 11709) +++ trunk/include/plplot.h 2011-04-17 22:01:24 UTC (rev 11710) @@ -1274,10 +1274,11 @@ PLDLLIMPEXP void c_plcolorbar( PLINT position, PLINT opt, PLFLT x, PLFLT y, PLFLT length, PLFLT width, + PLFLT low_cap_color, PLFLT high_cap_color, PLINT cont_color, PLINT cont_width, PLFLT ticks, PLINT sub_ticks, const char *axis_opts, const char *label, - PLINT n_colors, const PLFLT *colors, const PLFLT *values ); + PLINT n_values, const PLFLT *values ); // Sets position of the light source PLDLLIMPEXP void Modified: trunk/src/pllegend.c =================================================================== --- trunk/src/pllegend.c 2011-04-17 22:00:53 UTC (rev 11709) +++ trunk/src/pllegend.c 2011-04-17 22:01:24 UTC (rev 11710) @@ -879,20 +879,32 @@ } //-------------------------------------------------------------------------- -//! Draw end-caps for color bars. +//! Draw triangular end-caps for color bars. //! -//! @param opt TODO -//! @param opt_position TODO -//! @param x TODO -//! @param y TODO -//! @param length TODO -//! @param width TODO -//! @param color TODO +//! @param position This variable defines the placement of the colorbar on the +//! subpage. The position can be one of PL_POSITION_TOP, +//! PL_POSITION_BOTTOM, PL_POSITION_LEFT or PL_POSITION_RIGHT. The colorbar +//! will be drawn perpendicular to the given side of the subpage. +//! @param opt This variable can be PL_COLORBAR_CAP_LOW or +//! PL_COLORBAR_CAP_HIGH, indicating whether we are drawing a low-end cap or a +//! high-end cap. +//! @param a1 First primary coordinate for the end cap base. If position +//! is PL_POSITION_LEFT or PL_POSITION_RIGHT then a1 and a2 are x coordinates. +//! if position is PL_POSITION_TOP or PL_POSITION_BOTTOM then a1 and a2 are y +//! coordinates. (a1, b) and (a2, b) OR (b, a1) and (b, a2) define the base of +//! the triangular cap. +//! @param a2 Second primary coordinate for the end cap base. +//! @param b Secondary coordinate for the end cap base. If a1 and a2 are x, +//! b is y. If a1 and a2 are y, b is x. +//! @param color Color (color palette 1) used to fill the end cap. //! void -draw_cap( PLINT position, PLINT opt, PLFLT x, PLFLT y, PLFLT length, PLFLT width, PLFLT color ) +draw_cap( PLINT position, PLINT opt, PLFLT a1, PLFLT a2, PLFLT b, PLFLT color ) { + // Height the cap in normalized coordinates + PLFLT cap_height = 0.05; + // Save drawing color PLINT col0_save = plsc->icol0; @@ -906,7 +918,7 @@ // Use the entire sub-page, and make world coordinates 0.0 -> 1.0 // This way the location and orientation of the cap can be easily - // defined by a combination of opt, x and y. + // defined by a combination of position, opt, a1, a2 and b. plvpor( 0.0, 1.0, 0.0, 1.0 ); plwind( 0.0, 1.0, 0.0, 1.0 ); @@ -921,29 +933,23 @@ if ( position & PL_POSITION_LEFT || position & PL_POSITION_RIGHT ) { // Draw the cap on the bottom - if ( position & PL_POSITION_LEFT ) - xs[0] = x; - else if ( position & PL_POSITION_RIGHT ) - xs[0] = 1.0 - x - width; - ys[0] = y; - xs[2] = xs[0] + width; - ys[2] = ys[0]; + xs[0] = a1; + ys[0] = b; + xs[2] = a2; + ys[2] = b; xs[1] = ( xs[0] + xs[2] ) / 2.0; - ys[1] = ys[0] - 0.05; + ys[1] = ys[0] - cap_height; plfill( 3, xs, ys ); } else if ( position & PL_POSITION_TOP || position & PL_POSITION_BOTTOM ) { // Draw the cap on the left - xs[0] = x; - if ( position & PL_POSITION_TOP ) - ys[0] = 1.0 - y - width; - else if ( position & PL_POSITION_BOTTOM ) - ys[0] = y; - xs[2] = xs[0]; - ys[2] = ys[0] + width; - xs[1] = xs[0] - 0.05; + xs[0] = b; + ys[0] = a1; + xs[2] = b; + ys[2] = a2; + xs[1] = xs[0] - cap_height; ys[1] = ( ys[0] + ys[2] ) / 2.0; plfill( 3, xs, ys ); @@ -954,29 +960,23 @@ if ( position & PL_POSITION_LEFT || position & PL_POSITION_RIGHT ) { // Draw the cap on the top - if ( position & PL_POSITION_LEFT ) - xs[0] = x; - else if ( position & PL_POSITION_RIGHT ) - xs[0] = 1.0 - x - width; - ys[0] = y + length; - xs[2] = xs[0] + width; - ys[2] = ys[0]; + xs[0] = a1; + ys[0] = b; + xs[2] = a2; + ys[2] = b; xs[1] = ( xs[0] + xs[2] ) / 2.0; - ys[1] = ys[0] + 0.05; + ys[1] = ys[0] + cap_height; plfill( 3, xs, ys ); } else if ( position & PL_POSITION_TOP || position & PL_POSITION_BOTTOM ) { // Draw the cap on the right - xs[0] = x + length; - if ( position & PL_POSITION_TOP ) - ys[0] = 1.0 - y - width; - else if ( position & PL_POSITION_BOTTOM ) - ys[0] = y; - xs[2] = xs[0]; - ys[2] = ys[0] + width; - xs[1] = xs[0] + 0.05; + xs[0] = b; + ys[0] = a1; + xs[2] = b; + ys[2] = a2; + xs[1] = xs[0] + cap_height; ys[1] = ( ys[0] + ys[2] ) / 2.0; plfill( 3, xs, ys ); @@ -1024,6 +1024,8 @@ //! @param width Width of the colorbar along the minor axis (ex. fraction of //! the vertical subpage size if pos is PL_POSITION_TOP) in normalized subpage //! coordinates. +//! @param low_cap_color Color of the low-end color bar cap, if it is drawn. +//! @param high_cap_color Color of the high-end color bar cap, if it is drawn. //! @param cont_color Contour color for PL_COLORBAR_SHADE plots. This is //! passed directly to plshades, so it will be interpreted according to the //! design of plshades. @@ -1035,20 +1037,13 @@ //! @param axis_opts Axis options for the colorbar's major axis, as for plbox. //! @param label Text label for the colorbar. No title is drawn if no label //! position is specified in pos. -//! @param n_colors Number of elements in the colors and values arrays. +//! @param n_values Number of elements in the values array. //! @param colors Colors (color map 1) used to draw the colorbar. If this is a //! PL_COLORBAR_SHADE bar then there should be one entry per break between //! segments. If this //! is a PL_COLORBAR_IMAGE or PL_COLORBAR_GRADIENT bar then there should be two //! elements - one to specify the high end and one to specify the low end. -//! TODO: Due to a deficiency in plimage, plimagefr, plshades and plgradient, -//! the high and low values for colors don't have the effect that they should. -//! Each colorbar will always span the follow range of color map 1. This -//! should be fixed with new, more flexible implementations of plimage, -//! plimagefr, plshades and plgradient which use user-provided minimum and -//! maximum colors for their range instead of keeping the minimum color fixed -//! as 0.0 and the maximum fixed as 1.0. The net effect of this is that the -//! values in colors do not have the effect they should at this time. +//! This should have (n_values - 1) elements. //! @param values Numeric values for the data range represented by the //! colorbar. For PL_COLORBAR_SHADE, this should include one value per break //! between segments. For PL_COLORBAR_IMAGE and PL_COLORBAR_GRADIENT this @@ -1059,18 +1054,27 @@ void c_plcolorbar( PLINT position, PLINT opt, PLFLT x, PLFLT y, PLFLT length, PLFLT width, + PLFLT low_cap_color, PLFLT high_cap_color, PLINT cont_color, PLINT cont_width, PLFLT ticks, PLINT sub_ticks, const char *axis_opts, const char *label, - PLINT n_colors, const PLFLT *colors, const PLFLT *values ) + PLINT n_values, const PLFLT *values ) { + // Justification of label text + PLFLT just; + // Min and max values // Assumes that the values array is sorted from smallest to largest // OR from largest to smallest. PLFLT min_value, max_value; min_value = values[0]; - max_value = values[ n_colors - 1 ]; + max_value = values[ n_values - 1 ]; + // Min and max colors + // Assumes that the colors array is sorted from smallest to largest. + PLFLT min_color, max_color; + plgcmap1_range( &min_color, &max_color ); + // Saved normalized coordinates of viewport. PLFLT xdmin_save, xdmax_save, ydmin_save, ydmax_save; // Saved world coordinates of viewport. @@ -1155,8 +1159,8 @@ { // Interpolate // TODO: Should this be decided with an extra opt option instead of by - // counting n_colors? - if ( n_colors == 2 ) + // counting n_values? + if ( n_values == 2 ) { // Use the same number of steps as there are steps in // color palette 1. @@ -1197,7 +1201,7 @@ // No interpolation - use values array as-is else { - n_steps = n_colors; + n_steps = n_values; // Use the provided values in this case. if ( position & PL_POSITION_LEFT || position & PL_POSITION_RIGHT ) { @@ -1244,7 +1248,7 @@ // then segment B will be twice the length of segment A. PLcGrid grid; PLFLT grid_axis[2] = { 0.0, 1.0 }; - n_steps = n_colors; + n_steps = n_values; // Use the provided values. if ( position & PL_POSITION_LEFT || position & PL_POSITION_RIGHT ) { @@ -1341,9 +1345,16 @@ label_offset += 2.5; } // Draw a filled triangle (cap/arrow) at the low end of the scale - draw_cap( position, opt, x, y, length, width, 0.0 ); + if ( position & PL_POSITION_LEFT || position & PL_POSITION_RIGHT ) + { + draw_cap( position, PL_COLORBAR_CAP_LOW, vx_min, vx_max, vy_min, low_cap_color ); + } + else if ( position & PL_POSITION_BOTTOM || position & PL_POSITION_TOP ) + { + draw_cap( position, PL_COLORBAR_CAP_LOW, vy_min, vy_max, vx_min, low_cap_color ); + } } - else if ( opt & PL_COLORBAR_CAP_HIGH ) + if ( opt & PL_COLORBAR_CAP_HIGH ) { // Add an extra offset for the label so it does not bump in to the // cap if the label is placed on the same side as the cap. @@ -1355,7 +1366,14 @@ label_offset += 2.5; } // Draw a filled triangle (cap/arrow) at the high end of the scale - draw_cap( position, opt, x, y, length, width, 1.0 ); + if ( position & PL_POSITION_LEFT || position & PL_POSITION_RIGHT ) + { + draw_cap( position, PL_COLORBAR_CAP_HIGH, vx_min, vx_max, vy_max, high_cap_color ); + } + else if ( position & PL_POSITION_BOTTOM || position & PL_POSITION_TOP ) + { + draw_cap( position, PL_COLORBAR_CAP_HIGH, vy_min, vy_max, vx_max, high_cap_color ); + } } // Smaller text @@ -1379,14 +1397,16 @@ { label_offset += 4.0; perp = '\0'; + just = 0.5; } else { label_offset += 1.5; perp = 'v'; + just = 1.0; } snprintf( opt_string, max_opts, "l%c", perp ); - plmtex( opt_string, label_offset, 0.5, 0.5, label ); + plmtex( opt_string, label_offset, 0.5, just, label ); } else if ( opt & PL_COLORBAR_LABEL_RIGHT ) { @@ -1394,21 +1414,23 @@ { label_offset += 4.0; perp = '\0'; + just = 0.5; } else { label_offset += 1.5; perp = 'v'; + just = 0.0; } snprintf( opt_string, max_opts, "r%c", perp ); - plmtex( opt_string, label_offset, 0.5, 0.5, label ); + plmtex( opt_string, label_offset, 0.5, just, label ); } else if ( opt & PL_COLORBAR_LABEL_TOP ) { if ( position & PL_POSITION_RIGHT || position & PL_POSITION_LEFT ) { label_offset += 1.5; - perp = 'v'; + perp = '\0'; } else { @@ -1423,7 +1445,7 @@ if ( position & PL_POSITION_RIGHT || position & PL_POSITION_LEFT ) { label_offset += 1.5; - perp = 'v'; + perp = '\0'; } else { @@ -1443,22 +1465,22 @@ if ( position & PL_POSITION_LEFT ) { snprintf( opt_string, max_opts, "nt%s", axis_opts ); - label_box_custom( "", 0, NULL, opt_string, n_colors, values ); + label_box_custom( "", 0, NULL, opt_string, n_values, values ); } else if ( position & PL_POSITION_RIGHT ) { snprintf( opt_string, max_opts, "mt%s", axis_opts ); - label_box_custom( "", 0, NULL, opt_string, n_colors, values ); + label_box_custom( "", 0, NULL, opt_string, n_values, values ); } else if ( position & PL_POSITION_TOP ) { snprintf( opt_string, max_opts, "mt%s", axis_opts ); - label_box_custom( opt_string, n_colors, values, "", 0, NULL ); + label_box_custom( opt_string, n_values, values, "", 0, NULL ); } else if ( position & PL_POSITION_BOTTOM ) { snprintf( opt_string, max_opts, "nt%s", axis_opts ); - label_box_custom( opt_string, n_colors, values, "", 0, NULL ); + label_box_custom( opt_string, n_values, values, "", 0, NULL ); } } else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hez...@us...> - 2011-04-17 22:02:32
|
Revision: 11712 http://plplot.svn.sourceforge.net/plplot/?rev=11712&view=rev Author: hezekiahcarty Date: 2011-04-17 22:02:25 +0000 (Sun, 17 Apr 2011) Log Message: ----------- Don't set text or tick size in plcolorbar; Update C example 33 to match Users may want smaller or larger text for colorbar labels and shorter or longer ticks so leave that choice to them. Modified Paths: -------------- trunk/examples/c/x33c.c trunk/src/pllegend.c Modified: trunk/examples/c/x33c.c =================================================================== --- trunk/examples/c/x33c.c 2011-04-17 22:01:53 UTC (rev 11711) +++ trunk/examples/c/x33c.c 2011-04-17 22:02:25 UTC (rev 11712) @@ -224,6 +224,12 @@ colorbar_position_option_labels[position_i], colorbar_label_option_labels[label_i] ); + // Smaller text + plschr( 0.0, 0.75 ); + // Small ticks on the vertical axis + plsmaj( 0.0, 0.5 ); + plsmin( 0.0, 0.5 ); + plcolorbar( position, opt, x, y, length, width, low_cap_color, high_cap_color, @@ -231,6 +237,11 @@ ticks, sub_ticks, axis_opts, label, n_values, values ); + + // Reset text and tick sizes + plschr( 0.0, 1.0 ); + plsmaj( 0.0, 1.0 ); + plsmin( 0.0, 1.0 ); } // Draw a page title Modified: trunk/src/pllegend.c =================================================================== --- trunk/src/pllegend.c 2011-04-17 22:01:53 UTC (rev 11711) +++ trunk/src/pllegend.c 2011-04-17 22:02:25 UTC (rev 11712) @@ -1084,10 +1084,6 @@ // Active attributes to be saved and restored afterward. PLINT col0_save = plsc->icol0; - PLFLT text_scale_save = plsc->chrht / plsc->chrdef; - // Axis tick spacing - PLFLT maj_save = plsc->majht / plsc->majdef; - PLFLT min_save = plsc->minht / plsc->mindef; // Position of the color bar in normalized viewport (= normalized subpage // coordinates). @@ -1376,12 +1372,6 @@ } } - // Smaller text - plschr( 0.0, 0.75 ); - // Small ticks on the vertical axis - plsmaj( 0.0, 0.5 ); - plsmin( 0.0, 0.5 ); - // For building axis option string PLINT max_opts = 25; char opt_string[max_opts]; @@ -1521,9 +1511,6 @@ plcol0( col0_save ); plvpor( xdmin_save, xdmax_save, ydmin_save, ydmax_save ); plwind( xwmin_save, xwmax_save, ywmin_save, ywmax_save ); - plsmaj( 0.0, maj_save ); - plsmin( 0.0, min_save ); - plschr( 0.0, text_scale_save ); return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-04-21 00:47:16
|
Revision: 11717 http://plplot.svn.sourceforge.net/plplot/?rev=11717&view=rev Author: airwin Date: 2011-04-21 00:47:06 +0000 (Thu, 21 Apr 2011) Log Message: ----------- Yet another pllegend API change within this release cycle. I have decided to swap the opt and position parameters in the argument list because it is much more logical to have the position argument next to the x and y offset arguments. I have propagated this change to all our language bindings and examples, and the result gives a clean test_diff_psc target diff report. Modified Paths: -------------- trunk/bindings/ada/plplot.adb trunk/bindings/ada/plplot.ads trunk/bindings/ada/plplot_thin.ads trunk/bindings/ada/plplot_traditional.adb trunk/bindings/ada/plplot_traditional.ads trunk/bindings/c++/plstream.cc trunk/bindings/c++/plstream.h trunk/bindings/d/plplot.d trunk/bindings/f77/scstubs.c trunk/bindings/f77/sfstubs.fm4 trunk/bindings/f95/scstubs.c trunk/bindings/f95/sfstubsf95.f90 trunk/bindings/java/PLStream.java trunk/bindings/ocaml/plplot.ml trunk/bindings/ocaml/plplot.mli trunk/bindings/ocaml/plplot_core.idl trunk/bindings/ocaml/plplot_impl.c trunk/bindings/swig-support/plplotcapi.i trunk/bindings/tcl/tclAPI.c trunk/examples/ada/x04a.adb trunk/examples/ada/x26a.adb trunk/examples/ada/x33a.adb trunk/examples/ada/xthick04a.adb trunk/examples/ada/xthick26a.adb trunk/examples/ada/xthick33a.adb trunk/examples/c/x04c.c trunk/examples/c/x26c.c trunk/examples/c/x33c.c trunk/examples/c++/x04.cc trunk/examples/c++/x26.cc trunk/examples/c++/x33.cc trunk/examples/d/x04d.d trunk/examples/d/x26d.d trunk/examples/d/x33d.d trunk/examples/f77/x04f.fm4 trunk/examples/f77/x26f.fm4 trunk/examples/f77/x33f.fm4 trunk/examples/f95/x04f.f90 trunk/examples/f95/x26f.f90 trunk/examples/f95/x33f.f90 trunk/examples/java/x04.java trunk/examples/java/x26.java trunk/examples/java/x33.java trunk/examples/lua/x04.lua trunk/examples/lua/x26.lua trunk/examples/lua/x33.lua trunk/examples/ocaml/x04.ml trunk/examples/ocaml/x26.ml trunk/examples/ocaml/x33.ml trunk/examples/octave/x04c.m trunk/examples/octave/x26c.m trunk/examples/octave/x33c.m trunk/examples/python/xw04.py trunk/examples/python/xw26.py trunk/examples/python/xw33.py trunk/examples/tcl/x04.tcl trunk/examples/tcl/x26.tcl trunk/examples/tcl/x33.tcl trunk/include/plplot.h trunk/src/pllegend.c Modified: trunk/bindings/ada/plplot.adb =================================================================== --- trunk/bindings/ada/plplot.adb 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/bindings/ada/plplot.adb 2011-04-21 00:47:06 UTC (rev 11717) @@ -1857,7 +1857,7 @@ -- pllegend procedure Create_Legend (Legend_Width, Legend_Height : out Long_Float; - Position, Options : Integer; + Options, Position : Integer; X_Offset, Y_Offset : Long_Float; Plot_Area_Width : Long_Float; Background_Color, Bounding_Box_Color : Plot_Color_Type; @@ -1938,7 +1938,7 @@ PL_Symbols(I) := C_Symbols_String_Array(I)'Address; end loop; - pllegend(Legend_Width, Legend_Height, Position, Options, + pllegend(Legend_Width, Legend_Height, Options, Position, X_Offset, Y_Offset, Plot_Area_Width, Background_Color, Bounding_Box_Color, Bounding_Box_Style, Number_Rows, Number_Columns, Number_Entries, Entry_Options, Text_Offset, Text_Scale, Text_Spacing, Text_Justification, Modified: trunk/bindings/ada/plplot.ads =================================================================== --- trunk/bindings/ada/plplot.ads 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/bindings/ada/plplot.ads 2011-04-21 00:47:06 UTC (rev 11717) @@ -1282,7 +1282,7 @@ -- pllegend procedure Create_Legend (Legend_Width, Legend_Height : out Long_Float; - Position, Options : Integer; + Options, Position : Integer; X_Offset, Y_Offset : Long_Float; Plot_Area_Width : Long_Float; Background_Color, Bounding_Box_Color : Plot_Color_Type; Modified: trunk/bindings/ada/plplot_thin.ads =================================================================== --- trunk/bindings/ada/plplot_thin.ads 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/bindings/ada/plplot_thin.ads 2011-04-21 00:47:06 UTC (rev 11717) @@ -1069,7 +1069,7 @@ procedure pllegend (p_legend_width : out PLFLT; p_legend_height : out PLFLT; - plposition : PLINT; opt : PLINT; x : PLFLT; y : PLFLT; plot_width : PLFLT; + opt : PLINT; plposition : PLINT; x : PLFLT; y : PLFLT; plot_width : PLFLT; bg_color : PLINT; bb_color : PLINT; bb_style : PLINT; nrow : PLINT; ncolumn : PLINT; nlegend : PLINT; opt_array : PL_Integer_Array; Modified: trunk/bindings/ada/plplot_traditional.adb =================================================================== --- trunk/bindings/ada/plplot_traditional.adb 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/bindings/ada/plplot_traditional.adb 2011-04-21 00:47:06 UTC (rev 11717) @@ -1788,7 +1788,7 @@ -- Routine for drawing discrete line, symbol, or cmap0 legends procedure pllegend (Legend_Width, Legend_Height : out Long_Float; - Position, Options : Integer; + Options, Position : Integer; X_Offset, Y_Offset : Long_Float; Plot_Area_Width : Long_Float; Background_Color, Bounding_Box_Color : Plot_Color_Type; @@ -1869,7 +1869,7 @@ PL_Symbols(I) := C_Symbols_String_Array(I)'Address; end loop; - PLplot_Thin.pllegend(Legend_Width, Legend_Height, Position, Options, + PLplot_Thin.pllegend(Legend_Width, Legend_Height, Options, Position, X_Offset, Y_Offset, Plot_Area_Width, Background_Color, Bounding_Box_Color, Bounding_Box_Style, Number_Rows, Number_Columns, Number_Entries, Entry_Options, Text_Offset, Text_Scale, Text_Spacing, Text_Justification, Modified: trunk/bindings/ada/plplot_traditional.ads =================================================================== --- trunk/bindings/ada/plplot_traditional.ads 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/bindings/ada/plplot_traditional.ads 2011-04-21 00:47:06 UTC (rev 11717) @@ -1208,7 +1208,7 @@ -- Routine for drawing discrete line, symbol, or cmap0 legends procedure pllegend (Legend_Width, Legend_Height : out Long_Float; - Position, Options : Integer; + Options, Position : Integer; X_Offset, Y_Offset : Long_Float; Plot_Area_Width : Long_Float; Background_Color, Bounding_Box_Color : Plot_Color_Type; Modified: trunk/bindings/c++/plstream.cc =================================================================== --- trunk/bindings/c++/plstream.cc 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/bindings/c++/plstream.cc 2011-04-21 00:47:06 UTC (rev 11717) @@ -1000,7 +1000,7 @@ // Routine for drawing line, symbol, or cmap0 legends void plstream::legend( PLFLT *p_legend_width, PLFLT *p_legend_height, - PLINT position, PLINT opt, PLFLT x, PLFLT y, PLFLT plot_width, + PLINT opt, PLINT position, PLFLT x, PLFLT y, PLFLT plot_width, PLINT bg_color, PLINT bb_color, PLINT bb_style, PLINT nrow, PLINT ncolumn, PLINT nlegend, const PLINT *opt_array, @@ -1016,7 +1016,7 @@ { set_stream(); - pllegend( p_legend_width, p_legend_height, position, opt, x, y, plot_width, + pllegend( p_legend_width, p_legend_height, opt, position, x, y, plot_width, bg_color, bb_color, bb_style, nrow, ncolumn, nlegend, opt_array, text_offset, text_scale, text_spacing, text_justification, text_colors, text, box_colors, box_patterns, box_scales, Modified: trunk/bindings/c++/plstream.h =================================================================== --- trunk/bindings/c++/plstream.h 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/bindings/c++/plstream.h 2011-04-21 00:47:06 UTC (rev 11717) @@ -428,7 +428,7 @@ // Routine for drawing line, symbol, or cmap0 legends void legend( PLFLT *p_legend_width, PLFLT *p_legend_height, - PLINT position, PLINT opt, PLFLT x, PLFLT y, PLFLT plot_width, + PLINT opt, PLINT position, PLFLT x, PLFLT y, PLFLT plot_width, PLINT bg_color, PLINT bb_color, PLINT bb_style, PLINT nrow, PLINT ncolumn, PLINT nlegend, const PLINT *opt_array, Modified: trunk/bindings/d/plplot.d =================================================================== --- trunk/bindings/d/plplot.d 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/bindings/d/plplot.d 2011-04-21 00:47:06 UTC (rev 11717) @@ -312,7 +312,7 @@ // Routine for drawing discrete line, symbol, or cmap0 legends void pllegend( PLFLT *p_legend_width, PLFLT *p_legend_height, - PLINT position, PLINT opt, PLFLT x, PLFLT y, PLFLT plot_width, + PLINT opt, PLINT position, PLFLT x, PLFLT y, PLFLT plot_width, PLINT bg_color, PLINT bb_color, PLINT bb_style, PLINT nrow, PLINT ncolumn, PLINT[] opt_array, @@ -349,7 +349,7 @@ assert( nlegend == symbol_numbers.length, "pllegend(): Arrays must be of same length!" ); assert( nlegend == symbols.length, "pllegend(): Arrays must be of same length!" ); c_pllegend( p_legend_width, p_legend_height, - position, opt, x, y, plot_width, + opt, position, x, y, plot_width, bg_color, bb_color, bb_style, nrow, ncolumn, nlegend, opt_array.ptr, @@ -1787,7 +1787,7 @@ // Routine for drawing discrete line, symbol, or cmap0 legends void c_pllegend( PLFLT *p_legend_width, PLFLT *p_legend_height, - PLINT position, PLINT opt, PLFLT x, PLFLT y, PLFLT plot_width, + PLINT opt, PLINT position, PLFLT x, PLFLT y, PLFLT plot_width, PLINT bg_color, PLINT bb_color, PLINT bb_style, PLINT nrow, PLINT ncolumn, PLINT nlegend, PLINT *opt_array, Modified: trunk/bindings/f77/scstubs.c =================================================================== --- trunk/bindings/f77/scstubs.c 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/bindings/f77/scstubs.c 2011-04-21 00:47:06 UTC (rev 11717) @@ -553,7 +553,7 @@ void PLLEGEND( PLFLT *p_legend_width, PLFLT *p_legend_height, - PLINT *position, PLINT *opt, PLFLT *x, PLFLT *y, PLFLT *plot_width, + PLINT *opt, PLINT *position, PLFLT *x, PLFLT *y, PLFLT *plot_width, PLINT *bg_color, PLINT *bb_color, PLINT *bb_style, PLINT *nrow, PLINT *ncolumn, PLINT *nlegend, const PLINT *opt_array, @@ -568,7 +568,7 @@ const PLINT *symbol_numbers ) { c_pllegend( p_legend_width, p_legend_height, - *position, *opt, *x, *y, *plot_width, + *opt, *position, *x, *y, *plot_width, *bg_color, *bb_color, *bb_style, *nrow, *ncolumn, *nlegend, opt_array, Modified: trunk/bindings/f77/sfstubs.fm4 =================================================================== --- trunk/bindings/f77/sfstubs.fm4 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/bindings/f77/sfstubs.fm4 2011-04-21 00:47:06 UTC (rev 11717) @@ -289,7 +289,7 @@ c*********************************************************************** subroutine pllegend( legend_width, legend_height, - & position, opt, x, y, + & opt, position, x, y, & plot_width, bg_color, bb_color, bb_style, & nrow, ncolumn, nlegend, opt_array, & text_offset, text_scale, text_spacing, @@ -329,7 +329,7 @@ call pllegend07_cnv_text( 1, nlegend, text ) call pllegend07_cnv_text( 2, nlegend, symbols ) - call pllegend07( legend_width, legend_height, position, opt, x, y, + call pllegend07( legend_width, legend_height, opt, position, x, y, & plot_width, bg_color, bb_color, bb_style, & nrow, ncolumn, nlegend, opt_array, & text_offset, text_scale, text_spacing, Modified: trunk/bindings/f95/scstubs.c =================================================================== --- trunk/bindings/f95/scstubs.c 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/bindings/f95/scstubs.c 2011-04-21 00:47:06 UTC (rev 11717) @@ -592,7 +592,7 @@ void PLLEGEND( PLFLT *p_legend_width, PLFLT *p_legend_height, - PLINT *position, PLINT *opt, PLFLT *x, PLFLT *y, PLFLT *plot_width, + PLINT *opt, PLINT *position, PLFLT *x, PLFLT *y, PLFLT *plot_width, PLINT *bg_color, PLINT *bb_color, PLINT *bb_style, PLINT *nrow, PLINT *ncolumn, PLINT *nlegend, const PLINT *opt_array, @@ -607,7 +607,7 @@ const PLINT *symbol_numbers ) { c_pllegend( p_legend_width, p_legend_height, - *position, *opt, *x, *y, *plot_width, + *opt, *position, *x, *y, *plot_width, *bg_color, *bb_color, *bb_style, *nrow, *ncolumn, *nlegend, opt_array, Modified: trunk/bindings/f95/sfstubsf95.f90 =================================================================== --- trunk/bindings/f95/sfstubsf95.f90 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/bindings/f95/sfstubsf95.f90 2011-04-21 00:47:06 UTC (rev 11717) @@ -1059,7 +1059,7 @@ end subroutine plimage subroutine pllegend_1( legend_width, legend_height, & - & position, opt, x, y, & + & opt, position, x, y, & & plot_width, bg_color, bb_color, bb_style, & & nrow, ncolumn, nlegend, opt_array, & & text_offset, text_scale, text_spacing, & @@ -1091,7 +1091,7 @@ call pllegend07_cnv_text( 1, nlegend, text ) call pllegend07_cnv_text( 2, nlegend, symbols ) - call pllegend07( legend_width, legend_height, position, opt, x, y, & + call pllegend07( legend_width, legend_height, opt, position, x, y, & plot_width, bg_color, bb_color, bb_style, & nrow, ncolumn, nlegend, opt_array, & text_offset, text_scale, text_spacing, & @@ -1105,7 +1105,7 @@ end subroutine pllegend_1 subroutine pllegend_2( legend_width, legend_height, & - & position, opt, x, y, & + & opt, position, x, y, & & plot_width, bg_color, bb_color, bb_style, & & nrow, ncolumn, opt_array, & & text_offset, text_scale, text_spacing, & @@ -1137,7 +1137,7 @@ nlegend = min( size(opt_array), size(text) ) call pllegend_1( legend_width, legend_height, & - position, opt, x, y, & + opt, position, x, y, & plot_width, bg_color, bb_color, bb_style, & nrow, ncolumn, nlegend, opt_array, & text_offset, text_scale, text_spacing, & Modified: trunk/bindings/java/PLStream.java =================================================================== --- trunk/bindings/java/PLStream.java 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/bindings/java/PLStream.java 2011-04-21 00:47:06 UTC (rev 11717) @@ -529,7 +529,7 @@ } public void legend( double[] p_legend_width, double[] p_legend_height, - int position, int opt, double x, double y, double plot_width, + int opt, int position, double x, double y, double plot_width, int bg_color, int bb_color, int bb_style, int nrow, int ncolumn, int[] opt_array, double text_offset, double text_scale, @@ -544,7 +544,7 @@ { if ( set_stream() == -1 ) return; plplotjavac.pllegend( p_legend_width, p_legend_height, - position, opt, x, y, plot_width, bg_color, bb_color, + opt, position, x, y, plot_width, bg_color, bb_color, bb_style, nrow, ncolumn, opt_array, text_offset, text_scale, text_spacing, text_justification, text_colors, text, Modified: trunk/bindings/ocaml/plplot.ml =================================================================== --- trunk/bindings/ocaml/plplot.ml 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/bindings/ocaml/plplot.ml 2011-04-21 00:47:06 UTC (rev 11717) @@ -795,7 +795,7 @@ custom ( fun () -> ignore ( - pllegend pos_opt opt legend_x legend_y plot_width bg bb bb_style + pllegend opt pos_opt legend_x legend_y plot_width bg bb bb_style rows columns entry_opts text_offset text_scale text_spacing text_justification text_colors text Modified: trunk/bindings/ocaml/plplot.mli =================================================================== --- trunk/bindings/ocaml/plplot.mli 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/bindings/ocaml/plplot.mli 2011-04-21 00:47:06 UTC (rev 11717) @@ -754,7 +754,7 @@ float -> float -> float -> int -> int -> float -> int -> string -> string -> float array -> float array -> unit = "camlidl_plplot_core_c_plcolorbar_bytecode" "camlidl_plplot_core_c_plcolorbar" -external pllegend : plplot_position_opt -> plplot_legend_opt -> +external pllegend : plplot_legend_opt -> plplot_position_opt -> float -> float -> float -> int -> int -> int -> int -> int -> plplot_legend_opt array -> float -> float -> float -> float -> int array -> string array -> int array -> int array -> Modified: trunk/bindings/ocaml/plplot_core.idl =================================================================== --- trunk/bindings/ocaml/plplot_core.idl 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/bindings/ocaml/plplot_core.idl 2011-04-21 00:47:06 UTC (rev 11717) @@ -314,5 +314,5 @@ RAW_ML(external plgriddata : float array -> float array -> float array -> float array -> float array -> plplot_grid_method_type -> float -> float array array = "ml_plgriddata_bytecode" "ml_plgriddata") RAW_ML(external plparseopts : string array -> plplot_parse_method_type list -> unit = "ml_plparseopts") -RAW_ML(external pllegend : plplot_position_opt -> plplot_legend_opt -> float -> float -> float -> int -> int -> int -> int -> int -> plplot_legend_opt array -> float -> float -> float -> float -> int array -> string array -> int array -> int array -> float array -> int array -> int array -> int array -> int array -> int array -> float array -> int array -> string array -> float * float = "ml_pllegend_byte" "ml_pllegend") +RAW_ML(external pllegend : plplot_legend_opt -> plplot_position_opt -> float -> float -> float -> int -> int -> int -> int -> int -> plplot_legend_opt array -> float -> float -> float -> float -> int array -> string array -> int array -> int array -> float array -> int array -> int array -> int array -> int array -> int array -> float array -> int array -> string array -> float * float = "ml_pllegend_byte" "ml_pllegend") Modified: trunk/bindings/ocaml/plplot_impl.c =================================================================== --- trunk/bindings/ocaml/plplot_impl.c 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/bindings/ocaml/plplot_impl.c 2011-04-21 00:47:06 UTC (rev 11717) @@ -771,7 +771,7 @@ return translated_option; } -value ml_pllegend( value position, value opt, value x, value y, value plot_width, +value ml_pllegend( value opt, value position, value x, value y, value plot_width, value bg_color, value bb_color, value bb_style, value nrow, value ncolumn, @@ -832,7 +832,7 @@ // The returned width and height of the legend PLFLT width, height; - pllegend( &width, &height, c_position, c_opt, Double_val( x ), Double_val( y ), + pllegend( &width, &height, c_opt, c_position, Double_val( x ), Double_val( y ), Double_val( plot_width ), Int_val( bg_color ), Int_val( bb_color ), Int_val( bb_style ), Int_val( nrow ), Int_val( ncolumn ), Modified: trunk/bindings/swig-support/plplotcapi.i =================================================================== --- trunk/bindings/swig-support/plplotcapi.i 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/bindings/swig-support/plplotcapi.i 2011-04-21 00:47:06 UTC (rev 11717) @@ -460,7 +460,7 @@ void pllegend( PLFLT *OUTPUT, PLFLT *OUTPUT, - PLINT position, PLINT opt, PLFLT x, PLFLT y, PLFLT plot_width, + PLINT opt, PLINT position, PLFLT x, PLFLT y, PLFLT plot_width, PLINT bg_color, PLINT bb_color, PLINT bb_style, PLINT nrow, PLINT ncolumn, PLINT n, const PLINT *Array, Modified: trunk/bindings/tcl/tclAPI.c =================================================================== --- trunk/bindings/tcl/tclAPI.c 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/bindings/tcl/tclAPI.c 2011-04-21 00:47:06 UTC (rev 11717) @@ -4123,7 +4123,7 @@ { PLFLT legend_width, legend_height; PLFLT x, y, plot_width; - PLINT position, opt; + PLINT opt, position; PLINT bg_color, bb_color, bb_style; PLINT nrow, ncolumn; PLINT nlegend; @@ -4154,8 +4154,8 @@ return TCL_ERROR; } - sscanf( argv[1], "%d", &position ); - sscanf( argv[2], "%d", &opt ); + sscanf( argv[1], "%d", &opt ); + sscanf( argv[2], "%d", &position ); sscanf( argv[3], "%lg", &value ); x = (PLFLT) value; sscanf( argv[4], "%lg", &value ); y = (PLFLT) value; sscanf( argv[5], "%lg", &value ); plot_width = (PLFLT) value; @@ -4187,7 +4187,7 @@ nlegend = MIN( number_opts, number_texts ); c_pllegend( &legend_width, &legend_height, - position, opt, x, y, plot_width, + opt, position, x, y, plot_width, bg_color, bb_color, bb_style, nrow, ncolumn, nlegend, opt_array, Modified: trunk/examples/ada/x04a.adb =================================================================== --- trunk/examples/ada/x04a.adb 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/examples/ada/x04a.adb 2011-04-21 00:47:06 UTC (rev 11717) @@ -128,7 +128,7 @@ symbols(1) := To_Unbounded_String("*"); pllegend(legend_width, legend_height, - 0, Legend_Background + Legend_Bounding_Box, + Legend_Background + Legend_Bounding_Box, 0, 0.0, 0.0, 0.1, 15, 1, 1, 0, 0, opt_array, @@ -169,7 +169,7 @@ Box_Scales(0) := 0.0; pllegend(legend_width, legend_height, - 0, Legend_Background + Legend_Bounding_Box, + Legend_Background + Legend_Bounding_Box, 0, 0.0, 0.0, 0.1, 15, -- fixme Replace colors and styles with names. 1, 1, 0, 0, opt_array, Modified: trunk/examples/ada/x26a.adb =================================================================== --- trunk/examples/ada/x26a.adb 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/examples/ada/x26a.adb 2011-04-21 00:47:06 UTC (rev 11717) @@ -204,7 +204,7 @@ plscol0a(15, 32, 32, 32, 0.70); pllegend(legend_width, legend_height, - 0, Legend_Background + Legend_Bounding_Box, + Legend_Background + Legend_Bounding_Box, 0, 0.0, 0.0, 0.1, 15, 1, 1, 0, 0, opt_array, Modified: trunk/examples/ada/x33a.adb =================================================================== --- trunk/examples/ada/x33a.adb 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/examples/ada/x33a.adb 2011-04-21 00:47:06 UTC (rev 11717) @@ -108,7 +108,7 @@ -- colors : Real_Vector(0 .. n - 1); -- i : Integer; -- color_step, color_offset : Long_Float; - -- position, opt : Integer; + -- opt, position : Integer; -- axis_opts_1, axis_opts_2 : Unbounded_String; -- begin -- pladv(0); @@ -137,7 +137,7 @@ -- end if; -- end if; -- - -- plcolorbar(position, opt, 0.1, 0.1, 0.5, 0.1, -- fixme + -- plcolorbar(opt, position, 0.1, 0.1, 0.5, 0.1, -- fixme -- cont_color, cont_width, -- ticks, sub_ticks, -- axis_opts_1, "Test label - Left, High Cap", @@ -146,7 +146,7 @@ -- position := PL_POSITION_RIGHT; -- opt := bar_type + PL_COLORBAR_LABEL_RIGHT + PL_COLORBAR_CAP_LOW; -- - -- plcolorbar(position, opt, 0.1, 0.4, 0.5, 0.1, -- fixme etc. + -- plcolorbar(opt, position, 0.1, 0.4, 0.5, 0.1, -- fixme etc. -- cont_color, cont_width, -- ticks, sub_ticks, -- axis_opts_1, "Test label - Right, Low Cap", @@ -155,7 +155,7 @@ -- position := PL_POSITION_TOP; -- opt := bar_type + PL_COLORBAR_LABEL_TOP + PL_COLORBAR_CAP_HIGH; -- - -- plcolorbar(position, opt, 0.1, 0.1, 0.5, 0.1, + -- plcolorbar(opt, position, 0.1, 0.1, 0.5, 0.1, -- cont_color, cont_width, -- ticks, sub_ticks, -- axis_opts_2, "Test label - Top, High Cap", @@ -164,7 +164,7 @@ -- position := PL_POSITION_BOTTOM; -- opt := bar_type + PL_COLORBAR_LABEL_BOTTOM + PL_COLORBAR_CAP_LOW; -- - -- plcolorbar(position, opt, 0.4, 0.1, 0.5, 0.1, + -- plcolorbar(opt, position, 0.4, 0.1, 0.5, 0.1, -- cont_color, cont_width, -- ticks, sub_ticks, -- axis_opts_2, "Test label - Bottom, Low Cap", @@ -186,7 +186,7 @@ -- colors : Long_Float(0 .. n - 1); -- i : Integer; -- color_step, color_offset : Long_Float; - -- position, opt : Integer; + -- opt, position : Integer; -- axis_opts_1, axis_opts_2 : Unbounded_String; -- begin -- pladv(0); @@ -222,7 +222,7 @@ -- end if; -- end if; -- - -- plcolorbar(position, opt, 0.1, 0.1, 0.5, 0.1, + -- plcolorbar(opt, position, 0.1, 0.1, 0.5, 0.1, -- cont_color, cont_width, -- ticks, sub_ticks, -- axis_opts_1, "Test label - Left, Low Cap", @@ -231,7 +231,7 @@ -- position := PL_POSITION_RIGHT; -- opt := bar_type + PL_COLORBAR_LABEL_RIGHT + PL_COLORBAR_CAP_HIGH; -- - -- plcolorbar(position, opt, 0.1, 0.4, 0.5, 0.1, + -- plcolorbar(opt, position, 0.1, 0.4, 0.5, 0.1, -- cont_color, cont_width, -- ticks, sub_ticks, -- axis_opts_1, "Test label - Right, High Cap", @@ -240,7 +240,7 @@ -- position := PL_POSITION_TOP; -- opt := bar_type + PL_COLORBAR_LABEL_TOP + PL_COLORBAR_CAP_LOW; -- - -- plcolorbar(position, opt, 0.1, 0.1, 0.5, 0.1, + -- plcolorbar(opt, position, 0.1, 0.1, 0.5, 0.1, -- cont_color, cont_width, -- ticks, sub_ticks, -- axis_opts_2, "Test label - Top, Low Cap", @@ -249,7 +249,7 @@ -- position := PL_POSITION_BOTTOM; -- opt := bar_type + PL_COLORBAR_LABEL_BOTTOM + PL_COLORBAR_CAP_HIGH; -- - -- plcolorbar(position, opt, 0.4, 0.1, 0.5, 0.1, + -- plcolorbar(opt, position, 0.4, 0.1, 0.5, 0.1, -- cont_color, cont_width, -- ticks, sub_ticks, -- axis_opts_2, "Test label - Bottom, High Cap", @@ -330,7 +330,7 @@ line_colors(0) := 1 + (k mod 8); symbol_colors(0) := 1 + (k mod 8); - pllegend(legend_width, legend_height, position, opt, 0.05, 0.05, + pllegend(legend_width, legend_height, opt, position, 0.05, 0.05, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, 1.0, 2.0, 1.0, text_colors, text, @@ -398,7 +398,7 @@ y := 0.1; nrow := 1; ncolumn := nlegend; - pllegend(legend_width, legend_height, position, opt, x, y, + pllegend(legend_width, legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, 1.0, text_colors, text, @@ -413,7 +413,7 @@ y := 0.1; nrow := 1; ncolumn := nlegend; - pllegend(legend_width, legend_height, position, opt, x, y, + pllegend(legend_width, legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, 1.0, text_colors, text, @@ -428,7 +428,7 @@ y := 0.0; nrow := nlegend; ncolumn := 1; - pllegend(legend_width, legend_height, position, opt, x, y, + pllegend(legend_width, legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, 1.0, text_colors, text, @@ -443,7 +443,7 @@ y := 0.0; nrow := nlegend; ncolumn := 1; - pllegend(legend_width, legend_height, position, opt, x, y, + pllegend(legend_width, legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, 1.0, text_colors, text, @@ -458,7 +458,7 @@ y := 0.0; nrow := 6; ncolumn := 2; - pllegend(legend_width, legend_height, position, opt, x, y, + pllegend(legend_width, legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, 1.0, text_colors, text, @@ -473,7 +473,7 @@ y := 0.0; nrow := 6; ncolumn := 2; - pllegend(legend_width, legend_height, position, opt, x, y, + pllegend(legend_width, legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, 1.0, text_colors, text, @@ -488,7 +488,7 @@ y := 0.0; nrow := 3; ncolumn := 3; - pllegend(legend_width, legend_height, position, opt, x, y, + pllegend(legend_width, legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, 1.0, text_colors, text, @@ -564,7 +564,7 @@ nrow := Integer'min(3, nlegend); ncolumn := 0; - pllegend(legend_width, legend_height, position, opt, x, y, + pllegend(legend_width, legend_height, opt, position, x, y, 0.025, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 1.5, 1.0, text_colors, text, @@ -662,7 +662,7 @@ opt := opt_base; plscol0a(15, 32, 32, 32, 0.70); - pllegend(legend_width, legend_height, position, opt, x, y, + pllegend(legend_width, legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, 0.0, text_colors, text, @@ -686,7 +686,7 @@ x := x + legend_width; plscol0a(15, 32, 32, 32, 0.70); - pllegend(legend_width, legend_height, position, opt, x, y, + pllegend(legend_width, legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, 0.0, text_colors, text, @@ -711,7 +711,7 @@ x := x + legend_width; plscol0a(15, 32, 32, 32, 0.70); - pllegend(legend_width, legend_height, position, opt, x, y, + pllegend(legend_width, legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, 0.0, text_colors, text, @@ -739,7 +739,7 @@ max_height := 0.0; plscol0a(15, 32, 32, 32, 0.70); - pllegend(legend_width, legend_height, position, opt, x, y, + pllegend(legend_width, legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, 0.0, text_colors, text, @@ -763,7 +763,7 @@ x := x + legend_width; plscol0a(15, 32, 32, 32, 0.70); - pllegend(legend_width, legend_height, position, opt, x, y, + pllegend(legend_width, legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, 0.0, text_colors, text, @@ -787,7 +787,7 @@ x := x + legend_width; plscol0a(15, 32, 32, 32, 0.70); - pllegend(legend_width, legend_height, position, opt, x, y, + pllegend(legend_width, legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, 0.0, text_colors, text, @@ -813,7 +813,7 @@ max_height := 0.0; plscol0a(15, 32, 32, 32, 0.70); - pllegend(legend_width, legend_height, position, opt, x, y, + pllegend(legend_width, legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, 0.0, text_colors, text, @@ -836,7 +836,7 @@ x := x + legend_width; plscol0a(15, 32, 32, 32, 0.70); - pllegend(legend_width, legend_height, position, opt, x, y, + pllegend(legend_width, legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, 0.0, text_colors, text, @@ -859,7 +859,7 @@ x := x + legend_width; plscol0a(15, 32, 32, 32, 0.70); - pllegend(legend_width, legend_height, position, opt, x, y, + pllegend(legend_width, legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, 0.0, text_colors, text, Modified: trunk/examples/ada/xthick04a.adb =================================================================== --- trunk/examples/ada/xthick04a.adb 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/examples/ada/xthick04a.adb 2011-04-21 00:47:06 UTC (rev 11717) @@ -128,7 +128,7 @@ symbols(1) := To_Unbounded_String("*"); Create_Legend(legend_width, legend_height, - 0, Legend_Background + Legend_Bounding_Box, + Legend_Background + Legend_Bounding_Box, 0, 0.0, 0.0, 0.1, White, Red, 1, 0, 0, opt_array, @@ -169,7 +169,7 @@ Box_Scales(0) := 0.0; Create_Legend(legend_width, legend_height, - 0, Legend_Background + Legend_Bounding_Box, + Legend_Background + Legend_Bounding_Box, 0, 0.0, 0.0, 0.1, White, Red, 1, 0, 0, opt_array, Modified: trunk/examples/ada/xthick26a.adb =================================================================== --- trunk/examples/ada/xthick26a.adb 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/examples/ada/xthick26a.adb 2011-04-21 00:47:06 UTC (rev 11717) @@ -204,7 +204,7 @@ Set_One_Color_Map_0_And_Alpha(15, 32, 32, 32, 0.70); Create_Legend(legend_width, legend_height, - 0, Legend_Background + Legend_Bounding_Box, + Legend_Background + Legend_Bounding_Box, 0, 0.0, 0.0, 0.1, 15, 1, 1, 0, 0, opt_array, Modified: trunk/examples/ada/xthick33a.adb =================================================================== --- trunk/examples/ada/xthick33a.adb 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/examples/ada/xthick33a.adb 2011-04-21 00:47:06 UTC (rev 11717) @@ -332,7 +332,7 @@ line_colors(0) := 1 + (k mod 8); symbol_colors(0) := 1 + (k mod 8); - Create_Legend(legend_width, legend_height, position, opt, 0.05, 0.05, + Create_Legend(legend_width, legend_height, opt, position, 0.05, 0.05, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, 1.0, 2.0, 1.0, text_colors, text, @@ -400,7 +400,7 @@ y := 0.1; nrow := 1; ncolumn := nlegend; - Create_Legend(legend_width, legend_height, position, opt, x, y, + Create_Legend(legend_width, legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, 1.0, text_colors, text, @@ -415,7 +415,7 @@ y := 0.1; nrow := 1; ncolumn := nlegend; - Create_Legend(legend_width, legend_height, position, opt, x, y, + Create_Legend(legend_width, legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, 1.0, text_colors, text, @@ -430,7 +430,7 @@ y := 0.0; nrow := nlegend; ncolumn := 1; - Create_Legend(legend_width, legend_height, position, opt, x, y, + Create_Legend(legend_width, legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, 1.0, text_colors, text, @@ -445,7 +445,7 @@ y := 0.0; nrow := nlegend; ncolumn := 1; - Create_Legend(legend_width, legend_height, position, opt, x, y, + Create_Legend(legend_width, legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, 1.0, text_colors, text, @@ -460,7 +460,7 @@ y := 0.0; nrow := 6; ncolumn := 2; - Create_Legend(legend_width, legend_height, position, opt, x, y, + Create_Legend(legend_width, legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, 1.0, text_colors, text, @@ -475,7 +475,7 @@ y := 0.0; nrow := 6; ncolumn := 2; - Create_Legend(legend_width, legend_height, position, opt, x, y, + Create_Legend(legend_width, legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, 1.0, text_colors, text, @@ -490,7 +490,7 @@ y := 0.0; nrow := 3; ncolumn := 3; - Create_Legend(legend_width, legend_height, position, opt, x, y, + Create_Legend(legend_width, legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, 1.0, text_colors, text, @@ -566,7 +566,7 @@ nrow := Integer'min(3, nlegend); ncolumn := 0; - Create_Legend(legend_width, legend_height, position, opt, x, y, + Create_Legend(legend_width, legend_height, opt, position, x, y, 0.025, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 1.5, 1.0, text_colors, text, @@ -664,7 +664,7 @@ opt := opt_base; Set_One_Color_Map_0_And_Alpha(White, 32, 32, 32, 0.70); - Create_Legend(legend_width, legend_height, position, opt, x, y, + Create_Legend(legend_width, legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, 0.0, text_colors, text, @@ -688,7 +688,7 @@ x := x + legend_width; Set_One_Color_Map_0_And_Alpha(White, 32, 32, 32, 0.70); - Create_Legend(legend_width, legend_height, position, opt, x, y, + Create_Legend(legend_width, legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, 0.0, text_colors, text, @@ -713,7 +713,7 @@ x := x + legend_width; Set_One_Color_Map_0_And_Alpha(White, 32, 32, 32, 0.70); - Create_Legend(legend_width, legend_height, position, opt, x, y, + Create_Legend(legend_width, legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, 0.0, text_colors, text, @@ -741,7 +741,7 @@ max_height := 0.0; Set_One_Color_Map_0_And_Alpha(White, 32, 32, 32, 0.70); - Create_Legend(legend_width, legend_height, position, opt, x, y, + Create_Legend(legend_width, legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, 0.0, text_colors, text, @@ -765,7 +765,7 @@ x := x + legend_width; Set_One_Color_Map_0_And_Alpha(White, 32, 32, 32, 0.70); - Create_Legend(legend_width, legend_height, position, opt, x, y, + Create_Legend(legend_width, legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, 0.0, text_colors, text, @@ -789,7 +789,7 @@ x := x + legend_width; Set_One_Color_Map_0_And_Alpha(White, 32, 32, 32, 0.70); - Create_Legend(legend_width, legend_height, position, opt, x, y, + Create_Legend(legend_width, legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, 0.0, text_colors, text, @@ -815,7 +815,7 @@ max_height := 0.0; Set_One_Color_Map_0_And_Alpha(White, 32, 32, 32, 0.70); - Create_Legend(legend_width, legend_height, position, opt, x, y, + Create_Legend(legend_width, legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, 0.0, text_colors, text, @@ -838,7 +838,7 @@ x := x + legend_width; Set_One_Color_Map_0_And_Alpha(White, 32, 32, 32, 0.70); - Create_Legend(legend_width, legend_height, position, opt, x, y, + Create_Legend(legend_width, legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, 0.0, text_colors, text, @@ -861,7 +861,7 @@ x := x + legend_width; Set_One_Color_Map_0_And_Alpha(White, 32, 32, 32, 0.70); - Create_Legend(legend_width, legend_height, position, opt, x, y, + Create_Legend(legend_width, legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, 0.0, text_colors, text, Modified: trunk/examples/c/x04c.c =================================================================== --- trunk/examples/c/x04c.c 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/examples/c/x04c.c 2011-04-21 00:47:06 UTC (rev 11717) @@ -143,7 +143,7 @@ plscol0a( 15, 32, 32, 32, 0.70 ); pllegend( &legend_width, &legend_height, - 0, PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX, + PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX, 0, 0.0, 0.0, 0.1, 15, 1, 1, 0, 0, nlegend, opt_array, Modified: trunk/examples/c/x26c.c =================================================================== --- trunk/examples/c/x26c.c 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/examples/c/x26c.c 2011-04-21 00:47:06 UTC (rev 11717) @@ -243,7 +243,7 @@ plscol0a( 15, 32, 32, 32, 0.70 ); pllegend( &legend_width, &legend_height, - 0, PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX, + PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX, 0, 0.0, 0.0, 0.10, 15, 1, 1, 0, 0, nlegend, opt_array, Modified: trunk/examples/c/x33c.c =================================================================== --- trunk/examples/c/x33c.c 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/examples/c/x33c.c 2011-04-21 00:47:06 UTC (rev 11717) @@ -346,7 +346,7 @@ line_colors[0] = 1 + ( k % 8 ); symbol_colors[0] = 1 + ( k % 8 ); - pllegend( &legend_width, &legend_height, position, opt, 0.05, 0.05, + pllegend( &legend_width, &legend_height, opt, position, 0.05, 0.05, 0.1, 15, 1, 1, 0, 0, nlegend, opt_array, 1.0, 1.0, 2.0, 1., text_colors, (const char **) text, @@ -394,7 +394,7 @@ y = 0.1; nrow = 1; ncolumn = nlegend; - pllegend( &legend_width, &legend_height, position, opt, x, y, + pllegend( &legend_width, &legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 2.0, 1., text_colors, (const char **) text, @@ -408,7 +408,7 @@ y = 0.1; nrow = 1; ncolumn = nlegend; - pllegend( &legend_width, &legend_height, position, opt, x, y, + pllegend( &legend_width, &legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 2.0, 1., text_colors, (const char **) text, @@ -422,7 +422,7 @@ y = 0.; nrow = nlegend; ncolumn = 1; - pllegend( &legend_width, &legend_height, position, opt, x, y, + pllegend( &legend_width, &legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 2.0, 1., text_colors, (const char **) text, @@ -436,7 +436,7 @@ y = 0.; nrow = nlegend; ncolumn = 1; - pllegend( &legend_width, &legend_height, position, opt, x, y, + pllegend( &legend_width, &legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 2.0, 1., text_colors, (const char **) text, @@ -450,7 +450,7 @@ y = 0.; nrow = 6; ncolumn = 2; - pllegend( &legend_width, &legend_height, position, opt, x, y, + pllegend( &legend_width, &legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 2.0, 1., text_colors, (const char **) text, @@ -464,7 +464,7 @@ y = 0.; nrow = 6; ncolumn = 2; - pllegend( &legend_width, &legend_height, position, opt, x, y, + pllegend( &legend_width, &legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 2.0, 1., text_colors, (const char **) text, @@ -478,7 +478,7 @@ y = 0.; nrow = 3; ncolumn = 3; - pllegend( &legend_width, &legend_height, position, opt, x, y, + pllegend( &legend_width, &legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 2.0, 1., text_colors, (const char **) text, @@ -530,7 +530,7 @@ nrow = MIN( 3, nlegend ); ncolumn = 0; - pllegend( &legend_width, &legend_height, position, opt, x, y, + pllegend( &legend_width, &legend_height, opt, position, x, y, 0.025, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 1.5, 1., text_colors, (const char **) text, @@ -614,7 +614,7 @@ opt = opt_base; plscol0a( 15, 32, 32, 32, 0.70 ); - pllegend( &legend_width, &legend_height, position, opt, x, y, + pllegend( &legend_width, &legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, nlegend, opt_array, 1.0, text_scale, 2.0, 0., text_colors, (const char **) text, @@ -639,7 +639,7 @@ x += legend_width; plscol0a( 15, 32, 32, 32, 0.70 ); - pllegend( &legend_width, &legend_height, position, opt, x, y, + pllegend( &legend_width, &legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, nlegend, opt_array, 1.0, text_scale, 2.0, 0., text_colors, (const char **) text, @@ -664,7 +664,7 @@ x += legend_width; plscol0a( 15, 32, 32, 32, 0.70 ); - pllegend( &legend_width, &legend_height, position, opt, x, y, + pllegend( &legend_width, &legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, nlegend, opt_array, 1.0, text_scale, 2.0, 0., text_colors, (const char **) text, @@ -692,7 +692,7 @@ max_height = 0.; plscol0a( 15, 32, 32, 32, 0.70 ); - pllegend( &legend_width, &legend_height, position, opt, x, y, + pllegend( &legend_width, &legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, nlegend, opt_array, 1.0, text_scale, 2.0, 0., text_colors, (const char **) text, @@ -717,7 +717,7 @@ x += legend_width; plscol0a( 15, 32, 32, 32, 0.70 ); - pllegend( &legend_width, &legend_height, position, opt, x, y, + pllegend( &legend_width, &legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, nlegend, opt_array, 1.0, text_scale, 2.0, 0., text_colors, (const char **) text, @@ -742,7 +742,7 @@ x += legend_width; plscol0a( 15, 32, 32, 32, 0.70 ); - pllegend( &legend_width, &legend_height, position, opt, x, y, + pllegend( &legend_width, &legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, nlegend, opt_array, 1.0, text_scale, 2.0, 0., text_colors, (const char **) text, @@ -769,7 +769,7 @@ max_height = 0.; plscol0a( 15, 32, 32, 32, 0.70 ); - pllegend( &legend_width, &legend_height, position, opt, x, y, + pllegend( &legend_width, &legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, nlegend, opt_array, 1.0, text_scale, 2.0, 0., text_colors, (const char **) text, @@ -793,7 +793,7 @@ x += legend_width; plscol0a( 15, 32, 32, 32, 0.70 ); - pllegend( &legend_width, &legend_height, position, opt, x, y, + pllegend( &legend_width, &legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, nlegend, opt_array, 1.0, text_scale, 2.0, 0., text_colors, (const char **) text, @@ -817,7 +817,7 @@ x += legend_width; plscol0a( 15, 32, 32, 32, 0.70 ); - pllegend( &legend_width, &legend_height, position, opt, x, y, + pllegend( &legend_width, &legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, nlegend, opt_array, 1.0, text_scale, 2.0, 0., text_colors, (const char **) text, Modified: trunk/examples/c++/x04.cc =================================================================== --- trunk/examples/c++/x04.cc 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/examples/c++/x04.cc 2011-04-21 00:47:06 UTC (rev 11717) @@ -172,7 +172,7 @@ pls->scol0a( 15, 32, 32, 32, 0.70 ); pls->legend( &legend_width, &legend_height, - 0, PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX, + PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX, 0, 0.0, 0.0, 0.1, 15, 1, 1, 0, 0, nlegend, opt_array, Modified: trunk/examples/c++/x26.cc =================================================================== --- trunk/examples/c++/x26.cc 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/examples/c++/x26.cc 2011-04-21 00:47:06 UTC (rev 11717) @@ -253,7 +253,7 @@ pls->scol0a( 15, 32, 32, 32, 0.70 ); pls->legend( &legend_width, &legend_height, - 0, PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX, + PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX, 0, 0.0, 0.0, 0.10, 15, 1, 1, 0, 0, nlegend, opt_array, Modified: trunk/examples/c++/x33.cc =================================================================== --- trunk/examples/c++/x33.cc 2011-04-20 23:26:48 UTC (rev 11716) +++ trunk/examples/c++/x33.cc 2011-04-21 00:47:06 UTC (rev 11717) @@ -100,7 +100,7 @@ colors[i] = 0.0 + color_step * (PLFLT) ( i ); } - PLINT position, opt; + PLINT opt, position; position = PL_POSITION_LEFT; opt = bar_type | PL_COLORBAR_LABEL_LEFT | PL_COLORBAR_CAP_HIGH; @@ -125,7 +125,7 @@ } } - pls->colorbar( position, opt, 0.1, 0.1, 0.5, 0.1, + pls->colorbar( opt, position, 0.1, 0.1, 0.5, 0.1, cont_color, cont_width, ticks, sub_ticks, axis_opts_1, "Test label - Left, High Cap", n, colors, values ); @@ -134,7 +134,7 @@ opt = bar_type | PL_COLORBAR_LABEL_RIGHT | PL_COLORBAR_CAP_LOW; - pls->colorbar( position, opt, 0.1, 0.4, 0.5, 0.1, + pls->colorbar( opt, position, 0.1, 0.4, 0.5, 0.1, cont_color, cont_width, ticks, sub_ticks, axis_opts_1, "Test label - Right, Low Cap", n, colors, values ); @@ -143,7 +143,7 @@ opt = bar_type | PL_COLORBAR_LABEL_TOP | PL_COLORBAR_CAP_HIGH; - pls->colorbar( position, opt, 0.1, 0.1, 0.5, 0.1, + pls->colorbar( opt, position, 0.1, 0.1, 0.5, 0.1, cont_color, cont_width, ticks, sub_ticks, axis_opts_2, "Test label - Top, High Cap", n, colors, values ); @@ -152,7 +152,7 @@ opt = bar_type | PL_COLORBAR_LABEL_BOTTOM | PL_COLORBAR_CAP_LOW; - pls->colorbar( position, opt, 0.4, 0.1, 0.5, 0.1, + pls->colorbar( opt, position, 0.4, 0.1, 0.5, 0.1, cont_color, cont_width, ticks, sub_ticks, axis_opts_2, "Test label - Bottom, Low Cap", n, colors, values ); @@ -178,7 +178,7 @@ colors[i] = 0.0 + color_step * (PLFLT) ( i ); } - PLINT position, opt; + PLINT opt, position; position = PL_POSITION_LEFT; opt = bar_type | PL_COLORBAR_LABEL_LEFT | PL_COLORBAR_CAP_LOW; @@ -203,7 +203,7 @@ } } - pls->colorbar( position, opt, 0.1, 0.1, 0.5, 0.1, + pls->colorbar( opt, position, 0.1, 0.1, 0.5, 0.1, cont_color, cont_width, ticks, sub_ticks, axis_opts_1, "Test label - Left, Low Cap", n, colors, values ); @@ -212,7 +212,7 @@ opt = bar_type | PL_COLORBAR_LABEL_RIGHT | PL_COLORBAR_CAP_HIGH; - pls->colorbar( position, opt, 0.1, 0.4, 0.5, 0.1, + pls->colorbar( opt, position, 0.1, 0.4, 0.5, 0.1, cont_color, cont_width, ticks, sub_ticks, axis_opts_1, "Test label - Right, High Cap", n, colors, values ); @@ -221,7 +221,7 @@ opt = bar_type | PL_COLORBAR_LABEL_TOP | PL_COLORBAR_CAP_LOW; - pls->colorbar( position, opt, 0.1, 0.1, 0.5, 0.1, + pls->colorbar( opt, position, 0.1, 0.1, 0.5, 0.1, cont_color, cont_width, ticks, sub_ticks, axis_opts_2, "Test label - Top, Low Cap", n, colors, values ); @@ -230,7 +230,7 @@ opt = bar_type | PL_COLORBAR_LABEL_BOTTOM | PL_COLORBAR_CAP_HIGH; - pls->colorbar( position, opt, 0.4, 0.1, 0.5, 0.1, + pls->colorbar( opt, position, 0.4, 0.1, 0.5, 0.1, cont_color, cont_width, ticks, sub_ticks, axis_opts_2, "Test label - Bottom, High Cap", n, colors, values ); @@ -316,7 +316,7 @@ line_colors[0] = 1 + ( k % 8 ); symbol_colors[0] = 1 + ( k % 8 ); - pls->legend( &legend_width, &legend_height, position, opt, 0.05, 0.05, + pls->legend( &legend_width, &legend_height, opt, position, 0.05, 0.05, 0.1, 15, 1, 1, 0, 0, nlegend, opt_array, 1.0, 1.0, 2.0, 1., text_colors, (const char **) text, @@ -364,7 +364,7 @@ y = 0.1; nrow = 1; ncolumn = nlegend; - pls->legend( &legend_width, &legend_height, position, opt, x, y, + pls->legend( &legend_width, &legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 2.0, 1., text_colors, (const char **) text, @@ -378,7 +378,7 @@ y = 0.1; nrow = 1; ncolumn = nlegend; - pls->legend( &legend_width, &legend_height, position, opt, x, y, + pls->legend( &legend_width, &legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 2.0, 1., text_colors, (const char **) text, @@ -392,7 +392,7 @@ y = 0.; nrow = nlegend; ncolumn = 1; - pls->legend( &legend_width, &legend_height, position, opt, x, y, + pls->legend( &legend_width, &legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 2.0, 1., text_colors, (const char **) text, @@ -406,7 +406,7 @@ y = 0.; nrow = nlegend; ncolumn = 1; - pls->legend( &legend_width, &legend_height, position, opt, x, y, + pls->legend( &legend_width, &legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 2.0, 1., text_colors, (const char **) text, @@ -420,7 +420,7 @@ y = 0.; nrow = 6; ncolumn = 2; - pls->legend( &legend_width, &legend_height, position, opt, x, y, + pls->legend( &legend_width, &legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 2.0, 1., text_colors, (const char **) text, @@ -434,7 +434,7 @@ y = 0.; nrow = 6; ncolumn = 2; - pls->legend( &legend_width, &legend_height, position, opt, x, y, + pls->legend( &legend_width, &legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 2.0, 1., text_colors, (const char **) text, @@ -448,7 +448,7 @@ y = 0.; nrow = 3; ncolumn = 3; - pls->legend( &legend_width, &legend_height, position, opt, x, y, + pls->legend( &legend_width, &legend_height, opt, position, x, y, 0.05, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 2.0, 1., text_colors, (const char **) text, @@ -500,7 +500,7 @@ nrow = MIN( 3, nlegend ); ncolumn = 0; - pls->legend( &legend_width, &legend_height, position, opt, x, y, + pls->legend( &legend_width, &legend_height, opt, position, x, y, 0.025, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 1.5, 1., text_colors, (const char **) text, @@ -584,7 +584,7 @@ opt = opt_base; pls->scol0a( 15, 32, 32, 32, 0.70 ); - pls->legend( &legend_width, &legend_height, position, opt, x, y, + pls->legend( &legend_width, &legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, nlegend, opt_array, 1.0, text_scale, 2.0, 0., text_colors, (const char **) text, @@ -609,7 +609,7 @@ x += legend_width; pls->scol0a( 15, 32, 32, 32, 0.70 ); - pls->legend( &legend_width, &legend_height, position, opt, x, y, + pls->legend( &legend_width, &legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, nlegend, opt_array, 1.0, text_scale, 2.0, 0., text_colors, (const char **) text, @@ -634,7 +634,7 @@ x += legend_width; pls->scol0a( 15, 32, 32, 32, 0.70 ); - pls->legend( &legend_width, &legend_height, position, opt, x, y, + pls->legend( &legend_width, &legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, nlegend, opt_array, 1.0, text_scale, 2.0, 0., text_colors, (const char **) text, @@ -662,7 +662,7 @@ max_height = 0.; pls->scol0a( 15, 32, 32, 32, 0.70 ); - pls->legend( &legend_width, &legend_height, position, opt, x, y, + pls->legend( &legend_width, &legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, nlegend, opt_array, 1.0, text_scale, 2.0, 0., text_colors, (const char **) text, @@ -687,7 +687,7 @@ x += legend_width; pls->scol0a( 15, 32, 32, 32, 0.70 ); - pls->legend( &legend_width, &legend_height, position, opt, x, y, + pls->legend( &legend_width, &legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, nlegend, opt_array, 1.0, text_scale, 2.0, 0., text_colors, (const char **) text, @@ -712,7 +712,7 @@ x += legend_width; pls->scol0a( 15, 32, 32, 32, 0.70 ); - pls->legend( &legend_width, &legend_height, position, opt, x, y, + pls->legend( &legend_width, &legend_height, opt, position, x, y, 0.1, 15, 1, 1, 0, 0, nlegend, opt_array, 1.0, text_scale, 2.0, 0.... [truncated message content] |
From: <hez...@us...> - 2011-04-22 04:48:49
|
Revision: 11718 http://plplot.svn.sourceforge.net/plplot/?rev=11718&view=rev Author: hezekiahcarty Date: 2011-04-22 04:48:42 +0000 (Fri, 22 Apr 2011) Log Message: ----------- Swap plcolorbar position and opt parameter order to match pllegend Modified Paths: -------------- trunk/examples/c/x33c.c trunk/src/pllegend.c Modified: trunk/examples/c/x33c.c =================================================================== --- trunk/examples/c/x33c.c 2011-04-21 00:47:06 UTC (rev 11717) +++ trunk/examples/c/x33c.c 2011-04-22 04:48:42 UTC (rev 11718) @@ -230,7 +230,7 @@ plsmaj( 0.0, 0.5 ); plsmin( 0.0, 0.5 ); - plcolorbar( position, opt, + plcolorbar( opt, position, x, y, length, width, low_cap_color, high_cap_color, cont_color, cont_width, Modified: trunk/src/pllegend.c =================================================================== --- trunk/src/pllegend.c 2011-04-21 00:47:06 UTC (rev 11717) +++ trunk/src/pllegend.c 2011-04-22 04:48:42 UTC (rev 11718) @@ -998,10 +998,6 @@ //-------------------------------------------------------------------------- //! Plot color bar for image, shade or gradient plots. //! -//! @param position This variable defines the placement of the colorbar on the -//! subpage. The position can be one of PL_POSITION_TOP, -//! PL_POSITION_BOTTOM, PL_POSITION_LEFT or PL_POSITION_RIGHT. The colorbar -//! will be drawn perpendicular to the given side of the subpage. //! @param opt This variable contains bits which control the overall colorbar. //! The type of colorbar can be specified with PL_COLORBAR_SHADE, //! PL_COLORBAR_IMAGE or PL_COLORBAR_GRADIENT. The position of the (optional) @@ -1015,6 +1011,10 @@ //! any tick marks and tick labels will be placed at the breaks between shaded //! segments. TODO: This should be expanded to support custom placement of //! tick marks and tick labels at custom value locations for any colorbar type. +//! @param position This variable defines the placement of the colorbar on the +//! subpage. The position can be one of PL_POSITION_TOP, +//! PL_POSITION_BOTTOM, PL_POSITION_LEFT or PL_POSITION_RIGHT. The colorbar +//! will be drawn perpendicular to the given side of the subpage. //! @param x Colorbar displacement distance along/away from the horizonal axis //! in normalized subpage coordinates. //! @param y Colorbar displacement distance along/away from the vertical axis @@ -1053,7 +1053,7 @@ //! void -c_plcolorbar( PLINT position, PLINT opt, +c_plcolorbar( PLINT opt, PLINT position, PLFLT x, PLFLT y, PLFLT length, PLFLT width, PLFLT low_cap_color, PLFLT high_cap_color, PLINT cont_color, PLINT cont_width, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hez...@us...> - 2011-04-22 04:48:57
|
Revision: 11719 http://plplot.svn.sourceforge.net/plplot/?rev=11719&view=rev Author: hezekiahcarty Date: 2011-04-22 04:48:51 +0000 (Fri, 22 Apr 2011) Log Message: ----------- Add plcolorbar pages to C example 33 without caps This also adds a PL_COLORBAR_CAP_NONE definition to plplot.h to avoid an ugly hard-coded 0 in user code like example 33. Modified Paths: -------------- trunk/examples/c/x33c.c trunk/include/plplot.h Modified: trunk/examples/c/x33c.c =================================================================== --- trunk/examples/c/x33c.c 2011-04-22 04:48:42 UTC (rev 11718) +++ trunk/examples/c/x33c.c 2011-04-22 04:48:51 UTC (rev 11719) @@ -108,13 +108,15 @@ }; // Colorbar cap options -#define COLORBAR_CAPS 3 +#define COLORBAR_CAPS 4 static PLINT colorbar_cap_options[COLORBAR_CAPS] = { + PL_COLORBAR_CAP_NONE, PL_COLORBAR_CAP_LOW, PL_COLORBAR_CAP_HIGH, PL_COLORBAR_CAP_LOW | PL_COLORBAR_CAP_HIGH }; static const char *colorbar_cap_option_labels[COLORBAR_CAPS] = { + "No caps", "Low cap", "High cap", "Low and high caps" Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2011-04-22 04:48:42 UTC (rev 11718) +++ trunk/include/plplot.h 2011-04-22 04:48:51 UTC (rev 11719) @@ -1249,6 +1249,7 @@ #define PL_COLORBAR_IMAGE 16 #define PL_COLORBAR_SHADE 32 #define PL_COLORBAR_GRADIENT 64 +#define PL_COLORBAR_CAP_NONE 0 #define PL_COLORBAR_CAP_LOW 128 #define PL_COLORBAR_CAP_HIGH 256 #define PL_COLORBAR_SHADE_LABEL 512 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-04-28 22:46:56
|
Revision: 11727 http://plplot.svn.sourceforge.net/plplot/?rev=11727&view=rev Author: airwin Date: 2011-04-28 22:46:49 +0000 (Thu, 28 Apr 2011) Log Message: ----------- Replace width, length arguments of plcolorbar with orientation-independent x_length and y_length. Modified Paths: -------------- trunk/examples/c/x16c.c trunk/examples/c/x33c.c trunk/include/plplot.h trunk/src/pllegend.c Modified: trunk/examples/c/x16c.c =================================================================== --- trunk/examples/c/x16c.c 2011-04-28 13:53:02 UTC (rev 11726) +++ trunk/examples/c/x16c.c 2011-04-28 22:46:49 UTC (rev 11727) @@ -242,7 +242,7 @@ plsmin( 0.0, 0.5 ); plcolorbar( PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, PL_POSITION_RIGHT, - 0.05, 0.15, 0.7, 0.03, 0.0, 0.0, + 0.05, 0.15, 0.03, 0.7, 0.0, 0.0, cont_color, cont_width, 0.0, 0, "bv", "", ns + 1, shedge ); @@ -288,7 +288,7 @@ plsmin( 0.0, 0.5 ); plcolorbar( PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, PL_POSITION_RIGHT, - 0.05, 0.15, 0.7, 0.03, 0.0, 0.0, + 0.05, 0.15, 0.03, 0.7, 0.0, 0.0, cont_color, cont_width, 0.0, 0, "bv", "", ns + 1, shedge ); @@ -334,7 +334,7 @@ plsmin( 0.0, 0.5 ); plcolorbar( PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, PL_POSITION_RIGHT, - 0.05, 0.15, 0.7, 0.03, 0.0, 0.0, + 0.05, 0.15, 0.03, 0.7, 0.0, 0.0, cont_color, cont_width, 0.0, 0, "bv", "", ns + 1, shedge ); @@ -379,7 +379,7 @@ plsmin( 0.0, 0.5 ); plcolorbar( PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, PL_POSITION_RIGHT, - 0.05, 0.15, 0.7, 0.03, 0.0, 0.0, + 0.05, 0.15, 0.03, 0.7, 0.0, 0.0, 2, 3, 0.0, 0, "bv", "", ns + 1, shedge ); @@ -475,7 +475,7 @@ plsmin( 0.0, 0.5 ); plcolorbar( PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, PL_POSITION_RIGHT, - 0.06, 0.15, 0.7, 0.03, 0.0, 0.0, + 0.06, 0.15, 0.03, 0.7, 0.0, 0.0, cont_color, cont_width, 0.0, 0, "bv", "", ns + 1, shedge ); Modified: trunk/examples/c/x33c.c =================================================================== --- trunk/examples/c/x33c.c 2011-04-28 13:53:02 UTC (rev 11726) +++ trunk/examples/c/x33c.c 2011-04-28 22:46:49 UTC (rev 11727) @@ -152,7 +152,7 @@ { // Parameters for the colorbars on this page PLINT position_i, position, opt; - PLFLT x, y, length, width; + PLFLT x, y, x_length, y_length; PLFLT ticks; PLINT sub_ticks; PLFLT low_cap_color, high_cap_color; @@ -161,9 +161,6 @@ char label[200]; char title[200]; - length = 0.5; - width = 0.05; - ticks = 0.0; sub_ticks = 0; @@ -189,11 +186,16 @@ { x = 0.1; y = 0.25; + x_length = 0.05; + y_length = 0.5; + } else { x = 0.25; y = 0.1; + x_length = 0.5; + y_length = 0.05; } // Set appropriate labeling options @@ -233,7 +235,7 @@ plsmin( 0.0, 0.5 ); plcolorbar( opt, position, - x, y, length, width, + x, y, x_length, y_length, low_cap_color, high_cap_color, cont_color, cont_width, ticks, sub_ticks, Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2011-04-28 13:53:02 UTC (rev 11726) +++ trunk/include/plplot.h 2011-04-28 22:46:49 UTC (rev 11727) @@ -1278,7 +1278,7 @@ // Routine for drawing continous colour legends PLDLLIMPEXP void c_plcolorbar( PLINT position, PLINT opt, - PLFLT x, PLFLT y, PLFLT length, PLFLT width, + PLFLT x, PLFLT y, PLFLT x_length, PLFLT y_length, PLFLT low_cap_color, PLFLT high_cap_color, PLINT cont_color, PLINT cont_width, PLFLT ticks, PLINT sub_ticks, Modified: trunk/src/pllegend.c =================================================================== --- trunk/src/pllegend.c 2011-04-28 13:53:02 UTC (rev 11726) +++ trunk/src/pllegend.c 2011-04-28 22:46:49 UTC (rev 11727) @@ -980,19 +980,25 @@ //-------------------------------------------------------------------------- //! Plot color bar for image, shade or gradient plots. //! -//! @param opt This variable contains bits which control the overall colorbar. -//! The type of colorbar can be specified with PL_COLORBAR_SHADE, -//! PL_COLORBAR_IMAGE or PL_COLORBAR_GRADIENT. The position of the (optional) -//! label/title can be specified with -//! PL_COLORBAR_LABEL_(LEFT|RIGHT|TOP|BOTTOM). If no label position is -//! specified then no label will be drawn. End-caps for the colorbar can -//! added with PL_COLORBAR_CAP_LOW and PL_COLORBAR_CAP_HIGH. If a particular -//! colorbar cap option is not specified then no cap will be drawn for that -//! end. As a special case for PL_COLORBAR_SHADE, the option -//! PL_COLORBAR_SHADE_LABEL can be specified. If this option is provided then -//! any tick marks and tick labels will be placed at the breaks between shaded -//! segments. TODO: This should be expanded to support custom placement of -//! tick marks and tick labels at custom value locations for any colorbar type. +//! @param opt This variable contains bits which control the overall +//! colorbar. The orientation (direction of the maximum value) of the +//! colorbar is specified with PL_COLORBAR_ORIENT_(RIGHT, TOP, LEFT, +//! BOTTOM). If none of those bits are specified, the default orientation +//! is toward the top, i.e., a vertical colorbar. The type of +//! colorbar can be specified with PL_COLORBAR_SHADE, +//! PL_COLORBAR_IMAGE or PL_COLORBAR_GRADIENT. The position of the +//! (optional) label/title can be specified with +//! PL_COLORBAR_LABEL_(LEFT|RIGHT|TOP|BOTTOM). If no label position +//! is specified then no label will be drawn. End-caps for the +//! colorbar can added with PL_COLORBAR_CAP_LOW and +//! PL_COLORBAR_CAP_HIGH. If a particular colorbar cap option is not +//! specified then no cap will be drawn for that end. As a special +//! case for PL_COLORBAR_SHADE, the option PL_COLORBAR_SHADE_LABEL can +//! be specified. If this option is provided then any tick marks and +//! tick labels will be placed at the breaks between shaded segments. +//! TODO: This should be expanded to support custom placement of tick +//! marks and tick labels at custom value locations for any colorbar +//! type. //! @param position This variable defines the placement of the colorbar on the //! subpage. The position can be one of PL_POSITION_TOP, //! PL_POSITION_BOTTOM, PL_POSITION_LEFT or PL_POSITION_RIGHT. The colorbar @@ -1001,12 +1007,10 @@ //! in normalized subpage coordinates. //! @param y Colorbar displacement distance along/away from the vertical axis //! in normalized subpage coordinates. -//! @param length Length of the colorbar along its major axis (ex. along the -//! top of the subpage if pos is PL_POSITION_TOP) in normalized subpage -//! coordinates. -//! @param width Width of the colorbar along the minor axis (ex. fraction of -//! the vertical subpage size if pos is PL_POSITION_TOP) in normalized subpage -//! coordinates. +//! @param x_length Length of the colorbar in the X direction in +//! adopted coordinates. +//! @param y_length Length of the colorbar in the Y direction in +//! adopted coordinates. //! @param low_cap_color Color of the low-end color bar cap, if it is drawn. //! @param high_cap_color Color of the high-end color bar cap, if it is drawn. //! @param cont_color Contour color for PL_COLORBAR_SHADE plots. This is @@ -1036,7 +1040,7 @@ void c_plcolorbar( PLINT opt, PLINT position, - PLFLT x, PLFLT y, PLFLT length, PLFLT width, + PLFLT x, PLFLT y, PLFLT x_length, PLFLT y_length, PLFLT low_cap_color, PLFLT high_cap_color, PLINT cont_color, PLINT cont_width, PLFLT ticks, PLINT sub_ticks, @@ -1082,8 +1086,8 @@ { vx_min = x; vy_min = y; - vx_max = vx_min + width; - vy_max = vy_min + length; + vx_max = vx_min + x_length; + vy_max = vy_min + y_length; wx_min = 0.0; wy_min = min_value; wx_max = 1.0; @@ -1091,10 +1095,10 @@ } else if ( position & PL_POSITION_RIGHT ) { - vx_min = 1.0 - x - width; + vx_min = 1.0 - x - x_length; vy_min = y; - vx_max = vx_min + width; - vy_max = vy_min + length; + vx_max = vx_min + x_length; + vy_max = vy_min + y_length; wx_min = 0.0; wy_min = min_value; wx_max = 1.0; @@ -1103,9 +1107,9 @@ else if ( position & PL_POSITION_TOP ) { vx_min = x; - vy_min = 1.0 - y - width; - vx_max = vx_min + length; - vy_max = vy_min + width; + vy_min = 1.0 - y - y_length; + vx_max = vx_min + x_length; + vy_max = vy_min + y_length; wx_min = min_value; wy_min = 0.0; wx_max = max_value; @@ -1115,8 +1119,8 @@ { vx_min = x; vy_min = y; - vx_max = vx_min + length; - vy_max = vy_min + width; + vx_max = vx_min + x_length; + vy_max = vy_min + y_length; wx_min = min_value; wy_min = 0.0; wx_max = max_value; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-04-30 04:22:52
|
Revision: 11734 http://plplot.svn.sourceforge.net/plplot/?rev=11734&view=rev Author: airwin Date: 2011-04-30 04:22:46 +0000 (Sat, 30 Apr 2011) Log Message: ----------- Add example 33 to Perl/PDL examples tests. Drop all PDL::Graphics::PLplot version logic for choice of examples. Instead use all examples since those work with the latest PDL::Graphics::PLplot version (0.55) which is the only version allowed by the cmake/modules/pdl.cmake logic. Modified Paths: -------------- trunk/examples/perl/CMakeLists.txt trunk/plplot_test/test_pdl.sh.in Modified: trunk/examples/perl/CMakeLists.txt =================================================================== --- trunk/examples/perl/CMakeLists.txt 2011-04-30 04:18:48 UTC (rev 11733) +++ trunk/examples/perl/CMakeLists.txt 2011-04-30 04:22:46 UTC (rev 11734) @@ -56,6 +56,7 @@ "29" "30" "31" + "33" ) set(perl_SCRIPTS) Modified: trunk/plplot_test/test_pdl.sh.in =================================================================== --- trunk/plplot_test/test_pdl.sh.in 2011-04-30 04:18:48 UTC (rev 11733) +++ trunk/plplot_test/test_pdl.sh.in 2011-04-30 04:22:46 UTC (rev 11734) @@ -1,7 +1,7 @@ #!@SH_EXECUTABLE@ # Test suite for perl examples. # -# Copyright (C) 2004 Alan W. Irwin +# Copyright (C) 2004-2011 Alan W. Irwin # # This file is part of PLplot. # @@ -36,13 +36,7 @@ export LD_LIBRARY_PATH=../src:"@LIB_DIR@":$LD_LIBRARY_PATH fi -if [ "@HAVE_PDL_GRAPHICS_PLPLOT_40@" = "ON" ] ; then - INDEX_LIST="01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31" -else - # Examples 02, 20, 21, 23, 24, 28, 29, and 30 require PDL::Graphics::PLplot - # version 0.46 or later. - INDEX_LIST="01 03 04 05 06 07 08 09 10 11 12 13 15 16 18 19 22 25 26 27" -fi +INDEX_LIST="01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33" for index in $INDEX_LIST ; do if [ "$verbose_test" ] ; then This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |