From: <and...@us...> - 2011-08-04 08:58:59
|
Revision: 11851 http://plplot.svn.sourceforge.net/plplot/?rev=11851&view=rev Author: andrewross Date: 2011-08-04 08:58:52 +0000 (Thu, 04 Aug 2011) Log Message: ----------- Tweak C example 27. Update C++, f77 and f95 versions to include plarc demo. Modified Paths: -------------- trunk/examples/c/x27c.c trunk/examples/c++/x27.cc trunk/examples/f77/x27f.fm4 trunk/examples/f95/x27f.f90 Modified: trunk/examples/c/x27c.c =================================================================== --- trunk/examples/c/x27c.c 2011-08-04 08:23:43 UTC (rev 11850) +++ trunk/examples/c/x27c.c 2011-08-04 08:58:52 UTC (rev 11851) @@ -24,8 +24,6 @@ #include "plcdemos.h" -#define DEG_TO_RAD( x ) ( ( x ) * M_PI / 180.0 ) - // Function prototypes void cycloid( void ); @@ -227,7 +225,7 @@ void arcs() { #define NSEG 8 int i; - PLFLT theta, dtheta, thetarad; + PLFLT theta, dtheta; PLFLT a, b; theta = 0.0; @@ -244,11 +242,11 @@ // Draw several filled ellipses inside the circle at different // angles. a = 3.0; - b = a * tan( DEG_TO_RAD(dtheta)/2.0 ); + b = a * tan( (dtheta/180.0*M_PI)/2.0 ); theta = dtheta/2.0; for ( i = 0; i < NSEG; i++ ) { plcol0( 2 - i%2 ); - plarc( a*cos(DEG_TO_RAD(theta)), a*sin(DEG_TO_RAD(theta)), a, b, 0.0, 360.0, theta, 1); + plarc( a*cos(theta/180.0*M_PI), a*sin(theta/180.0*M_PI), a, b, 0.0, 360.0, theta, 1); theta = theta + dtheta; } Modified: trunk/examples/c++/x27.cc =================================================================== --- trunk/examples/c++/x27.cc 2011-08-04 08:23:43 UTC (rev 11850) +++ trunk/examples/c++/x27.cc 2011-08-04 08:58:52 UTC (rev 11851) @@ -32,13 +32,13 @@ using namespace std; #endif - class x27 { public: x27( int, const char ** ); void cycloid( void ); void spiro( PLFLT data[], int fill ); PLINT gcd( PLINT a, PLINT b ); + void arcs(); private: // Class data @@ -120,6 +120,12 @@ pls->vpor( 0.0, 1.0, 0.0, 1.0 ); spiro( ¶ms[i][0], fill ); } + + // Finally, an example to test out plarc capabilities + + arcs(); + + delete pls; } @@ -224,7 +230,38 @@ } } +void +x27::arcs() { +#define NSEG 8 + int i; + PLFLT theta, dtheta; + PLFLT a, b; + theta = 0.0; + dtheta = 360.0 / NSEG; + pls->env( -10.0, 10.0, -10.0, 10.0, 1, 0 ); + + // Plot segments of circle in different colors + for ( i = 0; i < NSEG; i++ ) { + pls->col0( i%2 + 1 ); + pls->arc(0.0, 0.0, 8.0, 8.0, theta, theta + dtheta, 0.0, 0); + theta = theta + dtheta; + } + + // Draw several filled ellipses inside the circle at different + // angles. + a = 3.0; + b = a * tan( (dtheta/180.0*M_PI)/2.0 ); + theta = dtheta/2.0; + for ( i = 0; i < NSEG; i++ ) { + pls->col0( 2 - i%2 ); + pls->arc( a*cos(theta/180.0*M_PI), a*sin(theta/180.0*M_PI), a, b, 0.0, 360.0, theta, 1); + theta = theta + dtheta; + } + +} + + int main( int argc, const char ** argv ) { x27 *x = new x27( argc, argv ); Modified: trunk/examples/f77/x27f.fm4 =================================================================== --- trunk/examples/f77/x27f.fm4 2011-08-04 08:23:43 UTC (rev 11850) +++ trunk/examples/f77/x27f.fm4 2011-08-04 08:58:52 UTC (rev 11851) @@ -102,6 +102,10 @@ call spiro( params(1,i), fill ) 130 continue +c Finally, an example to test out plarc capabilities + + call arcs() + call plend() end @@ -202,3 +206,41 @@ endif end + +c =============================================================== + + subroutine arcs() + + implicit none + include 'plplot_parameters.h' + integer NSEG + parameter ( NSEG = 8 ) + integer i; + real*8 theta, dtheta + real*8 a, b + + theta = 0.0d0 + dtheta = 360.0d0 / dble(NSEG) + call plenv( -10.0d0, 10.0d0, -10.0d0, 10.0d0, 1, 0 ) + +c Plot segments of circle in different colors + do i = 0, NSEG-1 + call plcol0( mod(i,2) + 1 ) + call plarc(0.0d0, 0.0d0, 8.0d0, 8.0d0, theta, theta + dtheta, + 1 0.0d0, 0) + theta = theta + dtheta + enddo + +c Draw several filled ellipses inside the circle at different +c angles. + a = 3.0d0 + b = a * tan( (dtheta/180.0d0*pi)/2.0d0 ) + theta = dtheta/2.0d0 + do i = 0, NSEG-1 + call plcol0( 2 - mod(i,2) ) + call plarc( a*cos(theta/180.0d0*pi), a*sin(theta/180.0d0*pi), + 1 a, b, 0.0d0, 360.0d0, theta, .true.) + theta = theta + dtheta; + enddo + + end Modified: trunk/examples/f95/x27f.f90 =================================================================== --- trunk/examples/f95/x27f.f90 2011-08-04 08:23:43 UTC (rev 11850) +++ trunk/examples/f95/x27f.f90 2011-08-04 08:58:52 UTC (rev 11851) @@ -101,6 +101,9 @@ call spiro( params(1,i), fill ) end do + ! Finally, an example to test out plarc capabilities + call arcs() + call plend() end program x27f @@ -205,3 +208,44 @@ endif end subroutine spiro + +! =============================================================== + +subroutine arcs( ) + + use plplot + implicit none + + integer NSEG + parameter ( NSEG = 8 ) + integer i; + real (kind=plflt) theta, dtheta + real (kind=plflt) a, b + + theta = 0.0_plflt + dtheta = 360.0_plflt / dble(NSEG) + call plenv( -10.0_plflt, 10.0_plflt, -10.0_plflt, 10.0_plflt, 1, 0 ) + + ! Plot segments of circle in different colors + do i = 0, NSEG-1 + call plcol0( mod(i,2) + 1 ) + call plarc(0.0_plflt, 0.0_plflt, 8.0_plflt, 8.0_plflt, theta, & + theta + dtheta, 0.0_plflt, 0) + theta = theta + dtheta + enddo + + ! Draw several filled ellipses inside the circle at different + ! angles. + a = 3.0_plflt + b = a * tan( (dtheta/180.0_plflt*PL_PI)/2.0_plflt ) + theta = dtheta/2.0_plflt + do i = 0, NSEG-1 + call plcol0( 2 - mod(i,2) ) + call plarc( a*cos(theta/180.0_plflt*PL_PI), & + a*sin(theta/180.0_plflt*PL_PI), & + a, b, 0.0_plflt, 360.0_plflt, theta, .true.) + theta = theta + dtheta; + enddo + +end subroutine arcs + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2011-08-04 09:07:51
|
Revision: 11853 http://plplot.svn.sourceforge.net/plplot/?rev=11853&view=rev Author: andrewross Date: 2011-08-04 09:07:44 +0000 (Thu, 04 Aug 2011) Log Message: ----------- Update java and D versions of example 27 to include new plarc demo. Modified Paths: -------------- trunk/examples/d/x27d.d trunk/examples/java/x27.java Modified: trunk/examples/d/x27d.d =================================================================== --- trunk/examples/d/x27d.d 2011-08-04 08:59:19 UTC (rev 11852) +++ trunk/examples/d/x27d.d 2011-08-04 09:07:44 UTC (rev 11853) @@ -101,6 +101,9 @@ spiro( params[i], fill ); } + // Finally, an example to test out plarc capabilities + arcs(); + plend(); return 0; } @@ -194,3 +197,33 @@ plline( xcoord, ycoord ); } } + +void arcs() { + const int NSEG = 8; + int i; + PLFLT theta, dtheta; + PLFLT a, b; + + theta = 0.0; + dtheta = 360.0 / NSEG; + plenv( -10.0, 10.0, -10.0, 10.0, 1, 0 ); + + // Plot segments of circle in different colors + for ( i = 0; i < NSEG; i++ ) { + plcol0( i%2 + 1 ); + plarc(0.0, 0.0, 8.0, 8.0, theta, theta + dtheta, 0.0, 0); + theta = theta + dtheta; + } + + // Draw several filled ellipses inside the circle at different + // angles. + a = 3.0; + b = a * tan( (dtheta/180.0*PI)/2.0 ); + theta = dtheta/2.0; + for ( i = 0; i < NSEG; i++ ) { + plcol0( 2 - i%2 ); + plarc( a*cos(theta/180.0*PI), a*sin(theta/180.0*PI), a, b, 0.0, 360.0, theta, 1); + theta = theta + dtheta; + } + +} Modified: trunk/examples/java/x27.java =================================================================== --- trunk/examples/java/x27.java 2011-08-04 08:59:19 UTC (rev 11852) +++ trunk/examples/java/x27.java 2011-08-04 09:07:44 UTC (rev 11853) @@ -112,7 +112,10 @@ pls.vpor( 0.0, 1.0, 0.0, 1.0 ); spiro( params[i], fill ); } - + + // Finally, an example to test out plarc capabilities + arcs(); + pls.end(); } @@ -212,6 +215,37 @@ else pls.line( xcoord, ycoord ); } + + void arcs() { + int NSEG = 8; + int i; + double theta, dtheta; + double a, b; + + theta = 0.0; + dtheta = 360.0 / NSEG; + pls.env( -10.0, 10.0, -10.0, 10.0, 1, 0 ); + + // Plot segments of circle in different colors + for ( i = 0; i < NSEG; i++ ) { + pls.col0( i%2 + 1 ); + pls.arc(0.0, 0.0, 8.0, 8.0, theta, theta + dtheta, 0.0, false); + theta = theta + dtheta; + } + + // Draw several filled ellipses inside the circle at different + // angles. + a = 3.0; + b = a * Math.tan( (dtheta/180.0*Math.PI)/2.0 ); + theta = dtheta/2.0; + for ( i = 0; i < NSEG; i++ ) { + pls.col0( 2 - i%2 ); + pls.arc( a*Math.cos(theta/180.0*Math.PI), a*Math.sin(theta/180.0*Math.PI), a, b, 0.0, 360.0, theta, true); + theta = theta + dtheta; + } + + } + } //-------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2011-08-05 08:38:45
|
Revision: 11859 http://plplot.svn.sourceforge.net/plplot/?rev=11859&view=rev Author: andrewross Date: 2011-08-05 08:38:34 +0000 (Fri, 05 Aug 2011) Log Message: ----------- Update tcl and python versions of example 27 to include plarc demo. Modified Paths: -------------- trunk/examples/python/xw27.py trunk/examples/tcl/x27.tcl Modified: trunk/examples/python/xw27.py =================================================================== --- trunk/examples/python/xw27.py 2011-08-05 07:45:34 UTC (rev 11858) +++ trunk/examples/python/xw27.py 2011-08-05 08:38:34 UTC (rev 11859) @@ -79,6 +79,8 @@ plvpor( 0.0, 1.0, 0.0, 1.0 ) spiro( params[i], 1 ) + arcs() + def gcd(a, b): if not (type(a) is types.IntType and type(b) is types.IntType): raise RuntimeError, "gcd arguments must be integers" @@ -125,4 +127,30 @@ else: plline( xcoord, ycoord ) +def arcs() : + NSEG = 8 + + theta = 0.0 + dtheta = 360.0 / NSEG + plenv( -10.0, 10.0, -10.0, 10.0, 1, 0 ) + + # Plot segments of circle in different colors + for i in range (NSEG) : + plcol0( i%2 + 1 ) + plarc(0.0, 0.0, 8.0, 8.0, theta, theta + dtheta, 0.0, 0) + theta = theta + dtheta + + + # Draw several filled ellipses inside the circle at different + # angles. + a = 3.0 + b = a * tan( (dtheta/180.0*pi)/2.0 ) + theta = dtheta/2.0 + for i in range(NSEG): + plcol0( 2 - i%2 ) + plarc( a*cos(theta/180.0*pi), a*sin(theta/180.0*pi), a, b, 0.0, 360.0, theta, 1) + theta = theta + dtheta + + + main() Modified: trunk/examples/tcl/x27.tcl =================================================================== --- trunk/examples/tcl/x27.tcl 2011-08-05 07:45:34 UTC (rev 11858) +++ trunk/examples/tcl/x27.tcl 2011-08-05 08:38:34 UTC (rev 11859) @@ -81,6 +81,8 @@ $w cmd plvpor 0.0 1.0 0.0 1.0 spiro $w [lindex $params $i] $fill } + + arcs $w } #-------------------------------------------------------------------------- @@ -165,3 +167,31 @@ $w cmd plline $n xcoord ycoord } } + +proc arcs {w} { + set NSEG 8 + set pi $::PLPLOT::PL_PI + + set theta 0.0 + set dtheta [expr {360.0 / $NSEG}] + $w cmd plenv -10.0 10.0 -10.0 10.0 1 0 + + # Plot segments of circle in different colors + for { set i 0 } { $i < $NSEG } {incr i} { + $w cmd plcol0 [expr {$i%2 + 1}] + $w cmd plarc 0.0 0.0 8.0 8.0 $theta [expr {$theta + $dtheta}] 0.0 0 + set theta [expr {$theta + $dtheta}] + } + + # Draw several filled ellipses inside the circle at different + # angles. + set a 3.0 + set b [expr {$a * tan( ($dtheta/180.0*$pi)/2.0 )}] + set theta [expr {$dtheta/2.0}] + for {set i 0} { $i < $NSEG } { incr i } { + $w cmd plcol0 [expr {2 - $i%2}] + $w cmd plarc [expr {$a*cos($theta/180.0*$pi)}] [expr {$a*sin($theta/180.0*$pi)}] $a $b 0.0 360.0 $theta 1 + set theta [expr {$theta + $dtheta}] + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-10-14 05:14:32
|
Revision: 11962 http://plplot.svn.sourceforge.net/plplot/?rev=11962&view=rev Author: airwin Date: 2011-10-14 04:15:41 +0000 (Fri, 14 Oct 2011) Log Message: ----------- Make plplot_functions module available to the CMake-based build system for the installed examples. This allows proper handling of OUTPUT attributes of custom commands for that build system. Modified Paths: -------------- trunk/examples/CMakeLists.txt trunk/examples/plplot_configure.cmake_installed_examples.in Modified: trunk/examples/CMakeLists.txt =================================================================== --- trunk/examples/CMakeLists.txt 2011-10-14 04:10:36 UTC (rev 11961) +++ trunk/examples/CMakeLists.txt 2011-10-14 04:15:41 UTC (rev 11962) @@ -277,6 +277,12 @@ RENAME plplot_configure.cmake ) + # function support for CMake-based build system for installed examples. + install(FILES + ${CMAKE_SOURCE_DIR}/cmake/modules/plplot_functions.cmake + DESTINATION ${DATA_DIR}/examples/cmake/modules + ) + # pkg-config support for CMake-based build system for installed examples. install(FILES ${CMAKE_SOURCE_DIR}/cmake/modules/pkg-config.cmake Modified: trunk/examples/plplot_configure.cmake_installed_examples.in =================================================================== --- trunk/examples/plplot_configure.cmake_installed_examples.in 2011-10-14 04:10:36 UTC (rev 11961) +++ trunk/examples/plplot_configure.cmake_installed_examples.in 2011-10-14 04:15:41 UTC (rev 11962) @@ -6,6 +6,11 @@ set(CORE_BUILD OFF) # ======================================================================= +# Useful functions. +# ======================================================================= +include(plplot_functions) + +# ======================================================================= # pkg-config support as well as macros to put link flags in standard # *.pc (pkg-config) form as well as standard fullpath form used by cmake. # PKG_CONFIG_EXECUTABLE can be used to discover whether pkg-config was This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2011-10-14 07:12:23
|
Revision: 11968 http://plplot.svn.sourceforge.net/plplot/?rev=11968&view=rev Author: andrewross Date: 2011-10-14 07:12:16 +0000 (Fri, 14 Oct 2011) Log Message: ----------- Fix a number of compiler warnings for the C / C++ examples. Modified Paths: -------------- trunk/examples/c/extXdrawable_demo.c trunk/examples/c/x02c.c trunk/examples/c/x08c.c trunk/examples/c/x09c.c trunk/examples/c/x11c.c trunk/examples/c/x13c.c trunk/examples/c/x14c.c trunk/examples/c/x15c.c trunk/examples/c/x16c.c trunk/examples/c/x19c.c trunk/examples/c/x20c.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/x33c.c trunk/examples/c/x34c.c trunk/examples/c++/x09.cc trunk/examples/c++/x19.cc trunk/examples/c++/x27.cc trunk/examples/c++/x29.cc Modified: trunk/examples/c/extXdrawable_demo.c =================================================================== --- trunk/examples/c/extXdrawable_demo.c 2011-10-14 07:11:18 UTC (rev 11967) +++ trunk/examples/c/extXdrawable_demo.c 2011-10-14 07:12:16 UTC (rev 11968) @@ -50,9 +50,13 @@ App app; +void setup_plot_drawable( App *a ); +static gint ev_plotwindow_conf( GtkWidget *widget, GdkEventConfigure *ev, gpointer *data ); +void init_app( App *a ); + //-------------------------------------------------------------------------- -void setup_plot_drawable( App *app ) +void setup_plot_drawable( App *a ) { struct { @@ -69,12 +73,12 @@ #if TO_PIXMAP == 1 // Here we set up to draw to a pixmap - xinfo.display = GDK_PIXMAP_XDISPLAY( app->plotwindow_pixmap ); - xinfo.drawable = GDK_PIXMAP_XID( app->plotwindow_pixmap ); + xinfo.display = GDK_PIXMAP_XDISPLAY( a->plotwindow_pixmap ); + xinfo.drawable = GDK_PIXMAP_XID( a->plotwindow_pixmap ); #else // Alternatively, we can do direct to a visible X Window - xinfo.display = GDK_WINDOW_XDISPLAY( app->plotwindow->window ); - xinfo.drawable = GDK_WINDOW_XID( app->plotwindow->window ); + xinfo.display = GDK_WINDOW_XDISPLAY( a->plotwindow->window ); + xinfo.drawable = GDK_WINDOW_XID( a->plotwindow->window ); #endif pl_cmd( PLESC_DEVINIT, &xinfo ); @@ -131,7 +135,7 @@ //-------------------------------------------------------------------------- -void init_app( App *app ) +void init_app( App *a ) { GtkWidget *menubar; GtkItemFactory *item_factory; @@ -141,18 +145,18 @@ GtkWidget *vbox, *hbox; // Create the top-level root window - app->rootwindow = gtk_window_new( GTK_WINDOW_TOPLEVEL ); - gtk_signal_connect( GTK_OBJECT( app->rootwindow ), "delete_event", gtk_main_quit, + a->rootwindow = gtk_window_new( GTK_WINDOW_TOPLEVEL ); + gtk_signal_connect( GTK_OBJECT( a->rootwindow ), "delete_event", gtk_main_quit, NULL ); // A toplevel box to hold things vbox = gtk_vbox_new( FALSE, 0 ); - gtk_container_add( GTK_CONTAINER( app->rootwindow ), vbox ); + gtk_container_add( GTK_CONTAINER( a->rootwindow ), vbox ); // Construct the main menu structure item_factory = gtk_item_factory_new( GTK_TYPE_MENU_BAR, "<main>", accel_group ); gtk_item_factory_create_items( item_factory, nitems, menu_items, NULL ); - gtk_window_add_accel_group( GTK_WINDOW( app->rootwindow ), accel_group ); + gtk_window_add_accel_group( GTK_WINDOW( a->rootwindow ), accel_group ); menubar = gtk_item_factory_get_widget( item_factory, "<main>" ); gtk_box_pack_start( GTK_BOX( vbox ), menubar, FALSE, FALSE, 0 ); gtk_widget_show( menubar ); @@ -164,32 +168,32 @@ gtk_box_pack_start( GTK_BOX( hbox ), vbox, TRUE, TRUE, 10 ); // Add an area to plot into - app->plotwindow = gtk_drawing_area_new(); - app->plotwindow_pixmap = NULL; + a->plotwindow = gtk_drawing_area_new(); + a->plotwindow_pixmap = NULL; #if TO_PIXMAP != 1 // Turn off double buffering if we are plotting direct to the plotwindow // in setup_plot_drawable(). // - GTK_WIDGET_UNSET_FLAGS( app->plotwindow, GTK_DOUBLE_BUFFERED ); + GTK_WIDGET_UNSET_FLAGS( a->plotwindow, GTK_DOUBLE_BUFFERED ); #endif // By experiment, 3x3 seems to be the smallest size plplot can cope with. // Here we utilise the side effect that gtk_widget_set_size_request() // effectively sets the minimum size of the widget. // - gtk_widget_set_size_request( app->plotwindow, 3, 3 ); - gtk_box_pack_start( GTK_BOX( vbox ), app->plotwindow, TRUE, TRUE, 0 ); + gtk_widget_set_size_request( a->plotwindow, 3, 3 ); + gtk_box_pack_start( GTK_BOX( vbox ), a->plotwindow, TRUE, TRUE, 0 ); // Set the initial size of the application - gtk_window_set_default_size( GTK_WINDOW( app->rootwindow ), APP_INITIAL_WIDTH, APP_INITIAL_HEIGHT ); + gtk_window_set_default_size( GTK_WINDOW( a->rootwindow ), APP_INITIAL_WIDTH, APP_INITIAL_HEIGHT ); - g_signal_connect( G_OBJECT( app->plotwindow ), "configure_event", + g_signal_connect( G_OBJECT( a->plotwindow ), "configure_event", G_CALLBACK( ev_plotwindow_conf ), NULL ); - g_signal_connect( G_OBJECT( app->plotwindow ), "expose_event", + g_signal_connect( G_OBJECT( a->plotwindow ), "expose_event", G_CALLBACK( ev_plotwindow_expose ), NULL ); - gtk_widget_show_all( app->rootwindow ); + gtk_widget_show_all( a->rootwindow ); } //-------------------------------------------------------------------------- Modified: trunk/examples/c/x02c.c =================================================================== --- trunk/examples/c/x02c.c 2011-10-14 07:11:18 UTC (rev 11967) +++ trunk/examples/c/x02c.c 2011-10-14 07:12:16 UTC (rev 11968) @@ -12,8 +12,8 @@ // user-modified. //-------------------------------------------------------------------------- -void demo1(); -void demo2(); +void demo1( void ); +void demo2( void ); void draw_windows( int nw, int cmap0_offset ); int @@ -39,7 +39,7 @@ // Demonstrates multiple windows and default color map 0 palette. //-------------------------------------------------------------------------- -void demo1() +void demo1( void ) { plbop(); @@ -58,7 +58,7 @@ // HLS -> RGB translation. //-------------------------------------------------------------------------- -void demo2() +void demo2( void ) { // Set up cmap0 // Use 100 custom colors in addition to base 16 Modified: trunk/examples/c/x08c.c =================================================================== --- trunk/examples/c/x08c.c 2011-10-14 07:11:18 UTC (rev 11967) +++ trunk/examples/c/x08c.c 2011-10-14 07:12:16 UTC (rev 11968) @@ -37,7 +37,7 @@ static PLFLT az[] = { 30.0, 60.0 }; static void cmap1_init( int ); -static char *title[] = +static const char *title[] = { "#frPLplot Example 8 - Alt=60, Az=30", "#frPLplot Example 8 - Alt=20, Az=60", Modified: trunk/examples/c/x09c.c =================================================================== --- trunk/examples/c/x09c.c 2011-10-14 07:11:18 UTC (rev 11967) +++ trunk/examples/c/x09c.c 2011-10-14 07:12:16 UTC (rev 11968) @@ -54,7 +54,7 @@ *ty = tr[3] * x + tr[4] * y + tr[5]; } -static void polar() +static void polar( void ) //polar contour plot example. { int i, j; @@ -117,24 +117,24 @@ //-------------------------------------------------------------------------- static void -f2mnmx( PLFLT **f, PLINT nx, PLINT ny, PLFLT *fmin, PLFLT *fmax ) +f2mnmx( PLFLT **f, PLINT nx, PLINT ny, PLFLT *fnmin, PLFLT *fnmax ) { int i, j; - *fmax = f[0][0]; - *fmin = *fmax; + *fnmax = f[0][0]; + *fnmin = *fnmax; for ( i = 0; i < nx; i++ ) { for ( j = 0; j < ny; j++ ) { - *fmax = MAX( *fmax, f[i][j] ); - *fmin = MIN( *fmin, f[i][j] ); + *fnmax = MAX( *fnmax, f[i][j] ); + *fnmin = MIN( *fnmin, f[i][j] ); } } } -static void potential() +static void potential( void ) //shielded potential contour plot example. { int i, j; @@ -145,7 +145,7 @@ PLFLT div1, div1i, div2, div2i; PLFLT **z; PLINT nlevelneg, nlevelpos; - PLFLT dz, clevel, clevelneg[PNLEVEL], clevelpos[PNLEVEL]; + PLFLT dz, clevel2, clevelneg[PNLEVEL], clevelpos[PNLEVEL]; PLINT ncollin, ncolbox, ncollab; PLFLT px[PPERIMETERPTS], py[PPERIMETERPTS]; PLFLT t, r, theta; @@ -224,11 +224,11 @@ nlevelpos = 0; for ( i = 0; i < PNLEVEL; i++ ) { - clevel = zmin + ( (double) i + 0.5 ) * dz; - if ( clevel <= 0. ) - clevelneg[nlevelneg++] = clevel; + clevel2 = zmin + ( (double) i + 0.5 ) * dz; + if ( clevel2 <= 0. ) + clevelneg[nlevelneg++] = clevel2; else - clevelpos[nlevelpos++] = clevel; + clevelpos[nlevelpos++] = clevel2; } // Colours! ncollin = 11; Modified: trunk/examples/c/x11c.c =================================================================== --- trunk/examples/c/x11c.c 2011-10-14 07:11:18 UTC (rev 11967) +++ trunk/examples/c/x11c.c 2011-10-14 07:12:16 UTC (rev 11968) @@ -32,14 +32,14 @@ static PLFLT alt[] = { 33.0, 17.0 }; static PLFLT az[] = { 24.0, 115.0 }; -static char *title[4] = +static const char *title[4] = { "#frPLplot Example 11 - Alt=33, Az=24, Opt=3", "#frPLplot Example 11 - Alt=17, Az=115, Opt=3", }; static void -cmap1_init() +cmap1_init( void ) { PLFLT i[2], h[2], l[2], s[2]; Modified: trunk/examples/c/x13c.c =================================================================== --- trunk/examples/c/x13c.c 2011-10-14 07:11:18 UTC (rev 11967) +++ trunk/examples/c/x13c.c 2011-10-14 07:12:16 UTC (rev 11968) @@ -5,7 +5,7 @@ #include "plcdemos.h" -static char *text[] = +static const char *text[] = { "Maurice", "Geoffrey", Modified: trunk/examples/c/x14c.c =================================================================== --- trunk/examples/c/x14c.c 2011-10-14 07:11:18 UTC (rev 11967) +++ trunk/examples/c/x14c.c 2011-10-14 07:12:16 UTC (rev 11968) @@ -31,11 +31,12 @@ static PLFLT xscale, yscale, xoff, yoff, xs[6], ys[6]; static PLINT space0 = 0, mark0 = 0, space1 = 1500, mark1 = 1500; -void plot1(); -void plot2(); -void plot3(); -void plot4(); -void plot5(); +void plot1( void ); +void plot2( void ); +void plot3( void ); +void plot4( void ); +void plot5( void ); +void mypltr( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data ); //-------------------------------------------------------------------------- // main @@ -308,7 +309,7 @@ PLFLT dtr, theta, dx, dy, r; char text[4]; PLFLT x0[361], y0[361]; - PLFLT x[361], y[361]; + PLFLT x1[361], y1[361]; dtr = M_PI / 180.0; for ( i = 0; i <= 360; i++ ) @@ -324,13 +325,13 @@ { for ( j = 0; j <= 360; j++ ) { - x[j] = 0.1 * i * x0[j]; - y[j] = 0.1 * i * y0[j]; + x1[j] = 0.1 * i * x0[j]; + y1[j] = 0.1 * i * y0[j]; } // Draw circles for polar grid - plline( 361, x, y ); + plline( 361, x1, y1 ); } plcol0( 2 ); @@ -359,11 +360,11 @@ for ( i = 0; i <= 360; i++ ) { r = sin( dtr * ( 5 * i ) ); - x[i] = x0[i] * r; - y[i] = y0[i] * r; + x1[i] = x0[i] * r; + y1[i] = y0[i] * r; } plcol0( 3 ); - plline( 361, x, y ); + plline( 361, x1, y1 ); plcol0( 4 ); plmtex( "t", 2.0, 0.5, 0.5, @@ -384,10 +385,10 @@ { XSPA, 0.0, -1.0, 0.0, YSPA, -1.0 }; void -mypltr( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data ) +mypltr( PLFLT xx, PLFLT yy, PLFLT *tx, PLFLT *ty, void *pltr_data ) { - *tx = tr[0] * x + tr[1] * y + tr[2]; - *ty = tr[3] * x + tr[4] * y + tr[5]; + *tx = tr[0] * xx + tr[1] * yy + tr[2]; + *ty = tr[3] * xx + tr[4] * yy + tr[5]; } static PLFLT clevel[11] = Modified: trunk/examples/c/x15c.c =================================================================== --- trunk/examples/c/x15c.c 2011-10-14 07:11:18 UTC (rev 11967) +++ trunk/examples/c/x15c.c 2011-10-14 07:12:16 UTC (rev 11968) @@ -295,19 +295,19 @@ #define F( a, b ) ( f[a * ny + b] ) static void -f2mnmx( PLFLT *f, PLINT nx, PLINT ny, PLFLT *fmin, PLFLT *fmax ) +f2mnmx( PLFLT *f, PLINT nx, PLINT ny, PLFLT *fnmin, PLFLT *fnmax ) { int i, j; - *fmax = F( 0, 0 ); - *fmin = *fmax; + *fnmax = F( 0, 0 ); + *fnmin = *fnmax; for ( i = 0; i < nx; i++ ) { for ( j = 0; j < ny; j++ ) { - *fmax = MAX( *fmax, F( i, j ) ); - *fmin = MIN( *fmin, F( i, j ) ); + *fnmax = MAX( *fnmax, F( i, j ) ); + *fnmin = MIN( *fnmin, F( i, j ) ); } } } Modified: trunk/examples/c/x16c.c =================================================================== --- trunk/examples/c/x16c.c 2011-10-14 07:11:18 UTC (rev 11967) +++ trunk/examples/c/x16c.c 2011-10-14 07:12:16 UTC (rev 11968) @@ -41,6 +41,8 @@ static void f2mnmx( PLFLT **f, PLINT nx, PLINT ny, PLFLT *fmin, PLFLT *fmax ); +PLINT zdefined( PLFLT x, PLFLT y ); + // Options data structure definition. static PLOptionTable options[] = { @@ -163,10 +165,10 @@ // Allocate data structures - clevel = (PLFLT *) calloc( ns, sizeof ( PLFLT ) ); - shedge = (PLFLT *) calloc( ns + 1, sizeof ( PLFLT ) ); - xg1 = (PLFLT *) calloc( nx, sizeof ( PLFLT ) ); - yg1 = (PLFLT *) calloc( ny, sizeof ( PLFLT ) ); + clevel = (PLFLT *) calloc( (size_t) ns, sizeof ( PLFLT ) ); + shedge = (PLFLT *) calloc( (size_t) (ns + 1), sizeof ( PLFLT ) ); + xg1 = (PLFLT *) calloc( (size_t) nx, sizeof ( PLFLT ) ); + yg1 = (PLFLT *) calloc( (size_t) ny, sizeof ( PLFLT ) ); plAlloc2dGrid( &z, nx, ny ); plAlloc2dGrid( &w, nx, ny ); @@ -530,19 +532,19 @@ //-------------------------------------------------------------------------- static void -f2mnmx( PLFLT **f, PLINT nx, PLINT ny, PLFLT *fmin, PLFLT *fmax ) +f2mnmx( PLFLT **f, PLINT nnx, PLINT nny, PLFLT *fnmin, PLFLT *fnmax ) { int i, j; - *fmax = f[0][0]; - *fmin = *fmax; + *fnmax = f[0][0]; + *fnmin = *fnmax; - for ( i = 0; i < nx; i++ ) + for ( i = 0; i < nnx; i++ ) { - for ( j = 0; j < ny; j++ ) + for ( j = 0; j < nny; j++ ) { - *fmax = MAX( *fmax, f[i][j] ); - *fmin = MIN( *fmin, f[i][j] ); + *fnmax = MAX( *fnmax, f[i][j] ); + *fnmin = MIN( *fnmin, f[i][j] ); } } } Modified: trunk/examples/c/x19c.c =================================================================== --- trunk/examples/c/x19c.c 2011-10-14 07:11:18 UTC (rev 11967) +++ trunk/examples/c/x19c.c 2011-10-14 07:12:16 UTC (rev 11968) @@ -6,6 +6,11 @@ #include "plcdemos.h" +void map_transform( PLFLT x, PLFLT y, PLFLT *xt, PLFLT *yt, PLPointer data ); +void mapform19( PLINT n, PLFLT *x, PLFLT *y ); +PLFLT normalize_longitude( PLFLT lon ); +void geolocation_labeler( PLINT axis, PLFLT value, char *label, PLINT length, PLPointer data ); + void map_transform( PLFLT x, PLFLT y, PLFLT *xt, PLFLT *yt, PLPointer data ) { @@ -39,7 +44,8 @@ // "Normalize" longitude values so that they always fall between -180.0 and // 180.0 -PLFLT normalize_longitude( PLFLT lon ) +PLFLT +normalize_longitude( PLFLT lon ) { PLFLT times; if ( lon >= -180.0 && lon <= 180.0 ) Modified: trunk/examples/c/x20c.c =================================================================== --- trunk/examples/c/x20c.c 2011-10-14 07:11:18 UTC (rev 11967) +++ trunk/examples/c/x20c.c 2011-10-14 07:12:16 UTC (rev 11968) @@ -13,7 +13,7 @@ void save_plot( char * ); void gray_cmap( PLINT ); -int read_img( char *, PLFLT ***, int *, int *, int * ); +int read_img( const char *, PLFLT ***, int *, int *, int * ); int get_clip( PLFLT *, PLFLT *, PLFLT *, PLFLT * ); int dbg = 0; @@ -303,7 +303,7 @@ } // read image from file in binary ppm format -int read_img( char *fname, PLFLT ***img_f, int *width, int *height, int *num_col ) +int read_img( const char *fname, PLFLT ***img_f, int *width, int *height, int *num_col ) { FILE *fp; unsigned char *img; Modified: trunk/examples/c/x21c.c =================================================================== --- trunk/examples/c/x21c.c 2011-10-14 07:11:18 UTC (rev 11967) +++ trunk/examples/c/x21c.c 2011-10-14 07:12:16 UTC (rev 11968) @@ -121,13 +121,13 @@ } // long syntax }; -void create_data( PLFLT **xi, PLFLT **yi, PLFLT **zi, int pts ); +void create_data( PLFLT **xi, PLFLT **yi, PLFLT **zi, int npts ); void free_data( PLFLT *x, PLFLT *y, PLFLT *z ); void create_grid( PLFLT **xi, int px, PLFLT **yi, int py ); void free_grid( PLFLT *x, PLFLT *y ); static void -cmap1_init() +cmap1_init( void ) { PLFLT i[2], h[2], l[2], s[2]; @@ -157,7 +157,7 @@ PLFLT zmin, zmax, lzm, lzM; int i, j, k; PLINT alg; - char *title[] = { "Cubic Spline Approximation", + const char *title[] = { "Cubic Spline Approximation", "Delaunay Linear Interpolation", "Natural Neighbors Interpolation", "KNN Inv. Distance Weighted", @@ -196,7 +196,7 @@ create_grid( &xg, xp, &yg, yp ); // grid the data at plAlloc2dGrid( &zg, xp, yp ); // the output grided data - clev = (PLFLT *) malloc( nl * sizeof ( PLFLT ) ); + clev = (PLFLT *) malloc( (size_t) nl * sizeof ( PLFLT ) ); // printf("Npts=%d gridx=%d gridy=%d", pts, xp, yp); plcol0( 1 ); @@ -330,8 +330,8 @@ PLFLT *x, *y; int i; - x = *xi = (PLFLT *) malloc( px * sizeof ( PLFLT ) ); - y = *yi = (PLFLT *) malloc( py * sizeof ( PLFLT ) ); + x = *xi = (PLFLT *) malloc( (size_t) px * sizeof ( PLFLT ) ); + y = *yi = (PLFLT *) malloc( (size_t) py * sizeof ( PLFLT ) ); for ( i = 0; i < px; i++ ) *x++ = xm + ( xM - xm ) * i / ( px - 1. ); @@ -348,17 +348,17 @@ } void -create_data( PLFLT **xi, PLFLT **yi, PLFLT **zi, int pts ) +create_data( PLFLT **xi, PLFLT **yi, PLFLT **zi, int npts ) { int i; PLFLT *x, *y, *z, r; PLFLT xt, yt; - *xi = x = (PLFLT *) malloc( pts * sizeof ( PLFLT ) ); - *yi = y = (PLFLT *) malloc( pts * sizeof ( PLFLT ) ); - *zi = z = (PLFLT *) malloc( pts * sizeof ( PLFLT ) ); + *xi = x = (PLFLT *) malloc( (size_t) npts * sizeof ( PLFLT ) ); + *yi = y = (PLFLT *) malloc( (size_t) npts * sizeof ( PLFLT ) ); + *zi = z = (PLFLT *) malloc( (size_t) npts * sizeof ( PLFLT ) ); - for ( i = 0; i < pts; i++ ) + for ( i = 0; i < npts; i++ ) { xt = ( xM - xm ) * plrandd(); yt = ( yM - ym ) * plrandd(); Modified: trunk/examples/c/x22c.c =================================================================== --- trunk/examples/c/x22c.c 2011-10-14 07:11:18 UTC (rev 11967) +++ trunk/examples/c/x22c.c 2011-10-14 07:12:16 UTC (rev 11968) @@ -25,6 +25,11 @@ #include "plcdemos.h" +void circulation( void ); +void constriction( void ); +void potential( void ); +void f2mnmx( PLFLT **f, PLINT nx, PLINT ny, PLFLT *fnmin, PLFLT *fnmax ); + // Pairs of points making the line segments used to plot the user defined arrow static PLFLT arrow_x[6] = { -0.5, 0.5, 0.3, 0.5, 0.3, 0.5 }; static PLFLT arrow_y[6] = { 0.0, 0.0, 0.2, 0.0, -0.2, 0.0 }; @@ -41,7 +46,7 @@ // Vector plot of the circulation about the origin // void -circulation() +circulation( void ) { int i, j; PLFLT dx, dy, x, y; @@ -98,7 +103,7 @@ // Vector plot of flow through a constricted pipe // void -constriction() +constriction( void ) { int i, j; PLFLT dx, dy, x, y; @@ -164,19 +169,20 @@ -void f2mnmx( PLFLT **f, PLINT nx, PLINT ny, PLFLT *fmin, PLFLT *fmax ) +void +f2mnmx( PLFLT **f, PLINT nx, PLINT ny, PLFLT *fnmin, PLFLT *fnmax ) { int i, j; - *fmax = f[0][0]; - *fmin = *fmax; + *fnmax = f[0][0]; + *fnmin = *fnmax; for ( i = 0; i < nx; i++ ) { for ( j = 0; j < ny; j++ ) { - *fmax = MAX( *fmax, f[i][j] ); - *fmin = MIN( *fmin, f[i][j] ); + *fnmax = MAX( *fnmax, f[i][j] ); + *fnmin = MIN( *fnmin, f[i][j] ); } } } @@ -184,7 +190,8 @@ // // Vector plot of the gradient of a shielded potential (see example 9) // -void potential() +void +potential( void ) { #if !defined ( WIN32 ) const int nper = 100; Modified: trunk/examples/c/x23c.c =================================================================== --- trunk/examples/c/x23c.c 2011-10-14 07:11:18 UTC (rev 11967) +++ trunk/examples/c/x23c.c 2011-10-14 07:12:16 UTC (rev 11968) @@ -31,7 +31,7 @@ // Displays Greek letters and mathematically interesting Unicode ranges // -static char* Greek[] = { +static const char* Greek[] = { "#gA", "#gB", "#gG", "#gD", "#gE", "#gZ", "#gY", "#gH", "#gI", "#gK", "#gL", "#gM", "#gN", "#gC", "#gO", "#gP", "#gR", "#gS", "#gT", "#gU", "#gF", "#gX", "#gQ", "#gW", "#ga", "#gb", "#gg", "#gd", "#ge", "#gz", "#gy", "#gh", "#gi", "#gk", "#gl", "#gm", @@ -75,7 +75,7 @@ 0x2666, }; -static char* title[] = { +static const char* title[] = { "#<0x10>PLplot Example 23 - Greek Letters", "#<0x10>PLplot Example 23 - Type 1 Symbol Font Glyphs by Unicode (a)", "#<0x10>PLplot Example 23 - Type 1 Symbol Font Glyphs by Unicode (b)", Modified: trunk/examples/c/x24c.c =================================================================== --- trunk/examples/c/x24c.c 2011-10-14 07:11:18 UTC (rev 11967) +++ trunk/examples/c/x24c.c 2011-10-14 07:12:16 UTC (rev 11968) @@ -76,7 +76,7 @@ // Taken from http://www.columbia.edu/~fdc/pace/ -static char* peace[] = { +static const char* peace[] = { // Mandarin "#<0x00>和平", // Hindi Modified: trunk/examples/c/x26c.c =================================================================== --- trunk/examples/c/x26c.c 2011-10-14 07:11:18 UTC (rev 11967) +++ trunk/examples/c/x26c.c 2011-10-14 07:12:16 UTC (rev 11968) @@ -64,44 +64,45 @@ #include "plcdemos.h" -static char *x_label[] = { +static const char *x_labels[] = { "Frequency", "Частота", NULL }; -static char *y_label[] = { +static const char *y_labels[] = { "Amplitude (dB)", "Амплитуда (dB)", NULL }; -static char *alty_label[] = { +static const char *alty_labels[] = { "Phase shift (degrees)", "Фазовый сдвиг (градусы)", NULL }; // Short rearranged versions of y_label and alty_label. -static char *legend_text[][2] = { +static const char *legend_texts[][2] = { { "Amplitude", "Phase shift" }, { "Амплитуда", "Фазовый сдвиг" } }; -static char *title_label[] = { +static const char *title_labels[] = { "Single Pole Low-Pass Filter", "Однополюсный Низко-Частотный Фильтр", NULL }; -static char *line_label[] = { +static const char *line_labels[] = { "-20 dB/decade", "-20 dB/десяток", NULL }; -void plot1( int type, char *x_label, char *y_label, char *alty_label, - char * legend_text[], char *title_label, char *line_label ); +void plot1( int type, const char *x_label, const char *y_label, + const char *alty_label, const char * legend_text[], + const char *title_label, const char *line_label ); //-------------------------------------------------------------------------- // main @@ -125,10 +126,10 @@ // Make log plots using two different styles. i = 0; - while ( x_label[i] != NULL ) + while ( x_labels[i] != NULL ) { - plot1( 0, x_label[i], y_label[i], alty_label[i], - legend_text[i], title_label[i], line_label[i] ); + plot1( 0, x_labels[i], y_labels[i], alty_labels[i], + legend_texts[i], title_labels[i], line_labels[i] ); i++; } @@ -143,8 +144,8 @@ //-------------------------------------------------------------------------- void -plot1( int type, char *x_label, char *y_label, char *alty_label, - char * legend_text[], char *title_label, char *line_label ) +plot1( int type, const char *x_label, const char *y_label, const char *alty_label, + const char * legend_text[], const char *title_label, const char *line_label ) { int i; static PLFLT freql[101], ampl[101], phase[101]; @@ -157,7 +158,7 @@ PLINT line_widths[2]; PLINT symbol_numbers[2], symbol_colors[2]; PLFLT symbol_scales[2]; - char *symbols[2]; + const char *symbols[2]; PLFLT legend_width, legend_height; Modified: trunk/examples/c/x27c.c =================================================================== --- trunk/examples/c/x27c.c 2011-10-14 07:11:18 UTC (rev 11967) +++ trunk/examples/c/x27c.c 2011-10-14 07:12:16 UTC (rev 11968) @@ -48,15 +48,15 @@ // N.B. N is just a place holder since it is no longer used // (because we now have proper termination of the angle loop). PLFLT params[9][4] = { - 21.0, 7.0, 7.0, 3.0, // Deltoid - 21.0, 7.0, 10.0, 3.0, - 21.0, -7.0, 10.0, 3.0, - 20.0, 3.0, 7.0, 20.0, - 20.0, 3.0, 10.0, 20.0, - 20.0, -3.0, 10.0, 20.0, - 20.0, 13.0, 7.0, 20.0, - 20.0, 13.0, 20.0, 20.0, - 20.0, -13.0, 20.0, 20.0 + { 21.0, 7.0, 7.0, 3.0} , // Deltoid + { 21.0, 7.0, 10.0, 3.0} , + { 21.0, -7.0, 10.0, 3.0} , + { 20.0, 3.0, 7.0, 20.0} , + { 20.0, 3.0, 10.0, 20.0} , + { 20.0, -3.0, 10.0, 20.0} , + { 20.0, 13.0, 7.0, 20.0} , + { 20.0, 13.0, 20.0, 20.0} , + { 20.0, -13.0, 20.0, 20.0} }; int i; @@ -175,7 +175,7 @@ // Proper termination of the angle loop very near the beginning // point, see // http://mathforum.org/mathimages/index.php/Hypotrochoid. - windings = (PLINT) abs( params[1] ) / gcd( (PLINT) params[0], (PLINT) params[1] ); + windings = (PLINT) (abs( params[1] ) / gcd( (PLINT) params[0], (PLINT) params[1] )); steps = NPNT / windings; dphi = 2.0 * PI / (PLFLT) steps; Modified: trunk/examples/c/x28c.c =================================================================== --- trunk/examples/c/x28c.c 2011-10-14 07:11:18 UTC (rev 11967) +++ trunk/examples/c/x28c.c 2011-10-14 07:12:16 UTC (rev 11968) @@ -61,8 +61,8 @@ PLFLT radius, pitch, xpos, ypos, zpos; // p1string must be exactly one character + the null termination // character. - char p1string[] = "O", - *pstring = "The future of our civilization depends on software freedom."; + char p1string[] = "O"; + const char *pstring = "The future of our civilization depends on software freedom."; // Allocate and define the minimal x, y, and z to insure 3D box x = (PLFLT *) calloc( XPTS, sizeof ( PLFLT ) ); y = (PLFLT *) calloc( YPTS, sizeof ( PLFLT ) ); @@ -339,7 +339,7 @@ // domega controls the spacing between the various characters of the // string and also the maximum value of omega for the given number // of characters in *pstring. - domega = 2. * M_PI / strlen( pstring ); + domega = 2. * M_PI / (double) strlen( pstring ); omega = 0.; // 3D function is a helix of the given radius and pitch radius = 0.5; Modified: trunk/examples/c/x29c.c =================================================================== --- trunk/examples/c/x29c.c 2011-10-14 07:11:18 UTC (rev 11967) +++ trunk/examples/c/x29c.c 2011-10-14 07:12:16 UTC (rev 11968) @@ -29,10 +29,10 @@ // Function prototypes -void plot1(); -void plot2(); -void plot3(); -void plot4(); +void plot1( void ); +void plot2( void ); +void plot3( void ); +void plot4( void ); //-------------------------------------------------------------------------- // main @@ -81,7 +81,7 @@ // Plot a model diurnal cycle of temperature void -plot1() +plot1( void ) { int i, npts; PLFLT xmin, xmax, ymin, ymax; @@ -140,7 +140,7 @@ // Plot the number of hours of daylight as a function of day for a year void -plot2() +plot2( void ) { int j, npts; PLFLT xmin, xmax, ymin, ymax; @@ -187,7 +187,7 @@ } void -plot3() +plot3( void ) { int i, npts; PLFLT xmin, xmax, ymin, ymax; @@ -231,7 +231,7 @@ } void -plot4() +plot4( void ) { // TAI-UTC (seconds) as a function of time. // Use Besselian epochs as the continuous time interval just to prove @@ -244,7 +244,7 @@ char title_suffix[100]; char xtitle[100]; char title[100]; - PLFLT x[1001], y[1001]; + PLFLT xx[1001], yy[1001]; PLINT tai_year, tai_month, tai_day, tai_hour, tai_min; PLFLT tai_sec, tai; PLINT utc_year, utc_month, utc_day, utc_hour, utc_min; @@ -342,15 +342,15 @@ for ( i = 0; i < npts; i++ ) { - x[i] = xmin + i * ( xmax - xmin ) / ( (double) ( npts - 1 ) ); + xx[i] = xmin + i * ( xmax - xmin ) / ( (double) ( npts - 1 ) ); plconfigtime( scale, offset1, offset2, 0x0, 0, 0, 0, 0, 0, 0, 0. ); - tai = x[i]; + tai = xx[i]; plbtime( &tai_year, &tai_month, &tai_day, &tai_hour, &tai_min, &tai_sec, tai ); plconfigtime( scale, offset1, offset2, 0x2, 0, 0, 0, 0, 0, 0, 0. ); plbtime( &utc_year, &utc_month, &utc_day, &utc_hour, &utc_min, &utc_sec, tai ); plconfigtime( scale, offset1, offset2, 0x0, 0, 0, 0, 0, 0, 0, 0. ); plctime( utc_year, utc_month, utc_day, utc_hour, utc_min, utc_sec, &utc ); - y[i] = ( tai - utc ) * scale * 86400.; + yy[i] = ( tai - utc ) * scale * 86400.; } pladv( 0 ); @@ -365,11 +365,11 @@ plbox( "bcnstd", xlabel_step, 0, "bcnstv", 0., 0 ); plcol0( 3 ); strncpy( title, "@frPLplot Example 29 - TAI-UTC ", 100 ); - strncat( title, title_suffix, 100 ); + strncat( title, title_suffix, 100 - strlen(title) ); pllab( xtitle, "TAI-UTC (sec)", title ); plcol0( 4 ); - plline( npts, x, y ); + plline( npts, xx, yy ); } } Modified: trunk/examples/c/x33c.c =================================================================== --- trunk/examples/c/x33c.c 2011-10-14 07:11:18 UTC (rev 11967) +++ trunk/examples/c/x33c.c 2011-10-14 07:12:16 UTC (rev 11968) @@ -32,6 +32,9 @@ #include "plcdemos.h" +void plcolorbar_example_page( int kind_i, int label_i, int cap_i, PLINT cont_color, PLINT cont_width, PLINT n_values, PLFLT *values ); +void plcolorbar_example( const char *palette, int kind_i, PLINT cont_color, PLINT cont_width, PLINT n_values, PLFLT *values ); + static PLINT position_options[16] = { PL_POSITION_LEFT | PL_POSITION_TOP | PL_POSITION_OUTSIDE, PL_POSITION_TOP | PL_POSITION_OUTSIDE, @@ -52,7 +55,7 @@ }; // Pick 5 arbitrary UTF-8 symbols useful for plotting points (✠✚✱✪✽✺✰✴✦). -static char *special_symbols[5] = { +static const char *special_symbols[5] = { "✰", "✴", "✱", @@ -310,7 +313,8 @@ PLINT line_widths[MAX_NLEGEND]; PLINT symbol_numbers[MAX_NLEGEND], symbol_colors[MAX_NLEGEND]; PLFLT symbol_scales[MAX_NLEGEND]; - char *text[MAX_NLEGEND], *symbols[MAX_NLEGEND]; + char *text[MAX_NLEGEND]; + const char *symbols[MAX_NLEGEND]; PLFLT legend_width, legend_height, x, y, xstart, ystart; PLFLT max_height, text_scale; PLINT position, opt_base, nrow, ncolumn; Modified: trunk/examples/c/x34c.c =================================================================== --- trunk/examples/c/x34c.c 2011-10-14 07:11:18 UTC (rev 11967) +++ trunk/examples/c/x34c.c 2011-10-14 07:12:16 UTC (rev 11968) @@ -38,7 +38,7 @@ "XOR drawing" }; -void initialize_colors(); +void initialize_colors( void ); void draw_page( PLINT mode, const char *title ); //-------------------------------------------------------------------------- @@ -80,10 +80,10 @@ // Clean up plend(); - return; + exit(0); } -void initialize_colors() +void initialize_colors( void ) { plscol0( 0, 255, 255, 255 ); plscol0( 1, 0, 0, 0 ); Modified: trunk/examples/c++/x09.cc =================================================================== --- trunk/examples/c++/x09.cc 2011-10-14 07:11:18 UTC (rev 11967) +++ trunk/examples/c++/x09.cc 2011-10-14 07:12:16 UTC (rev 11968) @@ -36,7 +36,7 @@ public: x09( int, const char** ); void polar(); - const void potential(); + void potential(); private: plstream *pls; @@ -335,7 +335,7 @@ delete[] lev; } -const void x09::potential() +void x09::potential() // Shielded potential contour plot example. { int i, j; Modified: trunk/examples/c++/x19.cc =================================================================== --- trunk/examples/c++/x19.cc 2011-10-14 07:11:18 UTC (rev 11967) +++ trunk/examples/c++/x19.cc 2011-10-14 07:12:16 UTC (rev 11968) @@ -102,8 +102,8 @@ void geolocation_labeler( PLINT axis, PLFLT value, char *label, PLINT length, PLPointer data ) { - const char *direction_label; - PLFLT label_val; + const char *direction_label = ""; + PLFLT label_val = 0.0; if ( axis == PL_Y_AXIS ) { Modified: trunk/examples/c++/x27.cc =================================================================== --- trunk/examples/c++/x27.cc 2011-10-14 07:11:18 UTC (rev 11967) +++ trunk/examples/c++/x27.cc 2011-10-14 07:12:16 UTC (rev 11968) @@ -60,15 +60,15 @@ // N.B. N is just a place holder since it is no longer used // (because we now have proper termination of the angle loop). PLFLT params[9][4] = { - 21.0, 7.0, 7.0, 3.0, // Deltoid - 21.0, 7.0, 10.0, 3.0, - 21.0, -7.0, 10.0, 3.0, - 20.0, 3.0, 7.0, 20.0, - 20.0, 3.0, 10.0, 20.0, - 20.0, -3.0, 10.0, 20.0, - 20.0, 13.0, 7.0, 20.0, - 20.0, 13.0, 20.0, 20.0, - 20.0, -13.0, 20.0, 20.0 + { 21.0, 7.0, 7.0, 3.0} , // Deltoid + { 21.0, 7.0, 10.0, 3.0} , + { 21.0, -7.0, 10.0, 3.0} , + { 20.0, 3.0, 7.0, 20.0} , + { 20.0, 3.0, 10.0, 20.0} , + { 20.0, -3.0, 10.0, 20.0} , + { 20.0, 13.0, 7.0, 20.0} , + { 20.0, 13.0, 20.0, 20.0} , + { 20.0, -13.0, 20.0, 20.0} }; int i; Modified: trunk/examples/c++/x29.cc =================================================================== --- trunk/examples/c++/x29.cc 2011-10-14 07:11:18 UTC (rev 11967) +++ trunk/examples/c++/x29.cc 2011-10-14 07:12:16 UTC (rev 11968) @@ -375,7 +375,7 @@ pls->box( "bcnstd", xlabel_step, 0, "bcnstv", 0., 0 ); pls->col0( 3 ); strncpy( title, "@frPLplot Example 29 - TAI-UTC ", 100 ); - strncat( title, title_suffix, 100 ); + strncat( title, title_suffix, 100 - strlen(title) ); pls->lab( xtitle, "TAI-UTC (sec)", title ); pls->col0( 4 ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2011-10-20 22:54:23
|
Revision: 11992 http://plplot.svn.sourceforge.net/plplot/?rev=11992&view=rev Author: andrewross Date: 2011-10-20 22:54:16 +0000 (Thu, 20 Oct 2011) Log Message: ----------- Few more fixed warnings for C examples. Modified Paths: -------------- trunk/examples/c/x19c.c trunk/examples/c/x20c.c trunk/examples/c/x27c.c trunk/examples/c++/x27.cc Modified: trunk/examples/c/x19c.c =================================================================== --- trunk/examples/c/x19c.c 2011-10-20 22:02:21 UTC (rev 11991) +++ trunk/examples/c/x19c.c 2011-10-20 22:54:16 UTC (rev 11992) @@ -70,8 +70,8 @@ void geolocation_labeler( PLINT axis, PLFLT value, char *label, PLINT length, PLPointer data ) { - const char *direction_label; - PLFLT label_val; + const char *direction_label = NULL; + PLFLT label_val = 0.0; if ( axis == PL_Y_AXIS ) { @@ -108,11 +108,11 @@ if ( axis == PL_Y_AXIS && value == 0.0 ) { // A special case for the equator - snprintf( label, length, "%s", direction_label ); + snprintf( label, (size_t) length, "%s", direction_label ); } else { - snprintf( label, length, "%.0f%s", fabs( label_val ), direction_label ); + snprintf( label, (size_t) length, "%.0f%s", fabs( label_val ), direction_label ); } } Modified: trunk/examples/c/x20c.c =================================================================== --- trunk/examples/c/x20c.c 2011-10-20 22:02:21 UTC (rev 11991) +++ trunk/examples/c/x20c.c 2011-10-20 22:54:16 UTC (rev 11992) @@ -346,10 +346,10 @@ } // printf("width=%d height=%d num_col=%d\n", w, h, *num_col); - img = (unsigned char *) malloc( w * h * sizeof ( char ) ); + img = (unsigned char *) malloc( (size_t) (w * h) * sizeof ( char ) ); plAlloc2dGrid( &imf, w, h ); - if ( fread( img, sizeof ( char ), w * h, fp ) != w * h ) + if ( (int) fread( img, sizeof ( char ), (size_t) (w * h), fp ) != w * h ) { fclose( fp ); free( img ); Modified: trunk/examples/c/x27c.c =================================================================== --- trunk/examples/c/x27c.c 2011-10-20 22:02:21 UTC (rev 11991) +++ trunk/examples/c/x27c.c 2011-10-20 22:54:16 UTC (rev 11992) @@ -163,11 +163,11 @@ PLFLT phi; PLFLT phiw; PLFLT dphi; - PLFLT xmin; - PLFLT xmax; + PLFLT xmin = 0.0; + PLFLT xmax = 0.0; PLFLT xrange_adjust; - PLFLT ymin; - PLFLT ymax; + PLFLT ymin = 0.0; + PLFLT ymax = 0.0; PLFLT yrange_adjust; // Fill the coordinates @@ -175,7 +175,7 @@ // Proper termination of the angle loop very near the beginning // point, see // http://mathforum.org/mathimages/index.php/Hypotrochoid. - windings = (PLINT) ( abs( params[1] ) / gcd( (PLINT) params[0], (PLINT) params[1] ) ); + windings = (int) ( abs( (int) params[1] ) / gcd( (PLINT) params[0], (PLINT) params[1] ) ); steps = NPNT / windings; dphi = 2.0 * PI / (PLFLT) steps; Modified: trunk/examples/c++/x27.cc =================================================================== --- trunk/examples/c++/x27.cc 2011-10-20 22:02:21 UTC (rev 11991) +++ trunk/examples/c++/x27.cc 2011-10-20 22:54:16 UTC (rev 11992) @@ -170,11 +170,11 @@ PLFLT phi; PLFLT phiw; PLFLT dphi; - PLFLT xmin; - PLFLT xmax; + PLFLT xmin = 0.0; + PLFLT xmax = 0.0; PLFLT xrange_adjust; - PLFLT ymin; - PLFLT ymax; + PLFLT ymin = 0.0; + PLFLT ymax = 0.0; PLFLT yrange_adjust; // Fill the coordinates This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2011-10-31 12:42:43
|
Revision: 12017 http://plplot.svn.sourceforge.net/plplot/?rev=12017&view=rev Author: andrewross Date: 2011-10-31 12:42:36 +0000 (Mon, 31 Oct 2011) Log Message: ----------- Fixes so that installed tcl and tk examples work using the cmake build system with a separate binary directory, even if the original plplot source and binary trees are no longer present. Modified Paths: -------------- trunk/examples/plplot_configure.cmake_installed_examples.in trunk/examples/tcl/CMakeLists.txt Modified: trunk/examples/plplot_configure.cmake_installed_examples.in =================================================================== --- trunk/examples/plplot_configure.cmake_installed_examples.in 2011-10-31 11:28:37 UTC (rev 12016) +++ trunk/examples/plplot_configure.cmake_installed_examples.in 2011-10-31 12:42:36 UTC (rev 12017) @@ -137,7 +137,7 @@ if(ENABLE_tcl OR ENABLE_tk) set(TCL_TCLSH @TCL_TCLSH@) - set(MKTCLINDEX @MKTCLINDEX@) + set(MKTCLINDEX ${CMAKE_SOURCE_DIR}/tcl/mktclIndex) set(MKTCLINDEX_ARGS @MKTCLINDEX_ARGS@) endif(ENABLE_tcl OR ENABLE_tk) Modified: trunk/examples/tcl/CMakeLists.txt =================================================================== --- trunk/examples/tcl/CMakeLists.txt 2011-10-31 11:28:37 UTC (rev 12016) +++ trunk/examples/tcl/CMakeLists.txt 2011-10-31 12:42:36 UTC (rev 12017) @@ -84,34 +84,35 @@ @ONLY ) -if(CORE_BUILD) - # Copy file and scripts to the binary directory if different to the - # source directory. Needed for ctest, but also so the tclIndex file - # is generated in the binary tree not the source tree. - set(tclIndex_DEPENDS) - foreach(file ${tcl_SCRIPTS} ${tcl_FILES}) - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${file} - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${CMAKE_CURRENT_SOURCE_DIR}/${file} ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file} - ) - list(APPEND tclIndex_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${file}) - endforeach(file ${tcl_SCRIPTS} ${tcl_FILES}) - add_custom_target(tcl_examples ALL DEPENDS ${tclIndex_DEPENDS}) - +# Copy file and scripts to the binary directory if different to the +# source directory. Needed for ctest, but also so the tclIndex file +# is generated in the binary tree not the source tree. +set(tclIndex_DEPENDS) +foreach(file ${tcl_SCRIPTS} ${tcl_FILES}) add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tclIndex - COMMAND ${TCL_TCLSH} ${MKTCLINDEX} ${MKTCLINDEX_ARGS} - DEPENDS ${tclIndex_DEPENDS} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${file} + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${CMAKE_CURRENT_SOURCE_DIR}/${file} ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file} ) - add_custom_target(tclIndex_examples_tcl ALL - DEPENDS ${tclIndex_DEPENDS} ${CMAKE_CURRENT_BINARY_DIR}/tclIndex - ) + list(APPEND tclIndex_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${file}) +endforeach(file ${tcl_SCRIPTS} ${tcl_FILES}) +add_custom_target(tcl_examples ALL DEPENDS ${tclIndex_DEPENDS}) - # These two custom targets file-depend on common files so must serialize. - add_dependencies(tclIndex_examples_tcl tcl_examples) +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tclIndex + COMMAND ${TCL_TCLSH} ${MKTCLINDEX} ${MKTCLINDEX_ARGS} + DEPENDS ${tclIndex_DEPENDS} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) +add_custom_target(tclIndex_examples_tcl ALL + DEPENDS ${tclIndex_DEPENDS} ${CMAKE_CURRENT_BINARY_DIR}/tclIndex + ) + +# These two custom targets file-depend on common files so must serialize. +add_dependencies(tclIndex_examples_tcl tcl_examples) + +if(CORE_BUILD) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/tclIndex DESTINATION ${DATA_DIR}/examples/tcl @@ -125,14 +126,6 @@ install(FILES CMakeLists.txt DESTINATION ${DATA_DIR}/examples/tcl ) - -else(CORE_BUILD) - set(tclIndex_DEPENDS) - foreach(file ${tcl_SCRIPTS} ${tcl_FILES}) - list(APPEND tclIndex_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file}) - endforeach(file ${tcl_SCRIPTS} ${tcl_FILES}) - add_custom_target(tcl_examples ALL DEPENDS ${tclIndex_DEPENDS}) - endif(CORE_BUILD) if(BUILD_TEST) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2011-11-25 09:26:40
|
Revision: 12046 http://plplot.svn.sourceforge.net/plplot/?rev=12046&view=rev Author: andrewross Date: 2011-11-25 09:26:34 +0000 (Fri, 25 Nov 2011) Log Message: ----------- For f77 / f95 examples with NON_TRANSITIVE=ON then need to explicitly link against the C part of the fortran bindings as much of the API is in this library. This ensures that the examples build on the latest Fedora / Debian systems with a stricter linker. Modified Paths: -------------- trunk/examples/f77/CMakeLists.txt trunk/examples/f95/CMakeLists.txt Modified: trunk/examples/f77/CMakeLists.txt =================================================================== --- trunk/examples/f77/CMakeLists.txt 2011-11-25 01:43:13 UTC (rev 12045) +++ trunk/examples/f77/CMakeLists.txt 2011-11-25 09:26:34 UTC (rev 12046) @@ -146,9 +146,9 @@ foreach(STRING_INDEX ${f77_STRING_INDICES}) add_executable(x${STRING_INDEX}f ${f77_directory}/x${STRING_INDEX}f.f) if(STATIC_OPTS) - target_link_libraries(x${STRING_INDEX}f plplotf77opts${LIB_TAG} plplotf77${LIB_TAG}) + target_link_libraries(x${STRING_INDEX}f plplotf77opts${LIB_TAG} plplotf77${LIB_TAG} plplotf77c${LIB_TAG}) else(STATIC_OPTS) - target_link_libraries(x${STRING_INDEX}f plplotf77${LIB_TAG}) + target_link_libraries(x${STRING_INDEX}f plplotf77${LIB_TAG} plplotf77c${LIB_TAG}) endif(STATIC_OPTS) add_dependencies(x${STRING_INDEX}f build_plplot_parameters_h) set_property(GLOBAL APPEND PROPERTY TARGETS_examples_f77 x${STRING_INDEX}f) Modified: trunk/examples/f95/CMakeLists.txt =================================================================== --- trunk/examples/f95/CMakeLists.txt 2011-11-25 01:43:13 UTC (rev 12045) +++ trunk/examples/f95/CMakeLists.txt 2011-11-25 09:26:34 UTC (rev 12046) @@ -125,9 +125,9 @@ OUTPUT_NAME x${STRING_INDEX}f ) if(STATIC_OPTS) - target_link_libraries(x${STRING_INDEX}f95 plplotf95opts${LIB_TAG} plplotf95${LIB_TAG}) + target_link_libraries(x${STRING_INDEX}f95 plplotf95opts${LIB_TAG} plplotf95${LIB_TAG} plplotf95c${LIB_TAG}) else(STATIC_OPTS) - target_link_libraries(x${STRING_INDEX}f95 plplotf95${LIB_TAG}) + target_link_libraries(x${STRING_INDEX}f95 plplotf95${LIB_TAG} plplotf95c${LIB_TAG}) endif(STATIC_OPTS) set_property(GLOBAL APPEND PROPERTY TARGETS_examples_f95 x${STRING_INDEX}f95) endforeach(STRING_INDEX ${f95_STRING_INDICES}) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-11-26 20:52:00
|
Revision: 12053 http://plplot.svn.sourceforge.net/plplot/?rev=12053&view=rev Author: airwin Date: 2011-11-26 20:51:54 +0000 (Sat, 26 Nov 2011) Log Message: ----------- Use the --static pkg-config option for the traditional build and test of the installed examples under certain circumstances. Modified Paths: -------------- trunk/examples/CMakeLists.txt trunk/examples/ada/Makefile.examples.in trunk/examples/c/Makefile.examples.in trunk/examples/c++/Makefile.examples.in trunk/examples/f77/Makefile.examples.in trunk/examples/f95/Makefile.examples.in trunk/examples/tk/Makefile.examples.in Modified: trunk/examples/CMakeLists.txt =================================================================== --- trunk/examples/CMakeLists.txt 2011-11-26 20:34:45 UTC (rev 12052) +++ trunk/examples/CMakeLists.txt 2011-11-26 20:51:54 UTC (rev 12053) @@ -181,6 +181,22 @@ set(PDFQT_COMMENT "#") endif(NOT PLD_pdfqt) + # The D case takes special handling so the logic below is for the + # generic non-D examples case. + if(NON_TRANSITIVE) + if(BUILD_SHARED_LIBS) + # pkg-config does not use --static option for examples build. + set(PC_STATIC_OPTION) + else(BUILD_SHARED_LIBS) + # pkg-config does use --static option for examples build. + set(PC_STATIC_OPTION "--static") + endif(BUILD_SHARED_LIBS) + else(NON_TRANSITIVE) + # pkg-config never uses the --static option for the examples build + # for the transitive case. + set(PC_STATIC_OPTION) + endif(NON_TRANSITIVE) + configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/Makefile.examples.in ${CMAKE_CURRENT_BINARY_DIR}/Makefile.examples Modified: trunk/examples/ada/Makefile.examples.in =================================================================== --- trunk/examples/ada/Makefile.examples.in 2011-11-26 20:34:45 UTC (rev 12052) +++ trunk/examples/ada/Makefile.examples.in 2011-11-26 20:51:54 UTC (rev 12053) @@ -104,6 +104,6 @@ # anything after -cargs below. .adb$(EXEEXT): $(GNAT_EXECUTABLE_BUILDER) $< \ - -cargs `$(PKG_CONFIG_ENV) pkg-config --cflags plplot$(LIB_TAG)-ada` -largs $(RPATHCMD) `$(PKG_CONFIG_ENV) pkg-config --libs plplot$(LIB_TAG)-ada` + -cargs `$(PKG_CONFIG_ENV) pkg-config @PC_STATIC_OPTION@ --cflags plplot$(LIB_TAG)-ada` -largs $(RPATHCMD) `$(PKG_CONFIG_ENV) pkg-config @PC_STATIC_OPTION@ --libs plplot$(LIB_TAG)-ada` .SUFFIXES: .adb $(EXEEXT) Modified: trunk/examples/c/Makefile.examples.in =================================================================== --- trunk/examples/c/Makefile.examples.in 2011-11-26 20:34:45 UTC (rev 12052) +++ trunk/examples/c/Makefile.examples.in 2011-11-26 20:51:54 UTC (rev 12053) @@ -84,28 +84,28 @@ @gcw_true@plplotcanvas_demo$(EXEEXT): plplotcanvas_demo.c @gcw_true@@pkg_config_true@ $(CC) $< -o $@ $(RPATHCMD) \ -@gcw_true@@pkg_config_true@ `$(PKG_CONFIG_ENV) pkg-config --cflags --libs plplot$(LIB_TAG)-gnome2` +@gcw_true@@pkg_config_true@ `$(PKG_CONFIG_ENV) pkg-config @PC_STATIC_OPTION@ --cflags --libs plplot$(LIB_TAG)-gnome2` @gcw_true@@pkg_config_false@ $(CC) $< -o $@ \ -@gcw_true@@pkg_config_false@ `plplot-config --cflags --libs --with-gcw` +@gcw_true@@pkg_config_false@ `plplot-config @PC_STATIC_OPTION@ --cflags --libs --with-gcw` @gcw_true@plplotcanvas_animation$(EXEEXT): plplotcanvas_animation.c @gcw_true@@pkg_config_true@ $(CC) $< -o $@ $(RPATHCMD) \ -@gcw_true@@pkg_config_true@ `$(PKG_CONFIG_ENV) pkg-config --cflags --libs plplot$(LIB_TAG)-gnome2` \ -@gcw_true@@pkg_config_true@ `pkg-config --cflags --libs gthread-2.0` +@gcw_true@@pkg_config_true@ `$(PKG_CONFIG_ENV) pkg-config @PC_STATIC_OPTION@ --cflags --libs plplot$(LIB_TAG)-gnome2` \ +@gcw_true@@pkg_config_true@ `pkg-config @PC_STATIC_OPTION@ --cflags --libs gthread-2.0` @gcw_true@@pkg_config_false@ $(CC) $< -o \ @gcw_true@@pkg_config_false@ $@ `plplot-config --cflags --libs --with-gcw` \ @gcw_true@@pkg_config_false@ @GCWTHREAD_CFLAGS@ @GCWTHREAD_LIBS@ @extXdrawable_true@@pkg_config_true@extXdrawable_demo$(EXEEXT): extXdrawable_demo.c @extXdrawable_true@@pkg_config_true@ $(CC) $< -o $@ $(RPATHCMD) \ -@extXdrawable_true@@pkg_config_true@ `$(PKG_CONFIG_ENV) pkg-config --cflags --libs plplot$(LIB_TAG) gtk+-x11-2.0` +@extXdrawable_true@@pkg_config_true@ `$(PKG_CONFIG_ENV) pkg-config @PC_STATIC_OPTION@ --cflags --libs plplot$(LIB_TAG) gtk+-x11-2.0` @extcairo_true@@pkg_config_true@ext-cairo-test$(EXEEXT): ext-cairo-test.c @extcairo_true@@pkg_config_true@ $(CC) $< -o $@ $(RPATHCMD) \ -@extcairo_true@@pkg_config_true@ `$(PKG_CONFIG_ENV) pkg-config --cflags --libs plplot$(LIB_TAG) cairo` +@extcairo_true@@pkg_config_true@ `$(PKG_CONFIG_ENV) pkg-config @PC_STATIC_OPTION@ --cflags --libs plplot$(LIB_TAG) cairo` .c$(EXEEXT): -@pkg_config_true@ $(CC) $< -o $@ $(RPATHCMD) `$(PKG_CONFIG_ENV) pkg-config --cflags --libs plplot$(LIB_TAG)` +@pkg_config_true@ $(CC) $< -o $@ $(RPATHCMD) `$(PKG_CONFIG_ENV) pkg-config @PC_STATIC_OPTION@ --cflags --libs plplot$(LIB_TAG)` @pkg_config_false@ $(CC) $< -o $@ `plplot-config --cflags --libs` .SUFFIXES: .c $(EXEEXT) Modified: trunk/examples/c++/Makefile.examples.in =================================================================== --- trunk/examples/c++/Makefile.examples.in 2011-11-26 20:34:45 UTC (rev 12052) +++ trunk/examples/c++/Makefile.examples.in 2011-11-26 20:51:54 UTC (rev 12053) @@ -80,18 +80,18 @@ rm -f $(EXECUTABLES_list) @wxwidgets_true@@pkg_config_true@wxPLplotDemo$(EXEEXT): wxPLplotDemo.cpp -@wxwidgets_true@@pkg_config_true@ $(CXX) $< -o $@ $(RPATHCMD) `$(PKG_CONFIG_ENV) pkg-config --cflags --libs plplot$(LIB_TAG)-wxwidgets` +@wxwidgets_true@@pkg_config_true@ $(CXX) $< -o $@ $(RPATHCMD) `$(PKG_CONFIG_ENV) pkg-config @PC_STATIC_OPTION@ --cflags --libs plplot$(LIB_TAG)-wxwidgets` # Note, must filter out -p options which confuse $(QT_MOC_EXECUTABLE). Such # options (e.g., -pthread) tend to appear in the static driver case. @qt_gui_true@@pkg_config_true@moc_qt_PlotWindow.cpp: qt_PlotWindow.h -@qt_gui_true@@pkg_config_true@ $(QT_MOC_EXECUTABLE) `$(PKG_CONFIG_ENV) pkg-config --cflags-only-I plplot$(LIB_TAG)-qt` $< -o $@ +@qt_gui_true@@pkg_config_true@ $(QT_MOC_EXECUTABLE) `$(PKG_CONFIG_ENV) pkg-config @PC_STATIC_OPTION@ --cflags-only-I plplot$(LIB_TAG)-qt` $< -o $@ @qt_gui_true@@pkg_config_true@qt_example$(EXEEXT): qt_example.cpp qt_PlotWindow.cpp moc_qt_PlotWindow.cpp -@qt_gui_true@@pkg_config_true@ $(CXX) qt_example.cpp qt_PlotWindow.cpp moc_qt_PlotWindow.cpp -o $@ $(qt_RPATHCMD) `$(PKG_CONFIG_ENV) pkg-config --cflags --libs plplot$(LIB_TAG)-qt` +@qt_gui_true@@pkg_config_true@ $(CXX) qt_example.cpp qt_PlotWindow.cpp moc_qt_PlotWindow.cpp -o $@ $(qt_RPATHCMD) `$(PKG_CONFIG_ENV) pkg-config @PC_STATIC_OPTION@ --cflags --libs plplot$(LIB_TAG)-qt` .cc$(EXEEXT): -@pkg_config_true@ $(CXX) $< -o $@ $(RPATHCMD) `$(PKG_CONFIG_ENV) pkg-config --cflags --libs plplot$(LIB_TAG)-c++` +@pkg_config_true@ $(CXX) $< -o $@ $(RPATHCMD) `$(PKG_CONFIG_ENV) pkg-config @PC_STATIC_OPTION@ --cflags --libs plplot$(LIB_TAG)-c++` @pkg_config_false@ $(CXX) $< -o $@ `plplot-config --cflags --libs --with-c++` .SUFFIXES: .cc $(EXEEXT) Modified: trunk/examples/f77/Makefile.examples.in =================================================================== --- trunk/examples/f77/Makefile.examples.in 2011-11-26 20:34:45 UTC (rev 12052) +++ trunk/examples/f77/Makefile.examples.in 2011-11-26 20:51:54 UTC (rev 12053) @@ -70,7 +70,7 @@ rm -f $(EXECUTABLES_list) .f$(EXEEXT): -@pkg_config_true@ $(F77) $< -o $@ $(RPATHCMD) `$(PKG_CONFIG_ENV) pkg-config --cflags --libs plplot$(LIB_TAG)-f77` +@pkg_config_true@ $(F77) $< -o $@ $(RPATHCMD) `$(PKG_CONFIG_ENV) pkg-config @PC_STATIC_OPTION@ --cflags --libs plplot$(LIB_TAG)-f77` @pkg_config_false@ $(F77) $< -o $@ `plplot-config --cflags --libs --with-f77` .SUFFIXES: .f $(EXEEXT) Modified: trunk/examples/f95/Makefile.examples.in =================================================================== --- trunk/examples/f95/Makefile.examples.in 2011-11-26 20:34:45 UTC (rev 12052) +++ trunk/examples/f95/Makefile.examples.in 2011-11-26 20:51:54 UTC (rev 12053) @@ -69,7 +69,7 @@ rm -f $(EXECUTABLES_list) .f90$(EXEEXT): -@pkg_config_true@ $(F95) @MODULESINCCMD@ $< -o $@ $(RPATHCMD) `$(PKG_CONFIG_ENV) pkg-config --cflags --libs plplot$(LIB_TAG)-f95` +@pkg_config_true@ $(F95) @MODULESINCCMD@ $< -o $@ $(RPATHCMD) `$(PKG_CONFIG_ENV) pkg-config @PC_STATIC_OPTION@ --cflags --libs plplot$(LIB_TAG)-f95` @pkg_config_false@ $(F95) @MODULESINCCMD@ $< -o $@ `plplot-config --cflags --libs --with-f95` .SUFFIXES: .f90 $(EXEEXT) Modified: trunk/examples/tk/Makefile.examples.in =================================================================== --- trunk/examples/tk/Makefile.examples.in 2011-11-26 20:34:45 UTC (rev 12052) +++ trunk/examples/tk/Makefile.examples.in 2011-11-26 20:51:54 UTC (rev 12053) @@ -37,7 +37,7 @@ rm -f $(EXECUTABLES_list) $(itk_EXECUTABLES_list) .c$(EXEEXT): -@pkg_config_true@ $(CC) $< -o $@ $(RPATHCMD) `$(PKG_CONFIG_ENV) pkg-config --cflags --libs plplot$(LIB_TAG)-tcl` +@pkg_config_true@ $(CC) $< -o $@ $(RPATHCMD) `$(PKG_CONFIG_ENV) pkg-config @PC_STATIC_OPTION@ --cflags --libs plplot$(LIB_TAG)-tcl` @pkg_config_false@ $(CC) $< -o $@ `plplot-config --cflags --libs --with-tcl` .SUFFIXES: .c $(EXEEXT) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-11-29 21:03:44
|
Revision: 12068 http://plplot.svn.sourceforge.net/plplot/?rev=12068&view=rev Author: airwin Date: 2011-11-29 21:03:33 +0000 (Tue, 29 Nov 2011) Log Message: ----------- Untested change to the build system to only use the --static pkg-config option for the traditional installed examples build when the experimental option FORCE_EXTERNAL_STATIC in ON. The D case is no longer treated as a special case because FORCE_EXTERNAL_STATIC is ON only when the PLplot internal libraries are built statically (BUILD_SHARED_LIBS OFF) so that distinctions between plplotdmd_SHARED ON or OFF no longer matter for the D case. Modified Paths: -------------- trunk/examples/CMakeLists.txt trunk/examples/d/CMakeLists.txt trunk/examples/d/Makefile.examples.in Modified: trunk/examples/CMakeLists.txt =================================================================== --- trunk/examples/CMakeLists.txt 2011-11-29 06:33:04 UTC (rev 12067) +++ trunk/examples/CMakeLists.txt 2011-11-29 21:03:33 UTC (rev 12068) @@ -181,21 +181,20 @@ set(PDFQT_COMMENT "#") endif(NOT PLD_pdfqt) - # The D case takes special handling so the logic below is for the - # generic non-D examples case. - if(NON_TRANSITIVE) - if(BUILD_SHARED_LIBS) - # pkg-config does not use --static option for examples build. - set(PC_STATIC_OPTION) - else(BUILD_SHARED_LIBS) - # pkg-config does use --static option for examples build. + if(FORCE_EXTERNAL_STATIC) + # This experiment option untested, but it should work as well as + # FORCE_EXTERNAL_STATIC does for the CMake linking case for the + # core build in the build tree. That is, not well at all (drivers + # limited to those without external dependencies and languages limited + # to C, C++, D, Fortran 77, and Fortran 95) because + # of severe limitations in static library support on Linux. + + # pkg-config does use --static option for traditional installed examples build. set(PC_STATIC_OPTION "--static") - endif(BUILD_SHARED_LIBS) - else(NON_TRANSITIVE) - # pkg-config never uses the --static option for the examples build - # for the transitive case. + else(FORCE_EXTERNAL_STATIC) + # pkg-config does not use --static option for traditional installed examples build. set(PC_STATIC_OPTION) - endif(NON_TRANSITIVE) + endif(FORCE_EXTERNAL_STATIC) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/Makefile.examples.in Modified: trunk/examples/d/CMakeLists.txt =================================================================== --- trunk/examples/d/CMakeLists.txt 2011-11-29 06:33:04 UTC (rev 12067) +++ trunk/examples/d/CMakeLists.txt 2011-11-29 21:03:33 UTC (rev 12068) @@ -72,20 +72,6 @@ set(DC ${CMAKE_D_COMPILER}) - if(NON_TRANSITIVE) - if(plplotdmd_SHARED AND BUILD_SHARED_LIBS) - # pkg-config does not use --static option for d examples build. - set(PC_STATIC_OPTION_D) - else(plplotdmd_SHARED AND BUILD_SHARED_LIBS) - # pkg-config uses --static option for d examples build. - set(PC_STATIC_OPTION_D "--static") - endif(plplotdmd_SHARED AND BUILD_SHARED_LIBS) - else(NON_TRANSITIVE) - # pkg-config never uses the --static option for the d examples build - # for the transitive case. - set(PC_STATIC_OPTION_D) - endif(NON_TRANSITIVE) - configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/Makefile.examples.in ${CMAKE_CURRENT_BINARY_DIR}/Makefile.examples Modified: trunk/examples/d/Makefile.examples.in =================================================================== --- trunk/examples/d/Makefile.examples.in 2011-11-29 06:33:04 UTC (rev 12067) +++ trunk/examples/d/Makefile.examples.in 2011-11-29 21:03:33 UTC (rev 12068) @@ -66,6 +66,6 @@ rm -f $(EXECUTABLES_list) .d$(EXEEXT): -@pkg_config_true@ $(DC) $< -o $@ $(RPATHCMD) `$(PKG_CONFIG_ENV) pkg-config @PC_STATIC_OPTION_D@ --cflags --libs plplot$(LIB_TAG)-d` +@pkg_config_true@ $(DC) $< -o $@ $(RPATHCMD) `$(PKG_CONFIG_ENV) pkg-config @PC_STATIC_OPTION@ --cflags --libs plplot$(LIB_TAG)-d` .SUFFIXES: .d $(EXEEXT) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2012-01-14 23:19:17
|
Revision: 12129 http://plplot.svn.sourceforge.net/plplot/?rev=12129&view=rev Author: airwin Date: 2012-01-14 23:19:10 +0000 (Sat, 14 Jan 2012) Log Message: ----------- Style previous commits. Modified Paths: -------------- trunk/examples/c/x11c.c trunk/examples/tk/xtk01.c Modified: trunk/examples/c/x11c.c =================================================================== --- trunk/examples/c/x11c.c 2012-01-14 23:17:53 UTC (rev 12128) +++ trunk/examples/c/x11c.c 2012-01-14 23:19:10 UTC (rev 12129) @@ -114,7 +114,7 @@ } } - plMinMax2dGrid( (const PLFLT * const*) z, XPTS, YPTS, &zmax, &zmin ); + plMinMax2dGrid( (const PLFLT * const *) z, XPTS, YPTS, &zmax, &zmin ); step = ( zmax - zmin ) / ( nlevel + 1 ); for ( i = 0; i < nlevel; i++ ) clevel[i] = zmin + step + step * i; Modified: trunk/examples/tk/xtk01.c =================================================================== --- trunk/examples/tk/xtk01.c 2012-01-14 23:17:53 UTC (rev 12128) +++ trunk/examples/tk/xtk01.c 2012-01-14 23:19:10 UTC (rev 12129) @@ -441,7 +441,7 @@ sh_width = 2; plpsty( 0 ); - plshade( (const PLFLT * const *)z, XPTS, YPTS, NULL, -1., 1., -1., 1., + plshade( (const PLFLT * const *) z, XPTS, YPTS, NULL, -1., 1., -1., 1., shade_min, shade_max, sh_cmap, sh_color, sh_width, min_color, min_width, max_color, max_width, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2012-01-21 21:53:00
|
Revision: 12143 http://plplot.svn.sourceforge.net/plplot/?rev=12143&view=rev Author: andrewross Date: 2012-01-21 21:52:54 +0000 (Sat, 21 Jan 2012) Log Message: ----------- Update example 21. Remove extraneous call to cmap1_init in C version. Update C++, f95 and octave versions following the changes to the C version. Modified Paths: -------------- trunk/examples/c/x21c.c trunk/examples/c++/x21.cc trunk/examples/f95/x21f.f90 trunk/examples/octave/x21c.m Modified: trunk/examples/c/x21c.c =================================================================== --- trunk/examples/c/x21c.c 2012-01-21 18:50:23 UTC (rev 12142) +++ trunk/examples/c/x21c.c 2012-01-21 21:52:54 UTC (rev 12143) @@ -307,7 +307,6 @@ for ( i = 0; i < nl; i++ ) clev[i] = lzm + ( lzM - lzm ) / ( nl - 1 ) * i; - cmap1_init(); plvpor( 0.0, 1.0, 0.0, 0.9 ); plwind( -1.1, 0.75, -0.65, 1.20 ); // Modified: trunk/examples/c++/x21.cc =================================================================== --- trunk/examples/c++/x21.cc 2012-01-21 18:50:23 UTC (rev 12142) +++ trunk/examples/c++/x21.cc 2012-01-21 21:52:54 UTC (rev 12143) @@ -190,6 +190,8 @@ pls = new plstream(); + cmap1_init(); + pls->seed( 5489 ); // Parse and process command line arguments. @@ -222,8 +224,22 @@ pls->env( xm, xM, ym, yM, 2, 0 ); pls->col0( 15 ); pls->lab( "X", "Y", "The original data sampling" ); - pls->col0( 2 ); - pls->poin( pts, x, y, 5 ); + for ( i = 0; i < pts; i++ ) + { + pls->col1( ( z[i] - zmin ) / ( zmax - zmin ) ); + // The following plstring call should be the the equivalent of + // plpoin( 1, &x[i], &y[i], 5 ); Use plstring because it is + // not deprecated like plpoin and has much more powerful + // capabilities. N.B. symbol 141 works for Hershey devices + // (e.g., -dev xwin) only if plfontld( 0 ) has been called + // while symbol 727 works only if plfontld( 1 ) has been + // called. The latter is the default which is why we use 727 + // here to represent a centred X (multiplication) symbol. + // This dependence on plfontld is one of the limitations of + // the Hershey escapes for PLplot, but the upside is you get + // reasonable results for both Hershey and Unicode devices. + pls->string( 1, &x[i], &y[i], "#(727)" ); + } pls->adv( 0 ); pls->ssub( 3, 2 ); @@ -308,7 +324,6 @@ for ( i = 0; i < nl; i++ ) clev[i] = lzm + ( lzM - lzm ) / ( nl - 1 ) * i; - cmap1_init(); pls->vpor( 0.0, 1.0, 0.0, 0.9 ); pls->wind( -1.1, 0.75, -0.65, 1.20 ); // Modified: trunk/examples/f95/x21f.f90 =================================================================== --- trunk/examples/f95/x21f.f90 2012-01-21 18:50:23 UTC (rev 12142) +++ trunk/examples/f95/x21f.f90 2012-01-21 21:52:54 UTC (rev 12143) @@ -81,6 +81,8 @@ call plinit + call cmap1_init + call plseed(5489) do i=1,pts @@ -119,8 +121,21 @@ call plenv(xmin, xmax, ymin, ymax, 2, 0) call plcol0(15) call pllab("X", "Y", "The original data sampling") - call plcol0(2) - call plpoin(x, y, 5) + do i=1,pts + call plcol1( ( z(i) - zmin ) / ( zmax - zmin ) ) +! The following plstring call should be the the equivalent of +! plpoin( 1, &x[i], &y[i], 5 ); Use plstring because it is +! not deprecated like plpoin and has much more powerful +! capabilities. N.B. symbol 141 works for Hershey devices +! (e.g., -dev xwin) only if plfontld( 0 ) has been called +! while symbol 727 works only if plfontld( 1 ) has been +! called. The latter is the default which is why we use 727 +! here to represent a centred X (multiplication) symbol. +! This dependence on plfontld is one of the limitations of +! the Hershey escapes for PLplot, but the upside is you get +! reasonable results for both Hershey and Unicode devices. + call plstring( x(i:i), y(i:i), '#(727)' ); + enddo call pladv(0) call plssub(3,2) @@ -207,7 +222,6 @@ do i = 1,nl clev(i) = lzmin + (lzmax-lzmin)/(nl-1._plflt)*(i-1._plflt) enddo - call cmap1_init() call plvpor(0._plflt, 1._plflt, 0._plflt, 0.9_plflt) call plwind(-1.1_plflt, 0.75_plflt, -0.65_plflt, 1.20_plflt) ! Modified: trunk/examples/octave/x21c.m =================================================================== --- trunk/examples/octave/x21c.m 2012-01-21 18:50:23 UTC (rev 12142) +++ trunk/examples/octave/x21c.m 2012-01-21 21:52:54 UTC (rev 12143) @@ -81,6 +81,8 @@ plinit; + cmap1_init; + plseed(5489); [x, y, z] = create_data(pts, xm, xM, ym, yM, randn, rosen); ## the sampled data @@ -93,8 +95,10 @@ plenv(xm, xM, ym, yM, 2, 0); plcol0(15); pllab("X", "Y", "The original data sampling"); - plcol0(2); - plpoin(x, y, 5); + for i=1:pts + plcol1( ( z(i) - zmin ) / ( zmax - zmin ) ); + plstring( x(i), y(i), "#(727)" ); + end pladv(0); plssub(3,2); @@ -170,7 +174,6 @@ i=(0:nl-1)'; clev = lzm + (lzM-lzm)/(nl-1)*i; - cmap1_init; plvpor(0.0, 1.0, 0.0, 0.9); plwind(-1.1, 0.75, -0.65, 1.20); ## This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2012-01-24 15:28:59
|
Revision: 12151 http://plplot.svn.sourceforge.net/plplot/?rev=12151&view=rev Author: andrewross Date: 2012-01-24 15:28:48 +0000 (Tue, 24 Jan 2012) Log Message: ----------- Update python and java versions of example 21 following recent changes to C version. Modified Paths: -------------- trunk/examples/java/x21.java trunk/examples/python/xw21.py Modified: trunk/examples/java/x21.java =================================================================== --- trunk/examples/java/x21.java 2012-01-24 11:31:12 UTC (rev 12150) +++ trunk/examples/java/x21.java 2012-01-24 15:28:48 UTC (rev 12151) @@ -134,6 +134,7 @@ double x[], y[], z[], clev[]; double xg[], yg[], zg[][]; double xg0[][], yg0[][]; + double xx[], yy[]; double zmin, zmax, lzm[], lzM[]; int i, j, k; int alg; @@ -162,11 +163,15 @@ // Initialize PLplot. pls.init(); + cmap1_init(); + pls.seed( 5489 ); x = new double[pts]; y = new double[pts]; z = new double[pts]; + xx = new double[1]; + yy = new double[1]; create_data( x, y, z ); // the sampled data zmin = z[0]; @@ -203,8 +208,23 @@ pls.env( xm, xM, ym, yM, 2, 0 ); pls.col0( 15 ); pls.lab( "X", "Y", "The original data sampling" ); - pls.col0( 2 ); - pls.poin( x, y, 5 ); + for ( i = 0; i < pts ; i++ ) { + pls.col1( ( z[i] - zmin ) / ( zmax - zmin ) ); + // The following plstring call should be the the equivalent of + // plpoin( 1, &x[i], &y[i], 5 ); Use plstring because it is + // not deprecated like plpoin and has much more powerful + // capabilities. N.B. symbol 141 works for Hershey devices + // (e.g., -dev xwin) only if plfontld( 0 ) has been called + // while symbol 727 works only if plfontld( 1 ) has been + // called. The latter is the default which is why we use 727 + // here to represent a centred X (multiplication) symbol. + // This dependence on plfontld is one of the limitations of + // the Hershey escapes for PLplot, but the upside is you get + // reasonable results for both Hershey and Unicode devices. + xx[0] = x[i]; + yy[0] = y[i]; + pls.string( xx, yy, "#(727)" ); + } pls.adv( 0 ); pls.ssub( 3, 2 ); @@ -291,7 +311,6 @@ for ( i = 0; i < nl; i++ ) clev[i] = lzm[0] + ( lzM[0] - lzm[0] ) / ( nl - 1 ) * i; - cmap1_init(); pls.vpor( 0.0, 1.0, 0.0, 0.9 ); pls.wind( -1.1, 0.75, -0.65, 1.20 ); // Modified: trunk/examples/python/xw21.py =================================================================== --- trunk/examples/python/xw21.py 2012-01-24 11:31:12 UTC (rev 12150) +++ trunk/examples/python/xw21.py 2012-01-24 15:28:48 UTC (rev 12151) @@ -70,6 +70,7 @@ opt[3] = knn_order opt[4] = threshold + cmap1_init() plseed(5489) # Create the sampled data @@ -100,12 +101,18 @@ xg = xm + (xM-xm)*arange(xp)/(xp-1.) yg = ym + (yM-ym)*arange(yp)/(yp-1.) + xx = zeros(1) + yy = zeros(1) + plcol0(1) plenv(xm,xM,ym,yM,2,0) plcol0(15) pllab('X','Y','The original data sampling') - plcol0(2) - plpoin(x,y,5) + for i in range(pts): + plcol1( ( z[i] - zmin )/( zmax - zmin ) ) + xx[0] = x[i] + yy[0] = y[i] + plstring( xx, yy, '#(727)' ) pladv(0) plssub(3,2) @@ -157,7 +164,6 @@ plcol0(2) else: clev = lzm + (lzM-lzm)*arange(nl)/(nl-1) - cmap1_init() plvpor(0.0, 1.0, 0.0, 0.9) plwind(-1.1, 0.75, -0.65, 1.20) plw3d(1.0, 1.0, 1.0, xm, xM, ym, yM, lzm, lzM, 30.0, -40.0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arj...@us...> - 2012-02-19 10:37:16
|
Revision: 12169 http://plplot.svn.sourceforge.net/plplot/?rev=12169&view=rev Author: arjenmarkus Date: 2012-02-19 10:37:10 +0000 (Sun, 19 Feb 2012) Log Message: ----------- Add example x00 for both Fortran 95 and Tcl Modified Paths: -------------- trunk/examples/f95/CMakeLists.txt trunk/examples/tcl/CMakeLists.txt Added Paths: ----------- trunk/examples/f95/x00f.f90 trunk/examples/tcl/x00 trunk/examples/tcl/x00.tcl Modified: trunk/examples/f95/CMakeLists.txt =================================================================== --- trunk/examples/f95/CMakeLists.txt 2012-02-17 22:39:16 UTC (rev 12168) +++ trunk/examples/f95/CMakeLists.txt 2012-02-19 10:37:10 UTC (rev 12169) @@ -25,6 +25,7 @@ # BUILD_TEST ON and CORE_BUILD OFF. set(f95_STRING_INDICES + "00" "01" "02" "03" Added: trunk/examples/f95/x00f.f90 =================================================================== --- trunk/examples/f95/x00f.f90 (rev 0) +++ trunk/examples/f95/x00f.f90 2012-02-19 10:37:10 UTC (rev 12169) @@ -0,0 +1,59 @@ +! $Id: x00c.c 12001 2011-10-27 05:26:31Z airwin $ +! +! Simple demo of a 2D line plot. +! +! Copyright (C) 2011 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 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 + +program x00f95 + use plf95demolib + + integer, parameter :: NSIZE = 101 + + real(kind=plflt), dimension(NSIZE) :: x, y + + real(kind=plflt) :: xmin = 0._plflt, xmax = 1._plflt, ymin = 0._plflt, ymax = 100._plflt + integer :: i + + ! Prepare data to be plotted. + x = arange(0, NSIZE) / real(NSIZE-1,plflt) + y = ymax * x**2 + + ! Or alternatively, using a DO-loop + !do i = 1,NSIZE + ! x(i) = real( i - 1, plflt ) / real( NSIZE - 1, plflt ) + ! y(i) = ymax * x(i)**2 + !enddo + + ! Parse and process command line arguments + call plparseopts( PL_PARSE_FULL ) + + ! Initialize plplot + call plinit + + ! Create a labelled box to hold the plot. + call plenv( xmin, xmax, ymin, ymax, 0, 0 ) + call pllab( "x", "y=100 x#u2#d", "Simple PLplot demo of a 2D line plot" ) + + ! Plot the data that was prepared above. + call plline( x, y ) + + ! Close PLplot library + call plend + +end program x00f95 Modified: trunk/examples/tcl/CMakeLists.txt =================================================================== --- trunk/examples/tcl/CMakeLists.txt 2012-02-17 22:39:16 UTC (rev 12168) +++ trunk/examples/tcl/CMakeLists.txt 2012-02-19 10:37:10 UTC (rev 12169) @@ -35,6 +35,7 @@ ) set(tcl_STRING_INDICES +"00" "01" "02" "03" @@ -119,7 +120,7 @@ ) install(FILES ${tcl_FILES} DESTINATION ${DATA_DIR}/examples/tcl) - install(PROGRAMS ${tcl_SCRIPTS} standard_examples.in + install(PROGRAMS ${tcl_SCRIPTS} standard_examples.in DESTINATION ${DATA_DIR}/examples/tcl ) Added: trunk/examples/tcl/x00 =================================================================== --- trunk/examples/tcl/x00 (rev 0) +++ trunk/examples/tcl/x00 2012-02-19 10:37:10 UTC (rev 12169) @@ -0,0 +1,22 @@ +#!/bin/sh +#--------------------------------*- Tcl -*------------------------------------# +# $Id: x01 11045 2010-05-31 19:46:51Z airwin $ +# +# Maurice LeBrun +# 12/24/02 +# +# A front-end to x00.tcl for running directly from the command line, locating +# pltcl via PATH. +# Handles all usual plplot command arguments. See "pltcl -h" for info. +#-----------------------------------------------------------------------------# +#\ +exec pltcl -f "$0" ${1+"$@"} + +source x00.tcl + +plgver ver +puts [format "PLplot library version: %s" $ver ] + +plinit +x00 +plend Added: trunk/examples/tcl/x00.tcl =================================================================== --- trunk/examples/tcl/x00.tcl (rev 0) +++ trunk/examples/tcl/x00.tcl 2012-02-19 10:37:10 UTC (rev 12169) @@ -0,0 +1,30 @@ +#---------------------------------------------------------------------------- +# $Id: x00.tcl 11572 2011-02-21 07:39:43Z arjenmarkus $ +#---------------------------------------------------------------------------- + +# Simple demo of 2D line plot. + +proc x00 {{w loopback}} { + + set xmin 0.0 + set xmax 1.0 + set ymin 0.0 + set ymax 100.0 + + set nsize 101 + matrix x f $nsize + matrix y f $nsize + + for {set i 0} {$i < $nsize} {incr i} { + set xi [expr {$i / double($nsize - 1)}] + x $i = $xi + y $i = [expr {$ymax * $xi * $xi}] + } + + # Create a labelled box to hold the plot + $w cmd plenv $xmin $xmax $ymin $ymax 0 0 + $w cmd pllab "x" "y=100 x#u2#d" "Simple PLplot demo of a 2D line plot" + + # Plot the data that was prepared above + $w cmd plline $nsize x y +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2012-02-19 18:18:26
|
Revision: 12172 http://plplot.svn.sourceforge.net/plplot/?rev=12172&view=rev Author: airwin Date: 2012-02-19 18:18:19 +0000 (Sun, 19 Feb 2012) Log Message: ----------- Add correct properties for recently added files. Modified Paths: -------------- trunk/examples/f95/x00f.f90 trunk/examples/tcl/x00 trunk/examples/tcl/x00.tcl Property Changed: ---------------- trunk/examples/f95/x00f.f90 trunk/examples/tcl/x00 trunk/examples/tcl/x00.tcl Modified: trunk/examples/f95/x00f.f90 =================================================================== --- trunk/examples/f95/x00f.f90 2012-02-19 11:36:16 UTC (rev 12171) +++ trunk/examples/f95/x00f.f90 2012-02-19 18:18:19 UTC (rev 12172) @@ -1,59 +1,59 @@ -! $Id: x00c.c 12001 2011-10-27 05:26:31Z airwin $ -! -! Simple demo of a 2D line plot. -! -! Copyright (C) 2011 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 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 - -program x00f95 - use plf95demolib - - integer, parameter :: NSIZE = 101 - - real(kind=plflt), dimension(NSIZE) :: x, y - - real(kind=plflt) :: xmin = 0._plflt, xmax = 1._plflt, ymin = 0._plflt, ymax = 100._plflt - integer :: i - - ! Prepare data to be plotted. - x = arange(0, NSIZE) / real(NSIZE-1,plflt) - y = ymax * x**2 - - ! Or alternatively, using a DO-loop - !do i = 1,NSIZE - ! x(i) = real( i - 1, plflt ) / real( NSIZE - 1, plflt ) - ! y(i) = ymax * x(i)**2 - !enddo - - ! Parse and process command line arguments - call plparseopts( PL_PARSE_FULL ) - - ! Initialize plplot - call plinit - - ! Create a labelled box to hold the plot. - call plenv( xmin, xmax, ymin, ymax, 0, 0 ) - call pllab( "x", "y=100 x#u2#d", "Simple PLplot demo of a 2D line plot" ) - - ! Plot the data that was prepared above. - call plline( x, y ) - - ! Close PLplot library - call plend - -end program x00f95 +! $Id$ +! +! Simple demo of a 2D line plot. +! +! Copyright (C) 2011 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 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 + +program x00f95 + use plf95demolib + + integer, parameter :: NSIZE = 101 + + real(kind=plflt), dimension(NSIZE) :: x, y + + real(kind=plflt) :: xmin = 0._plflt, xmax = 1._plflt, ymin = 0._plflt, ymax = 100._plflt + integer :: i + + ! Prepare data to be plotted. + x = arange(0, NSIZE) / real(NSIZE-1,plflt) + y = ymax * x**2 + + ! Or alternatively, using a DO-loop + !do i = 1,NSIZE + ! x(i) = real( i - 1, plflt ) / real( NSIZE - 1, plflt ) + ! y(i) = ymax * x(i)**2 + !enddo + + ! Parse and process command line arguments + call plparseopts( PL_PARSE_FULL ) + + ! Initialize plplot + call plinit + + ! Create a labelled box to hold the plot. + call plenv( xmin, xmax, ymin, ymax, 0, 0 ) + call pllab( "x", "y=100 x#u2#d", "Simple PLplot demo of a 2D line plot" ) + + ! Plot the data that was prepared above. + call plline( x, y ) + + ! Close PLplot library + call plend + +end program x00f95 Property changes on: trunk/examples/f95/x00f.f90 ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/examples/tcl/x00 =================================================================== --- trunk/examples/tcl/x00 2012-02-19 11:36:16 UTC (rev 12171) +++ trunk/examples/tcl/x00 2012-02-19 18:18:19 UTC (rev 12172) @@ -1,22 +1,22 @@ -#!/bin/sh -#--------------------------------*- Tcl -*------------------------------------# -# $Id: x01 11045 2010-05-31 19:46:51Z airwin $ -# -# Maurice LeBrun -# 12/24/02 -# -# A front-end to x00.tcl for running directly from the command line, locating -# pltcl via PATH. -# Handles all usual plplot command arguments. See "pltcl -h" for info. -#-----------------------------------------------------------------------------# -#\ -exec pltcl -f "$0" ${1+"$@"} - -source x00.tcl - -plgver ver -puts [format "PLplot library version: %s" $ver ] - -plinit -x00 -plend +#!/bin/sh +#--------------------------------*- Tcl -*------------------------------------# +# $Id$ +# +# Maurice LeBrun +# 12/24/02 +# +# A front-end to x00.tcl for running directly from the command line, locating +# pltcl via PATH. +# Handles all usual plplot command arguments. See "pltcl -h" for info. +#-----------------------------------------------------------------------------# +#\ +exec pltcl -f "$0" ${1+"$@"} + +source x00.tcl + +plgver ver +puts [format "PLplot library version: %s" $ver ] + +plinit +x00 +plend Property changes on: trunk/examples/tcl/x00 ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/examples/tcl/x00.tcl =================================================================== --- trunk/examples/tcl/x00.tcl 2012-02-19 11:36:16 UTC (rev 12171) +++ trunk/examples/tcl/x00.tcl 2012-02-19 18:18:19 UTC (rev 12172) @@ -1,30 +1,30 @@ -#---------------------------------------------------------------------------- -# $Id: x00.tcl 11572 2011-02-21 07:39:43Z arjenmarkus $ -#---------------------------------------------------------------------------- - -# Simple demo of 2D line plot. - -proc x00 {{w loopback}} { - - set xmin 0.0 - set xmax 1.0 - set ymin 0.0 - set ymax 100.0 - - set nsize 101 - matrix x f $nsize - matrix y f $nsize - - for {set i 0} {$i < $nsize} {incr i} { - set xi [expr {$i / double($nsize - 1)}] - x $i = $xi - y $i = [expr {$ymax * $xi * $xi}] - } - - # Create a labelled box to hold the plot - $w cmd plenv $xmin $xmax $ymin $ymax 0 0 - $w cmd pllab "x" "y=100 x#u2#d" "Simple PLplot demo of a 2D line plot" - - # Plot the data that was prepared above - $w cmd plline $nsize x y -} +#---------------------------------------------------------------------------- +# $Id$ +#---------------------------------------------------------------------------- + +# Simple demo of 2D line plot. + +proc x00 {{w loopback}} { + + set xmin 0.0 + set xmax 1.0 + set ymin 0.0 + set ymax 100.0 + + set nsize 101 + matrix x f $nsize + matrix y f $nsize + + for {set i 0} {$i < $nsize} {incr i} { + set xi [expr {$i / double($nsize - 1)}] + x $i = $xi + y $i = [expr {$ymax * $xi * $xi}] + } + + # Create a labelled box to hold the plot + $w cmd plenv $xmin $xmax $ymin $ymax 0 0 + $w cmd pllab "x" "y=100 x#u2#d" "Simple PLplot demo of a 2D line plot" + + # Plot the data that was prepared above + $w cmd plline $nsize x y +} Property changes on: trunk/examples/tcl/x00.tcl ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2012-02-19 18:31:02
|
Revision: 12173 http://plplot.svn.sourceforge.net/plplot/?rev=12173&view=rev Author: airwin Date: 2012-02-19 18:30:56 +0000 (Sun, 19 Feb 2012) Log Message: ----------- Update copyright. Modified Paths: -------------- trunk/examples/f95/CMakeLists.txt trunk/examples/tcl/CMakeLists.txt Modified: trunk/examples/f95/CMakeLists.txt =================================================================== --- trunk/examples/f95/CMakeLists.txt 2012-02-19 18:18:19 UTC (rev 12172) +++ trunk/examples/f95/CMakeLists.txt 2012-02-19 18:30:56 UTC (rev 12173) @@ -1,7 +1,7 @@ # examples/f95/CMakeLists.txt ### Process this file with cmake to produce Makefile ### -# Copyright (C) 2006, 2007, 2008, 2009 Alan W. Irwin +# Copyright (C) 2006-2012 Alan W. Irwin # # This file is part of PLplot. # Modified: trunk/examples/tcl/CMakeLists.txt =================================================================== --- trunk/examples/tcl/CMakeLists.txt 2012-02-19 18:18:19 UTC (rev 12172) +++ trunk/examples/tcl/CMakeLists.txt 2012-02-19 18:30:56 UTC (rev 12173) @@ -1,7 +1,7 @@ # examples/tcl/CMakeLists.txt ### Process this file with cmake to produce Makefile ### -# Copyright (C) 2006 Alan W. Irwin +# Copyright (C) 2006-2012 Alan W. Irwin # # This file is part of PLplot. # This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2012-02-24 20:33:46
|
Revision: 12176 http://plplot.svn.sourceforge.net/plplot/?rev=12176&view=rev Author: andrewross Date: 2012-02-24 20:33:39 +0000 (Fri, 24 Feb 2012) Log Message: ----------- Clean up the last few of my email address in the examples. Modified Paths: -------------- trunk/examples/c/x22c.c trunk/examples/c++/README.c++demos trunk/examples/c++/x01.cc trunk/examples/c++/x03.cc trunk/examples/c++/x05.cc trunk/examples/c++/x06.cc trunk/examples/c++/x07.cc trunk/examples/c++/x08.cc trunk/examples/c++/x09.cc trunk/examples/c++/x10.cc trunk/examples/c++/x11.cc trunk/examples/c++/x12.cc trunk/examples/c++/x13.cc trunk/examples/c++/x14.cc trunk/examples/c++/x15.cc trunk/examples/c++/x16.cc trunk/examples/c++/x17.cc trunk/examples/c++/x19.cc trunk/examples/c++/x20.cc trunk/examples/c++/x21.cc trunk/examples/c++/x22.cc trunk/examples/java/x17.java trunk/examples/ocaml/x22.ml Modified: trunk/examples/c/x22c.c =================================================================== --- trunk/examples/c/x22c.c 2012-02-23 19:41:00 UTC (rev 12175) +++ trunk/examples/c/x22c.c 2012-02-24 20:33:39 UTC (rev 12176) @@ -1,7 +1,7 @@ // $Id$ // // Simple vector plot example -// Copyright (C) 2004 Andrew Ross <and...@us...> +// Copyright (C) 2004 Andrew Ross // Copyright (C) 2004 Rafael Laboissiere // // Modified: trunk/examples/c++/README.c++demos =================================================================== --- trunk/examples/c++/README.c++demos 2012-02-23 19:41:00 UTC (rev 12175) +++ trunk/examples/c++/README.c++demos 2012-02-24 20:33:39 UTC (rev 12176) @@ -14,5 +14,5 @@ If you encounter any other problems please report them. -Andrew Ross <and...@us...> +Andrew Ross March 2004. Modified: trunk/examples/c++/x01.cc =================================================================== --- trunk/examples/c++/x01.cc 2012-02-23 19:41:00 UTC (rev 12175) +++ trunk/examples/c++/x01.cc 2012-02-24 20:33:39 UTC (rev 12176) @@ -3,7 +3,7 @@ //-------------------------------------------------------------------------- // //-------------------------------------------------------------------------- -// Copyright (C) 2004 Andrew Ross <an...@co...> +// Copyright (C) 2004 Andrew Ross // Copyright (C) 2004 Alan W. Irwin // // This file is part of PLplot. Modified: trunk/examples/c++/x03.cc =================================================================== --- trunk/examples/c++/x03.cc 2012-02-23 19:41:00 UTC (rev 12175) +++ trunk/examples/c++/x03.cc 2012-02-24 20:33:39 UTC (rev 12176) @@ -3,7 +3,7 @@ //-------------------------------------------------------------------------- // //-------------------------------------------------------------------------- -// Copyright (C) 2004 Andrew Ross <an...@co...> +// Copyright (C) 2004 Andrew Ross // Copyright (C) 2004 Alan W. Irwin // // This file is part of PLplot. Modified: trunk/examples/c++/x05.cc =================================================================== --- trunk/examples/c++/x05.cc 2012-02-23 19:41:00 UTC (rev 12175) +++ trunk/examples/c++/x05.cc 2012-02-24 20:33:39 UTC (rev 12176) @@ -3,7 +3,7 @@ //-------------------------------------------------------------------------- // //-------------------------------------------------------------------------- -// Copyright (C) 2004 Andrew Ross <an...@co...> +// Copyright (C) 2004 Andrew Ross // Copyright (C) 2004 Alan W. Irwin // // This file is part of PLplot. Modified: trunk/examples/c++/x06.cc =================================================================== --- trunk/examples/c++/x06.cc 2012-02-23 19:41:00 UTC (rev 12175) +++ trunk/examples/c++/x06.cc 2012-02-24 20:33:39 UTC (rev 12176) @@ -3,7 +3,7 @@ //-------------------------------------------------------------------------- // //-------------------------------------------------------------------------- -// Copyright (C) 2004 Andrew Ross <an...@co...> +// Copyright (C) 2004 Andrew Ross // Copyright (C) 2004 Alan W. Irwin // // This file is part of PLplot. Modified: trunk/examples/c++/x07.cc =================================================================== --- trunk/examples/c++/x07.cc 2012-02-23 19:41:00 UTC (rev 12175) +++ trunk/examples/c++/x07.cc 2012-02-24 20:33:39 UTC (rev 12176) @@ -3,7 +3,7 @@ //-------------------------------------------------------------------------- // //-------------------------------------------------------------------------- -// Copyright (C) 2004 Andrew Ross <an...@co...> +// Copyright (C) 2004 Andrew Ross // Copyright (C) 2004 Alan W. Irwin // // This file is part of PLplot. Modified: trunk/examples/c++/x08.cc =================================================================== --- trunk/examples/c++/x08.cc 2012-02-23 19:41:00 UTC (rev 12175) +++ trunk/examples/c++/x08.cc 2012-02-24 20:33:39 UTC (rev 12176) @@ -3,7 +3,7 @@ //-------------------------------------------------------------------------- // //-------------------------------------------------------------------------- -// Copyright (C) 2004 Andrew Ross <an...@co...> +// Copyright (C) 2004 Andrew Ross // Copyright (C) 2004 Alan W. Irwin // // This file is part of PLplot. Modified: trunk/examples/c++/x09.cc =================================================================== --- trunk/examples/c++/x09.cc 2012-02-23 19:41:00 UTC (rev 12175) +++ trunk/examples/c++/x09.cc 2012-02-24 20:33:39 UTC (rev 12176) @@ -3,7 +3,7 @@ //-------------------------------------------------------------------------- // //-------------------------------------------------------------------------- -// Copyright (C) 2004 Andrew Ross <an...@co...> +// Copyright (C) 2004 Andrew Ross // Copyright (C) 2004 Alan W. Irwin // // This file is part of PLplot. Modified: trunk/examples/c++/x10.cc =================================================================== --- trunk/examples/c++/x10.cc 2012-02-23 19:41:00 UTC (rev 12175) +++ trunk/examples/c++/x10.cc 2012-02-24 20:33:39 UTC (rev 12176) @@ -3,7 +3,7 @@ //-------------------------------------------------------------------------- // //-------------------------------------------------------------------------- -// Copyright (C) 2004 Andrew Ross <an...@co...> +// Copyright (C) 2004 Andrew Ross // Copyright (C) 2004 Alan W. Irwin // // This file is part of PLplot. Modified: trunk/examples/c++/x11.cc =================================================================== --- trunk/examples/c++/x11.cc 2012-02-23 19:41:00 UTC (rev 12175) +++ trunk/examples/c++/x11.cc 2012-02-24 20:33:39 UTC (rev 12176) @@ -3,7 +3,7 @@ //-------------------------------------------------------------------------- // //-------------------------------------------------------------------------- -// Copyright (C) 2004 Andrew Ross <an...@co...> +// Copyright (C) 2004 Andrew Ross // Copyright (C) 2004 Alan W. Irwin // // This file is part of PLplot. Modified: trunk/examples/c++/x12.cc =================================================================== --- trunk/examples/c++/x12.cc 2012-02-23 19:41:00 UTC (rev 12175) +++ trunk/examples/c++/x12.cc 2012-02-24 20:33:39 UTC (rev 12176) @@ -3,7 +3,7 @@ //-------------------------------------------------------------------------- // //-------------------------------------------------------------------------- -// Copyright (C) 2004 Andrew Ross <an...@co...> +// Copyright (C) 2004 Andrew Ross // Copyright (C) 2004 Alan W. Irwin // // This file is part of PLplot. Modified: trunk/examples/c++/x13.cc =================================================================== --- trunk/examples/c++/x13.cc 2012-02-23 19:41:00 UTC (rev 12175) +++ trunk/examples/c++/x13.cc 2012-02-24 20:33:39 UTC (rev 12176) @@ -3,7 +3,7 @@ //-------------------------------------------------------------------------- // //-------------------------------------------------------------------------- -// Copyright (C) 2004 Andrew Ross <an...@co...> +// Copyright (C) 2004 Andrew Ross // Copyright (C) 2004 Alan W. Irwin // // This file is part of PLplot. Modified: trunk/examples/c++/x14.cc =================================================================== --- trunk/examples/c++/x14.cc 2012-02-23 19:41:00 UTC (rev 12175) +++ trunk/examples/c++/x14.cc 2012-02-24 20:33:39 UTC (rev 12176) @@ -3,7 +3,7 @@ //-------------------------------------------------------------------------- // //-------------------------------------------------------------------------- -// Copyright (C) 2004 Andrew Ross <an...@co...> +// Copyright (C) 2004 Andrew Ross // Copyright (C) 2004 Alan W. Irwin // // This file is part of PLplot. Modified: trunk/examples/c++/x15.cc =================================================================== --- trunk/examples/c++/x15.cc 2012-02-23 19:41:00 UTC (rev 12175) +++ trunk/examples/c++/x15.cc 2012-02-24 20:33:39 UTC (rev 12176) @@ -3,7 +3,7 @@ //-------------------------------------------------------------------------- // //-------------------------------------------------------------------------- -// Copyright (C) 2004 Andrew Ross <an...@co...> +// Copyright (C) 2004 Andrew Ross // Copyright (C) 2004 Alan W. Irwin // // This file is part of PLplot. Modified: trunk/examples/c++/x16.cc =================================================================== --- trunk/examples/c++/x16.cc 2012-02-23 19:41:00 UTC (rev 12175) +++ trunk/examples/c++/x16.cc 2012-02-24 20:33:39 UTC (rev 12176) @@ -3,7 +3,7 @@ //-------------------------------------------------------------------------- // //-------------------------------------------------------------------------- -// Copyright (C) 2004 Andrew Ross <an...@co...> +// Copyright (C) 2004 Andrew Ross // Copyright (C) 2004 Alan W. Irwin // // This file is part of PLplot. Modified: trunk/examples/c++/x17.cc =================================================================== --- trunk/examples/c++/x17.cc 2012-02-23 19:41:00 UTC (rev 12175) +++ trunk/examples/c++/x17.cc 2012-02-24 20:33:39 UTC (rev 12176) @@ -3,7 +3,7 @@ //-------------------------------------------------------------------------- // //-------------------------------------------------------------------------- -// Copyright (C) 2004 Andrew Ross <an...@co...> +// Copyright (C) 2004 Andrew Ross // Copyright (C) 2004 Alan W. Irwin // // This file is part of PLplot. Modified: trunk/examples/c++/x19.cc =================================================================== --- trunk/examples/c++/x19.cc 2012-02-23 19:41:00 UTC (rev 12175) +++ trunk/examples/c++/x19.cc 2012-02-24 20:33:39 UTC (rev 12176) @@ -3,7 +3,7 @@ //-------------------------------------------------------------------------- // //-------------------------------------------------------------------------- -// Copyright (C) 2004 Andrew Ross <an...@co...> +// Copyright (C) 2004 Andrew Ross // Copyright (C) 2004 Alan W. Irwin // // This file is part of PLplot. Modified: trunk/examples/c++/x20.cc =================================================================== --- trunk/examples/c++/x20.cc 2012-02-23 19:41:00 UTC (rev 12175) +++ trunk/examples/c++/x20.cc 2012-02-24 20:33:39 UTC (rev 12176) @@ -3,7 +3,7 @@ //-------------------------------------------------------------------------- // //-------------------------------------------------------------------------- -// Copyright (C) 2004 Andrew Ross <an...@co...> +// Copyright (C) 2004 Andrew Ross // Copyright (C) 2004 Alan W. Irwin // // This file is part of PLplot. Modified: trunk/examples/c++/x21.cc =================================================================== --- trunk/examples/c++/x21.cc 2012-02-23 19:41:00 UTC (rev 12175) +++ trunk/examples/c++/x21.cc 2012-02-24 20:33:39 UTC (rev 12176) @@ -3,7 +3,7 @@ //-------------------------------------------------------------------------- // //-------------------------------------------------------------------------- -// Copyright (C) 2004 Andrew Ross <an...@co...> +// Copyright (C) 2004 Andrew Ross // Copyright (C) 2004 Alan W. Irwin // // This file is part of PLplot. Modified: trunk/examples/c++/x22.cc =================================================================== --- trunk/examples/c++/x22.cc 2012-02-23 19:41:00 UTC (rev 12175) +++ trunk/examples/c++/x22.cc 2012-02-24 20:33:39 UTC (rev 12176) @@ -4,7 +4,7 @@ //-------------------------------------------------------------------------- // //-------------------------------------------------------------------------- -// Copyright (C) 2004 Andrew Ross <and...@us...> +// Copyright (C) 2004 Andrew Ross // // This file is part of PLplot. // Modified: trunk/examples/java/x17.java =================================================================== --- trunk/examples/java/x17.java 2012-02-23 19:41:00 UTC (rev 12175) +++ trunk/examples/java/x17.java 2012-02-24 20:33:39 UTC (rev 12176) @@ -3,7 +3,7 @@ //-------------------------------------------------------------------------- // //-------------------------------------------------------------------------- -// Copyright (C) 2004 Andrew Ross <an...@co...> +// Copyright (C) 2004 Andrew Ross // Copyright (C) 2004 Alan W. Irwin // // This file is part of PLplot. Modified: trunk/examples/ocaml/x22.ml =================================================================== --- trunk/examples/ocaml/x22.ml 2012-02-23 19:41:00 UTC (rev 12175) +++ trunk/examples/ocaml/x22.ml 2012-02-24 20:33:39 UTC (rev 12176) @@ -1,7 +1,7 @@ (* $Id$ Simple vector plot example - Copyright (C) 2004 Andrew Ross <and...@us...> + Copyright (C) 2004 Andrew Ross Copyright (C) 2004 Rafael Laboissiere Copyright (C) 2008 Hezekiah M. Carty This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2012-02-24 23:15:26
|
Revision: 12178 http://plplot.svn.sourceforge.net/plplot/?rev=12178&view=rev Author: andrewross Date: 2012-02-24 23:15:19 +0000 (Fri, 24 Feb 2012) Log Message: ----------- Fix up Id tags and copyright in example 00. Modified Paths: -------------- trunk/examples/c++/x00.cc trunk/examples/d/x00d.d trunk/examples/java/x00.java trunk/examples/ocaml/x00.ml trunk/examples/octave/x00c.m trunk/examples/python/x00 Added Paths: ----------- trunk/examples/lua/x00.lua Modified: trunk/examples/c++/x00.cc =================================================================== --- trunk/examples/c++/x00.cc 2012-02-24 23:07:11 UTC (rev 12177) +++ trunk/examples/c++/x00.cc 2012-02-24 23:15:19 UTC (rev 12178) @@ -1,4 +1,4 @@ -// $Id:$ +// $Id$ // // Simple demo of a 2D line plot. // Modified: trunk/examples/d/x00d.d =================================================================== --- trunk/examples/d/x00d.d 2012-02-24 23:07:11 UTC (rev 12177) +++ trunk/examples/d/x00d.d 2012-02-24 23:15:19 UTC (rev 12178) @@ -1,4 +1,4 @@ -// $Id:$ +// $Id$ // // Simple demo of a 2D line plot. // Modified: trunk/examples/java/x00.java =================================================================== --- trunk/examples/java/x00.java 2012-02-24 23:07:11 UTC (rev 12177) +++ trunk/examples/java/x00.java 2012-02-24 23:15:19 UTC (rev 12178) @@ -1,4 +1,4 @@ -// $Id:$ +// $Id$ // // Simple demo of a 2D line plot. // Added: trunk/examples/lua/x00.lua =================================================================== --- trunk/examples/lua/x00.lua (rev 0) +++ trunk/examples/lua/x00.lua 2012-02-24 23:15:19 UTC (rev 12178) @@ -0,0 +1,58 @@ +--[[ $Id$ + + Simple demo of a 2D line plot. + + Copyright (C) 2011 Alan W. Irwin + Copyright (C) 2012 Andrew Ross + + 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 +--]] + +-- initialise Lua bindings for PLplot examples. +dofile("plplot_examples.lua") + + +-- Variables and data arrays used by +NSIZE = 101 +x = {} +y = {} +xmin = 0. +xmax = 1. +ymin = 0. +ymax = 100. + +-- Prepare data to be plotted. +for i = 1, NSIZE do + x[i] = ( i - 1 ) / ( NSIZE - 1 ) + y[i] = ymax * x[i]^2 +end + +-- Parse and process command line arguments +pl.parseopts( arg, pl.PL_PARSE_FULL ) + +-- Initialize plplot +pl.init() + +-- Create a labelled box to hold the plot. +pl.env( xmin, xmax, ymin, ymax, 0, 0 ) +pl.lab( "x", "y=100 x#u2#d", "Simple PLplot demo of a 2D line plot" ) + +-- Plot the data that was prepared above. +pl.line( x, y ) + +-- Close PLplot library +pl.plend() Modified: trunk/examples/ocaml/x00.ml =================================================================== --- trunk/examples/ocaml/x00.ml 2012-02-24 23:07:11 UTC (rev 12177) +++ trunk/examples/ocaml/x00.ml 2012-02-24 23:15:19 UTC (rev 12178) @@ -1,8 +1,9 @@ -(* $Id:$ +(* $Id$ Simple demo of a 2D line plot. Copyright (C) 2011 Alan W. Irwin + Copyright (C) 2012 Andrew Ross This file is part of PLplot. Modified: trunk/examples/octave/x00c.m =================================================================== --- trunk/examples/octave/x00c.m 2012-02-24 23:07:11 UTC (rev 12177) +++ trunk/examples/octave/x00c.m 2012-02-24 23:15:19 UTC (rev 12178) @@ -1,4 +1,4 @@ -## $Id: x00c.c 12001 2011-10-27 05:26:31Z airwin $ +## $Id$ ## ## Simple demo of a 2D line plot. ## Modified: trunk/examples/python/x00 =================================================================== --- trunk/examples/python/x00 2012-02-24 23:07:11 UTC (rev 12177) +++ trunk/examples/python/x00 2012-02-24 23:15:19 UTC (rev 12178) @@ -1,7 +1,6 @@ #!/usr/bin/env python -# Copyright (C) 2004 Alan W. Irwin -# Copyright (C) 2004 Andrew Ross +# Copyright (C) 2012 Andrew Ross # # This file is part of PLplot. # This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2012-02-24 23:24:57
|
Revision: 12179 http://plplot.svn.sourceforge.net/plplot/?rev=12179&view=rev Author: andrewross Date: 2012-02-24 23:24:50 +0000 (Fri, 24 Feb 2012) Log Message: ----------- Fix properties for new files. Modified Paths: -------------- trunk/examples/python/xw00.py Property Changed: ---------------- trunk/examples/c++/x00.cc trunk/examples/d/x00d.d trunk/examples/java/x00.java trunk/examples/lua/x00.lua trunk/examples/ocaml/x00.ml trunk/examples/octave/x00c.m trunk/examples/python/x00 trunk/examples/python/xw00.py Property changes on: trunk/examples/c++/x00.cc ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Property changes on: trunk/examples/d/x00d.d ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Property changes on: trunk/examples/java/x00.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Property changes on: trunk/examples/lua/x00.lua ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Property changes on: trunk/examples/ocaml/x00.ml ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Property changes on: trunk/examples/octave/x00c.m ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Property changes on: trunk/examples/python/x00 ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/examples/python/xw00.py =================================================================== --- trunk/examples/python/xw00.py 2012-02-24 23:15:19 UTC (rev 12178) +++ trunk/examples/python/xw00.py 2012-02-24 23:24:50 UTC (rev 12179) @@ -1,4 +1,4 @@ -# $Id:$ +# $Id$ # # Simple demo of a 2D line plot. # Property changes on: trunk/examples/python/xw00.py ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2012-08-13 21:30:07
|
Revision: 12209 http://plplot.svn.sourceforge.net/plplot/?rev=12209&view=rev Author: andrewross Date: 2012-08-13 21:29:59 +0000 (Mon, 13 Aug 2012) Log Message: ----------- Fix off-by-one error calculating maximum size for strncat. Fixes warning when building with hardening flags on Debian. Modified Paths: -------------- trunk/examples/c/x29c.c trunk/examples/c++/x29.cc Modified: trunk/examples/c/x29c.c =================================================================== --- trunk/examples/c/x29c.c 2012-08-13 21:25:25 UTC (rev 12208) +++ trunk/examples/c/x29c.c 2012-08-13 21:29:59 UTC (rev 12209) @@ -365,7 +365,7 @@ plbox( "bcnstd", xlabel_step, 0, "bcnstv", 0., 0 ); plcol0( 3 ); strncpy( title, "@frPLplot Example 29 - TAI-UTC ", 100 ); - strncat( title, title_suffix, 100 - strlen( title ) ); + strncat( title, title_suffix, 100 - strlen( title ) ); pllab( xtitle, "TAI-UTC (sec)", title ); plcol0( 4 ); Modified: trunk/examples/c++/x29.cc =================================================================== --- trunk/examples/c++/x29.cc 2012-08-13 21:25:25 UTC (rev 12208) +++ trunk/examples/c++/x29.cc 2012-08-13 21:29:59 UTC (rev 12209) @@ -375,7 +375,7 @@ pls->box( "bcnstd", xlabel_step, 0, "bcnstv", 0., 0 ); pls->col0( 3 ); strncpy( title, "@frPLplot Example 29 - TAI-UTC ", 100 ); - strncat( title, title_suffix, 100 - strlen( title ) ); + strncat( title, title_suffix, 100 - strlen( title ) - 1 ); pls->lab( xtitle, "TAI-UTC (sec)", title ); pls->col0( 4 ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-04-24 20:36:31
|
Revision: 12306 http://sourceforge.net/p/plplot/code/12306 Author: airwin Date: 2013-04-24 20:36:28 +0000 (Wed, 24 Apr 2013) Log Message: ----------- Add required build of example x00 for the traditional build-tree tests for several different bindings. Modified Paths: -------------- trunk/examples/ada/Makefile.examples.in trunk/examples/c++/Makefile.examples.in trunk/examples/d/Makefile.examples.in trunk/examples/f77/Makefile.examples.in trunk/examples/java/Makefile.examples.in trunk/examples/ocaml/Makefile.examples.in Modified: trunk/examples/ada/Makefile.examples.in =================================================================== --- trunk/examples/ada/Makefile.examples.in 2013-04-24 20:13:55 UTC (rev 12305) +++ trunk/examples/ada/Makefile.examples.in 2013-04-24 20:36:28 UTC (rev 12306) @@ -30,6 +30,7 @@ RPATHCMD = @RPATHCMD@ EXECUTABLES_list = \ + x00a$(EXEEXT) \ x01a$(EXEEXT) \ x02a$(EXEEXT) \ x03a$(EXEEXT) \ @@ -62,7 +63,7 @@ x30a$(EXEEXT) \ x31a$(EXEEXT) \ x33a$(EXEEXT) \ - xthick01a$(EXEEXT) \ + xthick00a$(EXEEXT) \ xthick02a$(EXEEXT) \ xthick03a$(EXEEXT) \ xthick04a$(EXEEXT) \ Modified: trunk/examples/c++/Makefile.examples.in =================================================================== --- trunk/examples/c++/Makefile.examples.in 2013-04-24 20:13:55 UTC (rev 12305) +++ trunk/examples/c++/Makefile.examples.in 2013-04-24 20:36:28 UTC (rev 12306) @@ -38,6 +38,7 @@ EXECUTABLES_list = \ x01cc$(EXEEXT) \ + x00$(EXEEXT) \ x01$(EXEEXT) \ x02$(EXEEXT) \ x03$(EXEEXT) \ Modified: trunk/examples/d/Makefile.examples.in =================================================================== --- trunk/examples/d/Makefile.examples.in 2013-04-24 20:13:55 UTC (rev 12305) +++ trunk/examples/d/Makefile.examples.in 2013-04-24 20:36:28 UTC (rev 12306) @@ -27,6 +27,7 @@ RPATHCMD = @RPATHCMD@ EXECUTABLES_list = \ + x00d$(EXEEXT) \ x01d$(EXEEXT) \ x02d$(EXEEXT) \ x03d$(EXEEXT) \ Modified: trunk/examples/f77/Makefile.examples.in =================================================================== --- trunk/examples/f77/Makefile.examples.in 2013-04-24 20:13:55 UTC (rev 12305) +++ trunk/examples/f77/Makefile.examples.in 2013-04-24 20:36:28 UTC (rev 12306) @@ -29,6 +29,7 @@ RPATHCMD = @RPATHCMD@ EXECUTABLES_list = \ + x00f$(EXEEXT) \ x01f$(EXEEXT) \ x02f$(EXEEXT) \ x03f$(EXEEXT) \ Modified: trunk/examples/java/Makefile.examples.in =================================================================== --- trunk/examples/java/Makefile.examples.in 2013-04-24 20:13:55 UTC (rev 12305) +++ trunk/examples/java/Makefile.examples.in 2013-04-24 20:36:28 UTC (rev 12306) @@ -23,6 +23,7 @@ PLPLOT_CLASSPATH = @JAVADATA_HARDDIR@/plplot.jar example_classes = \ + x00.class \ x01.class \ x02.class \ x03.class \ Modified: trunk/examples/ocaml/Makefile.examples.in =================================================================== --- trunk/examples/ocaml/Makefile.examples.in 2013-04-24 20:13:55 UTC (rev 12305) +++ trunk/examples/ocaml/Makefile.examples.in 2013-04-24 20:36:28 UTC (rev 12306) @@ -32,6 +32,7 @@ OCAML_LIBS = $(RPATHCMD) -ccopt "-L@CMAKE_INSTALL_LIBDIR@" plplot.@OCAML_EXAMPLE_LIBEXT@ unix.@OCAML_EXAMPLE_LIBEXT@ EXECUTABLES_list = \ + x00ocaml$(EXEEXT) \ x01ocaml$(EXEEXT) \ x02ocaml$(EXEEXT) \ x03ocaml$(EXEEXT) \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2013-09-26 15:18:41
|
Revision: 12532 http://sourceforge.net/p/plplot/code/12532 Author: andrewross Date: 2013-09-26 15:18:37 +0000 (Thu, 26 Sep 2013) Log Message: ----------- Fix from Phil Rosenberg for the missing land in example 19, propagated to all languages. Also, further small fix to f95 example 19 to get the latitude label length right for the case where it is 0. Modified Paths: -------------- trunk/examples/ada/x19a.adb trunk/examples/ada/xthick19a.adb trunk/examples/c/x19c.c trunk/examples/c++/x19.cc trunk/examples/d/x19d.d trunk/examples/f77/x19f.fm4 trunk/examples/f95/x19f.f90 trunk/examples/java/x19.java trunk/examples/lua/x19.lua trunk/examples/ocaml/x19.ml trunk/examples/octave/x19c.m trunk/examples/perl/x19.pl trunk/examples/python/xw19.py trunk/examples/tcl/x19.tcl Modified: trunk/examples/ada/x19a.adb =================================================================== --- trunk/examples/ada/x19a.adb 2013-09-26 06:44:36 UTC (rev 12531) +++ trunk/examples/ada/x19a.adb 2013-09-26 15:18:37 UTC (rev 12532) @@ -207,8 +207,8 @@ -- Cartesian plots -- Most of world - minx := 190.0; - maxx := 190.0 + 360.0; + minx := -170.0; + maxx := minx + 360.0; -- Setup a custom latitude and longitude-based scaling function. plslabelfunc(geolocation_labeler'Unrestricted_Access, System.Null_Address); Modified: trunk/examples/ada/xthick19a.adb =================================================================== --- trunk/examples/ada/xthick19a.adb 2013-09-26 06:44:36 UTC (rev 12531) +++ trunk/examples/ada/xthick19a.adb 2013-09-26 15:18:37 UTC (rev 12532) @@ -207,8 +207,8 @@ -- Cartesian plots -- Most of world - minx := 190.0; - maxx := 190.0 + 360.0; + minx := -170.0; + maxx := minx + 360.0; -- Setup a custom latitude and longitude-based scaling function. Set_Custom_Label(geolocation_labeler'Unrestricted_Access, System.Null_Address); Modified: trunk/examples/c/x19c.c =================================================================== --- trunk/examples/c/x19c.c 2013-09-26 06:44:36 UTC (rev 12531) +++ trunk/examples/c/x19c.c 2013-09-26 15:18:37 UTC (rev 12532) @@ -142,8 +142,8 @@ // Cartesian plots // Most of world - minx = 190; - maxx = 190 + 360; + minx = -170; + maxx = minx + 360; // Setup a custom latitude and longitude-based scaling function. plslabelfunc( geolocation_labeler, NULL ); Modified: trunk/examples/c++/x19.cc =================================================================== --- trunk/examples/c++/x19.cc 2013-09-26 06:44:36 UTC (rev 12531) +++ trunk/examples/c++/x19.cc 2013-09-26 15:18:37 UTC (rev 12532) @@ -170,8 +170,8 @@ // Cartesian plots // Most of world - minx = 190; - maxx = 190 + 360; + minx = -170; + maxx = minx + 360; // Setup a custom latitude and longitude-based scaling function. pls->slabelfunc( geolocation_labeler, NULL ); Modified: trunk/examples/d/x19d.d =================================================================== --- trunk/examples/d/x19d.d 2013-09-26 06:44:36 UTC (rev 12531) +++ trunk/examples/d/x19d.d 2013-09-26 15:18:37 UTC (rev 12532) @@ -114,8 +114,8 @@ // Cartesian plots // Most of world - PLFLT minx = 190; - PLFLT maxx = 190 + 360; + PLFLT minx = -170; + PLFLT maxx = minx + 360; // Setup a custom latitude and longitude-based scaling function. plslabelfunc( &geolocation_labeler, null ); Modified: trunk/examples/f77/x19f.fm4 =================================================================== --- trunk/examples/f77/x19f.fm4 2013-09-26 06:44:36 UTC (rev 12531) +++ trunk/examples/f77/x19f.fm4 2013-09-26 15:18:37 UTC (rev 12532) @@ -167,8 +167,8 @@ c Cartesian plots c Most of world - minx = 190 - maxx = 190+360 + minx = -170 + maxx = minx+360 c Setup a custom latitude and longitude-based scaling function. call plslabelfunc(geolocation_labeler) Modified: trunk/examples/f95/x19f.f90 =================================================================== --- trunk/examples/f95/x19f.f90 2013-09-26 06:44:36 UTC (rev 12531) +++ trunk/examples/f95/x19f.f90 2013-09-26 15:18:37 UTC (rev 12532) @@ -116,6 +116,8 @@ if (axis .eq. 2 .and. value .eq. 0.0_plflt) then ! A special case for the equator label = direction_label + else if (abs(label_val) .lt. 10.0_plflt) then + write(label,'(I1.1,A2)') iabs(int(label_val)),direction_label else if (abs(label_val) .lt. 100.0_plflt) then write(label,'(I2.1,A2)') iabs(int(label_val)),direction_label else @@ -151,8 +153,8 @@ ! Cartesian plots ! Most of world - minx = 190._plflt - maxx = 190._plflt+360._plflt + minx = -170._plflt + maxx = minx+360._plflt ! Setup a custom latitude and longitude-based scaling function. call plslabelfunc(geolocation_labeler) Modified: trunk/examples/java/x19.java =================================================================== --- trunk/examples/java/x19.java 2013-09-26 06:44:36 UTC (rev 12531) +++ trunk/examples/java/x19.java 2013-09-26 15:18:37 UTC (rev 12532) @@ -169,8 +169,8 @@ // Cartesian plots // Most of world - minx = 190; - maxx = 190 + 360; + minx = -170; + maxx = minx + 360; // Setup a custom latitude and longitude-based scaling function. pls.slabelfunc( geolocation_labeler ); Modified: trunk/examples/lua/x19.lua =================================================================== --- trunk/examples/lua/x19.lua 2013-09-26 06:44:36 UTC (rev 12531) +++ trunk/examples/lua/x19.lua 2013-09-26 15:18:37 UTC (rev 12532) @@ -125,8 +125,8 @@ -- Cartesian plots -- Most of world -minx = 190 -maxx = 190+360 +minx = -170 +maxx = minx+360 -- Setup a custom latitude and longitude-based scaling function. pl.slabelfunc("geolocation_labeler"); Modified: trunk/examples/ocaml/x19.ml =================================================================== --- trunk/examples/ocaml/x19.ml 2013-09-26 06:44:36 UTC (rev 12531) +++ trunk/examples/ocaml/x19.ml 2013-09-26 15:18:37 UTC (rev 12532) @@ -105,8 +105,8 @@ (* Cartesian plots *) (* Most of world *) - let minx = 190.0 in - let maxx = 190.0 +. 360.0 in + let minx = -170.0 in + let maxx = minx +. 360.0 in (* Setup a custom latitude and longitude-based scaling function. *) plslabelfunc geolocation_labeler; Modified: trunk/examples/octave/x19c.m =================================================================== --- trunk/examples/octave/x19c.m 2013-09-26 06:44:36 UTC (rev 12531) +++ trunk/examples/octave/x19c.m 2013-09-26 15:18:37 UTC (rev 12532) @@ -32,8 +32,8 @@ ## Cartesian plots ## Most of world - minx = 190; - maxx = 190 + 360; + minx = -170; + maxx = minx + 360; ## Setup a custom latitude and longitude-based scaling function. plslabelfunc( @geolocation_labeler, [] ); Modified: trunk/examples/perl/x19.pl =================================================================== --- trunk/examples/perl/x19.pl 2013-09-26 06:44:36 UTC (rev 12531) +++ trunk/examples/perl/x19.pl 2013-09-26 15:18:37 UTC (rev 12532) @@ -48,8 +48,8 @@ # Cartesian plots # Most of world -my $minx = 190; -my $maxx = 190 + 360; +my $minx = -170; +my $maxx = $minx + 360; # Setup a custom latitude and longitude-based scaling function. plslabelfunc(\&geolocation_labeler); Modified: trunk/examples/python/xw19.py =================================================================== --- trunk/examples/python/xw19.py 2013-09-26 06:44:36 UTC (rev 12531) +++ trunk/examples/python/xw19.py 2013-09-26 15:18:37 UTC (rev 12532) @@ -100,8 +100,8 @@ # Cartesian plots # Most of world - minx = 190 - maxx = 190+360 + minx = -170 + maxx = minx+360 # Setup a custom latitude and longitude-based scaling function. plslabelfunc(geolocation_labeler, None) Modified: trunk/examples/tcl/x19.tcl =================================================================== --- trunk/examples/tcl/x19.tcl 2013-09-26 06:44:36 UTC (rev 12531) +++ trunk/examples/tcl/x19.tcl 2013-09-26 15:18:37 UTC (rev 12532) @@ -113,8 +113,8 @@ # Cartesian plots # Most of the world - set minx 190 - set maxx 550 + set minx -170 + set maxx 190 # Setup a custom latitude and longitude-based scaling function. $w cmd plslabelfunc "geolocation_labeler" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-11-14 19:56:38
|
Revision: 12697 http://sourceforge.net/p/plplot/code/12697 Author: airwin Date: 2013-11-14 19:56:31 +0000 (Thu, 14 Nov 2013) Log Message: ----------- Add the test_tclsh_standard_examples target to automate the tclsh TEA-based testing that is mentioned in examples/tcl/README.tcldemos. Make the test_interactive target depend on this new target so this new test will be done automatically whenever the test_interactive target is run. Tested by Alan W. Irwin <ai...@us...> on Linux using the test_tclsh_standard_examples target in the build tree. I did this from a scratch build to demonstrate that all dependencies of this test were handled correctly. Modified Paths: -------------- trunk/examples/CMakeLists.txt trunk/examples/tcl/CMakeLists.txt Added Paths: ----------- trunk/examples/tcl/tclsh_standard_examples.in Modified: trunk/examples/CMakeLists.txt =================================================================== --- trunk/examples/CMakeLists.txt 2013-11-14 07:54:24 UTC (rev 12696) +++ trunk/examples/CMakeLists.txt 2013-11-14 19:56:31 UTC (rev 12697) @@ -873,19 +873,11 @@ endif(ENABLE_pygcw) if(ENABLE_tcl AND PLD_xwin) - if(CORE_BUILD) - add_custom_target(test_tcl_standard_examples - COMMAND ${CMAKE_CURRENT_BINARY_DIR}/tcl/standard_examples -dev xwin -np - DEPENDS ${xwin_target} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tcl - ) - else(CORE_BUILD) - add_custom_target(test_tcl_standard_examples - COMMAND ${CMAKE_CURRENT_BINARY_DIR}/tcl/standard_examples -dev xwin -np - DEPENDS ${xwin_target} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tcl - ) - endif(CORE_BUILD) + add_custom_target(test_tcl_standard_examples + COMMAND ${CMAKE_CURRENT_BINARY_DIR}/tcl/standard_examples -dev xwin -np + DEPENDS ${xwin_target} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tcl + ) add_dependencies(test_tcl_standard_examples pltcl tcl_examples @@ -897,6 +889,22 @@ endif(FILE_DEPENDS_xwin) list(APPEND interactive_targets_LIST test_tcl_standard_examples) + add_custom_target(test_tclsh_standard_examples + COMMAND ${CMAKE_CURRENT_BINARY_DIR}/tcl/tclsh_standard_examples + DEPENDS ${xwin_target} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tcl + ) + add_dependencies(test_tclsh_standard_examples + pltcl + tcl_examples + tclIndex_tcl + xwin + ) + if(FILE_DEPENDS_xwin) + add_dependencies(test_tclsh_standard_examples test_xwin_dyndriver) + endif(FILE_DEPENDS_xwin) + list(APPEND interactive_targets_LIST test_tclsh_standard_examples) + endif(ENABLE_tcl AND PLD_xwin) if(ENABLE_tk AND PLD_tk) Modified: trunk/examples/tcl/CMakeLists.txt =================================================================== --- trunk/examples/tcl/CMakeLists.txt 2013-11-14 07:54:24 UTC (rev 12696) +++ trunk/examples/tcl/CMakeLists.txt 2013-11-14 19:56:31 UTC (rev 12697) @@ -85,6 +85,21 @@ @ONLY ) +# tclsh_standard_examples is a configured shell script that runs all +# the standard examples under tclsh use a TEA-based approach. +# pkgIndex_LOCATION is the directory where the relevant pkgIndex.tcl +# file is located. +if(CORE_BUILD) + set(pkgIndex_LOCATION ${CMAKE_BINARY_DIR}/bindings/tcl) +else(CORE_BUILD) + set(pkgIndex_LOCATION ${DATA_DIR}) +endif(CORE_BUILD) +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/tclsh_standard_examples.in + ${CMAKE_CURRENT_BINARY_DIR}/tclsh_standard_examples + @ONLY + ) + # Copy file and scripts to the binary directory if different to the # source directory. Needed for ctest, but also so the tclIndex file # is generated in the binary tree not the source tree. @@ -120,7 +135,7 @@ ) install(FILES ${tcl_FILES} DESTINATION ${DATA_DIR}/examples/tcl) - install(PROGRAMS ${tcl_SCRIPTS} standard_examples.in + install(PROGRAMS ${tcl_SCRIPTS} standard_examples.in tclsh_standard_examples.in DESTINATION ${DATA_DIR}/examples/tcl ) Added: trunk/examples/tcl/tclsh_standard_examples.in =================================================================== --- trunk/examples/tcl/tclsh_standard_examples.in (rev 0) +++ trunk/examples/tcl/tclsh_standard_examples.in 2013-11-14 19:56:31 UTC (rev 12697) @@ -0,0 +1,48 @@ +#!@SH_EXECUTABLE@ +# Examples 14 and 31 left out - see Tk standard_examples.in +# Choose the xwin device below (after plinit) +# Note the backslash at the end - this causes Tcl to ignore +# the next line. It becomes a valid Tcl script as well as +# valid shell script +# \ +@TCL_TCLSH@ <<EOF +lappend auto_path @pkgIndex_LOCATION@ +package require Pltcl +source tcldemos.tcl +plsdev "xwin" +plinit +plspause 0 +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +15 +16 +17 +18 +19 +20 +plspause 0 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +33 +exit +EOF Property changes on: trunk/examples/tcl/tclsh_standard_examples.in ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-11-15 01:09:39
|
Revision: 12702 http://sourceforge.net/p/plplot/code/12702 Author: airwin Date: 2013-11-15 01:09:36 +0000 (Fri, 15 Nov 2013) Log Message: ----------- Implement test_wish_standard_examples target that executes all the standard examples using wish and PLplot's TEA capabilities. Make this target a dependency of test_interactive. N.B. For some strange reason the display of the plots is currently getting lost when this script is run non-interactively. That is, if you run the script directly or by mentioning it as an argument for the wish command or if it sourced from an interactive wish environment. However, if you run the commands in this script interactively, i.e. cut and paste the script lines directly into a wish environment, the display of the plots is fine! See the current question on the plplot-devel list about how this issue can be fixed. Nevertheless, despite this issue the current test does work in the sense that all the examples run without any error condition. Modified Paths: -------------- trunk/examples/CMakeLists.txt trunk/examples/tk/CMakeLists.txt trunk/examples/tk/tkdemos.tcl Added Paths: ----------- trunk/examples/tk/wish_standard_examples.in Modified: trunk/examples/CMakeLists.txt =================================================================== --- trunk/examples/CMakeLists.txt 2013-11-15 00:58:19 UTC (rev 12701) +++ trunk/examples/CMakeLists.txt 2013-11-15 01:09:36 UTC (rev 12702) @@ -964,19 +964,11 @@ endif(FILE_DEPENDS_xwin) list(APPEND targets_examples_tk test_tk_plgrid) - if(CORE_BUILD) - add_custom_target(test_tk_standard_examples - COMMAND ${CMAKE_CURRENT_BINARY_DIR}/tk/standard_examples - DEPENDS ${xwin_target} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tk - ) - else(CORE_BUILD) - add_custom_target(test_tk_standard_examples - COMMAND ${CMAKE_CURRENT_BINARY_DIR}/tk/standard_examples - DEPENDS ${xwin_target} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tk - ) - endif(CORE_BUILD) + add_custom_target(test_tk_standard_examples + COMMAND ${CMAKE_CURRENT_BINARY_DIR}/tk/standard_examples + DEPENDS ${xwin_target} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tk + ) add_dependencies(test_tk_standard_examples plserver tcl_examples @@ -990,6 +982,24 @@ endif(FILE_DEPENDS_xwin) list(APPEND targets_examples_tk test_tk_standard_examples) + add_custom_target(test_wish_standard_examples + COMMAND ${CMAKE_CURRENT_BINARY_DIR}/tk/wish_standard_examples + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tk + ) + add_dependencies(test_wish_standard_examples + plplottcltk${LIB_TAG} + tk + # FIXME, the tkwin dependency is part of the horrible hack to + # allow tkdemos.tcl to distinguish between the plserver and wish + # environments. + tkwin + tcl_examples + tclIndex_tcl + tclIndex_tk + tclIndex_examples_tk + ) + list(APPEND targets_examples_tk test_wish_standard_examples) + if(ENABLE_itk) add_custom_target(test_tk_02 COMMAND xtk02 -f ${CMAKE_CURRENT_BINARY_DIR}/tk/tk02 Modified: trunk/examples/tk/CMakeLists.txt =================================================================== --- trunk/examples/tk/CMakeLists.txt 2013-11-15 00:58:19 UTC (rev 12701) +++ trunk/examples/tk/CMakeLists.txt 2013-11-15 01:09:36 UTC (rev 12702) @@ -142,7 +142,7 @@ # standard_examples is a configured shell script that runs all the standard # examples under plserver. -set(tk_SCRIPTS tk01 tk03 plgrid standard_examples) +set(tk_SCRIPTS tk01 tk03 plgrid standard_examples wish_standard_examples) # The second and fourth Tk examples depend on Itk to work. if(ENABLE_itk) list(APPEND tk_SCRIPTS tk02 tk04) @@ -181,6 +181,19 @@ # Provide locations for several tk-related targets that will be used # to configure the tk_SCRIPTS. + + # wish_standard_examples is a configured shell script that runs all + # the standard examples under wish using a TEA-based approach. + # pkgIndex_LOCATION is the directory where the relevant pkgIndex.tcl + # file is located. FIXME! use two directories temporarily as + # part of the horrible hack currently allowing tkdemos to distinguish + # between the plserver and wish environments. + if(CORE_BUILD) + set(pkgIndex_LOCATION "${CMAKE_BINARY_DIR}/bindings/tk-x-plat ${CMAKE_BINARY_DIR}/bindings/tk") + else(CORE_BUILD) + set(pkgIndex_LOCATION ${DATA_DIR}) + endif(CORE_BUILD) + foreach(tk_related_target xtk01 plserver xtk02 xtk04) if(TARGET ${tk_related_target}) get_target_property(${tk_related_target}_LOCATION Modified: trunk/examples/tk/tkdemos.tcl =================================================================== --- trunk/examples/tk/tkdemos.tcl 2013-11-15 00:58:19 UTC (rev 12701) +++ trunk/examples/tk/tkdemos.tcl 2013-11-15 01:09:36 UTC (rev 12702) @@ -74,6 +74,8 @@ proc $i {} " global plwin $demo $plwin + # Disable pausing (currently only does that for the wish version) + $plwin cmd plspause 0 $plwin cmd plcol0 1 $plwin cmd plsori 0 $plwin cmd plspal0 cmap0_default.pal Added: trunk/examples/tk/wish_standard_examples.in =================================================================== --- trunk/examples/tk/wish_standard_examples.in (rev 0) +++ trunk/examples/tk/wish_standard_examples.in 2013-11-15 01:09:36 UTC (rev 12702) @@ -0,0 +1,51 @@ +#!@SH_EXECUTABLE@ +# Run standard examples using wish TEA-based approach. +# Drop examples 14 and 31 because querying for devices does not +# seem to work in this context. +# We use of the wish -colormap new option since it cannot hurt, +# but this does not solve color issues +# for both examples 2 ("Couldn't parse color 76") and 24 ("illegal number of colors in cmap0: red") so we comment out those examples for now. +# Example 20 enables plspause so comment out for now. +# The following exec command reexecutes the script under wish. This +# is possible because all comment lines are ignored by wish including +# continued ones with a trailing backslash like this one \ +exec @TK_WISH@ "$0" "$@" +lappend auto_path @pkgIndex_LOCATION@ +package require Pltk +source tkdemos.tcl +# disable pauses +$plwin cmd plspause 0 +0 +1 +#2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +#14 +15 +16 +17 +18 +19 +#20 +21 +22 +23 +#24 +25 +26 +27 +28 +29 +30 +#31 +33 +exit Property changes on: trunk/examples/tk/wish_standard_examples.in ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-11-16 01:07:19
|
Revision: 12703 http://sourceforge.net/p/plplot/code/12703 Author: airwin Date: 2013-11-16 01:07:16 +0000 (Sat, 16 Nov 2013) Log Message: ----------- Note that "make test_interactive" incorporates almost all (runAllDemos.tcl is the one exception) of these tests that can be run by hand. Drop the FIXME remarks which are about to become irrelevant. Modified Paths: -------------- trunk/examples/tcl/README.tcldemos trunk/examples/tk/README.tkdemos Modified: trunk/examples/tcl/README.tcldemos =================================================================== --- trunk/examples/tcl/README.tcldemos 2013-11-15 01:09:36 UTC (rev 12702) +++ trunk/examples/tcl/README.tcldemos 2013-11-16 01:07:16 UTC (rev 12703) @@ -1,5 +1,15 @@ Running the Tcl Demos. +Note these directions as well as taking proper care of all the +dependencies have been incorporated into our CMake-based build systems +for the core build and the installed examples build. So the tests +below of the Tcl component of PLplot can be done by simply running + +make test_interactive + +However, we preserve the directions below for historical reasons and +in case you want to do any of these commands by hand. + There are two ways to run the examples below, where the alternatives are indicated by "|". The first alternative should only be used if you have changed directories to Modified: trunk/examples/tk/README.tkdemos =================================================================== --- trunk/examples/tk/README.tkdemos 2013-11-15 01:09:36 UTC (rev 12702) +++ trunk/examples/tk/README.tkdemos 2013-11-16 01:07:16 UTC (rev 12703) @@ -1,11 +1,28 @@ Running the Tk Demos. -PLplot doesn't need to be installed to run these demos. -However, different commands might be needed to run the demos when PLplot -is installed or not; in these cases, the first command must be used for -the installed situation, while the second, separated by a '|', is for the -uninstalled situation. +Note these directions (aside from runAllDemos.tcl) as well as taking +proper care of all the dependencies have been incorporated into our +CMake-based build systems for the core build and the installed +examples build. So with the exception of runAllDemos.tcl the tests +below of the Tcl, Tk, Itcl, Itk, and Iwidgets components of PLplot can +be done by simply running +make test_interactive + +However, we preserve the directions below for historical reasons and +in case you want to do any of these commands by hand. + +There are two ways to run the examples below, where the alternatives +are indicated by "|". The first alternative should only be used if +you have changed directories to +$prefix/share/plplot$VERSION/examples/tk where $prefix is the PLplot +install prefix and $VERSION is the PLplot release version, e.g., +5.9.10. (That is, the first alternative should be used if you have +changed directories to the installed tk examples directory.) The +second alternative should only be used if you have changed directories +to bindings/examples/tk in the build tree. + + To run the plot.tcl demo follow the directions in that file to run it under plserver using the plframe widget. @@ -20,16 +37,6 @@ # from "plserver" to "../../bindings/plserver" ./xtk04 -f tk04 -There are two ways to run the examples below, where the alternatives -are indicated by "|". The first alternative should only be used if -you have changed directories to -$prefix/share/plplot$VERSION/examples/tk where $prefix is the PLplot -install prefix and $VERSION is the PLplot release version, e.g., -5.9.10. (That is, the first alternative should be used if you have -changed directories to the installed tk examples directory.) The -second alternative should only be used if you have changed directories -to bindings/examples/tk in the build tree. - (1) Run tkdemos.tcl from plserver. This potentially exercises all the x??.tcl examples using the plframe widget: @@ -45,24 +52,13 @@ (2) Run tkdemos.tcl from wish. wish -geometry 600x400 -lappend auto_path $prefix/share/plplot$VERSION ../../bindings/tk-x-plat ../../bindings/tk +lappend auto_path $prefix/share/plplot$VERSION | ../../bindings/tk package require Pltk source tkdemos.tcl 1 2 .... -FIXME: Note the ../../bindings/tk-x-plat in auto_path is a temporary -measure to support the hacked tkdemos.tcl logic which invokes package -require Plplotter to distinguish between the plserver case (where that -package is not available) and the current wish case (where that -package can be successfully loaded because of ../../bindings/tk-x-plat -in auto_path). - -FIXME: Try examples 10 and 12 which should work. Most of the rest -(e.g., 1, 2,) currently do not work because PLplot library constants -are not available under wish for some unknown reason. - To find out more about the wish command (which comes as part of the Tk package) use man wish. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |