From: <ai...@us...> - 2011-10-27 05:26:38
|
Revision: 12001 http://plplot.svn.sourceforge.net/plplot/?rev=12001&view=rev Author: airwin Date: 2011-10-27 05:26:31 +0000 (Thu, 27 Oct 2011) Log Message: ----------- Implement standard example 00, an extremely simple PLplot demo of a 2D line plot. Modified Paths: -------------- trunk/examples/c/CMakeLists.txt trunk/examples/c/Makefile.examples.in trunk/plplot_test/test_c.sh.in Added Paths: ----------- trunk/examples/c/x00c.c Modified: trunk/examples/c/CMakeLists.txt =================================================================== --- trunk/examples/c/CMakeLists.txt 2011-10-26 22:36:55 UTC (rev 12000) +++ trunk/examples/c/CMakeLists.txt 2011-10-27 05:26:31 UTC (rev 12001) @@ -25,6 +25,7 @@ # BUILD_TEST ON and CORE_BUILD OFF. set(c_STRING_INDICES + "00" "01" "02" "03" Modified: trunk/examples/c/Makefile.examples.in =================================================================== --- trunk/examples/c/Makefile.examples.in 2011-10-26 22:36:55 UTC (rev 12000) +++ trunk/examples/c/Makefile.examples.in 2011-10-27 05:26:31 UTC (rev 12001) @@ -39,6 +39,7 @@ @extcairo_true@@pkg_config_true@ ext-cairo-test$(EXEEXT) EXECUTABLES_list = \ + x00c$(EXEEXT) \ x01c$(EXEEXT) \ x02c$(EXEEXT) \ x03c$(EXEEXT) \ Added: trunk/examples/c/x00c.c =================================================================== --- trunk/examples/c/x00c.c (rev 0) +++ trunk/examples/c/x00c.c 2011-10-27 05:26:31 UTC (rev 12001) @@ -0,0 +1,59 @@ +// $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 +// +// + +#include "plcdemos.h" +#define NSIZE 101 + +int +main( int argc, const char *argv[] ) +{ + PLFLT x[NSIZE], y[NSIZE]; + PLFLT xmin = 0., xmax = 1., ymin = 0., ymax = 100.; + int i; + + // Prepare data to be plotted. + for ( i = 0; i < NSIZE; i++ ) + { + x[i] = (PLFLT) ( i ) / (PLFLT) ( NSIZE - 1 ); + y[i] = ymax * x[i] * x[i]; + } + + // Parse and process command line arguments + plparseopts( &argc, argv, PL_PARSE_FULL ); + + // Initialize plplot + plinit(); + + // Create a labelled box to hold the plot. + plenv( xmin, xmax, ymin, ymax, 0, 0 ); + pllab( "x", "y=100 x#u2#d", "Simple PLplot demo of a 2D line plot" ); + + // Plot the data that was prepared above. + plline( NSIZE, x, y ); + + // Close PLplot library + plend(); + + exit( 0 ); +} Property changes on: trunk/examples/c/x00c.c ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/plplot_test/test_c.sh.in =================================================================== --- trunk/plplot_test/test_c.sh.in 2011-10-26 22:36:55 UTC (rev 12000) +++ trunk/plplot_test/test_c.sh.in 2011-10-27 05:26:31 UTC (rev 12001) @@ -29,7 +29,7 @@ # Do the standard non-interactive examples. lang="c" export index lang -for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 15 16 18 19 20 \ +for index in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 15 16 18 19 20 \ 21 22 23 24 25 26 27 28 30 31 33 ${critical_examples}; do if [ "$verbose_test" ] ; then echo "x${index}${lang}" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |