From: <ai...@us...> - 2011-01-11 07:57:10
|
Revision: 11476 http://plplot.svn.sourceforge.net/plplot/?rev=11476&view=rev Author: airwin Date: 2011-01-11 07:57:04 +0000 (Tue, 11 Jan 2011) Log Message: ----------- Add an alternative to handle an Octave cell array of strings for the char ** ArrayCk typemap. Demonstrate this alternative for some of the pllegend calls in example 33. The Octave result still remained consistent with the C result for this example. Modified Paths: -------------- trunk/bindings/octave/plplot_octave.i trunk/examples/octave/x33c.m Modified: trunk/bindings/octave/plplot_octave.i =================================================================== --- trunk/bindings/octave/plplot_octave.i 2011-01-11 07:51:42 UTC (rev 11475) +++ trunk/bindings/octave/plplot_octave.i 2011-01-11 07:57:04 UTC (rev 11476) @@ -1145,38 +1145,84 @@ %} // No count but check consistency with previous -%typemap(in) char **ArrayCk (charMatrix temp) { - int i, max_length, non_blank_length; +%typemap(in) char **ArrayCk { + charMatrix temp_matrix; + Cell temp_cell; + char *tmp_cstring; + std::string str; + size_t max_length, non_blank_length; + int i, ifcell; if ( _n_dims($input) > 2 ) - { error("argument must be a scalar or vector or matrix"); SWIG_fail; } + { + error("argument must be a scalar or vector or matrix"); SWIG_fail; + } if ( _dim($input, 0) != Alen ) - { error("first dimension must be same length as previous vector"); SWIG_fail; } - // Allow one extra space for null termination. - max_length= _dim($input, 1) + 1; + { + error("first dimension must be same length as previous vector"); SWIG_fail; + } $1 = new char*[Alen]; - temp = $input.char_matrix_value(); + ifcell = $input.is_cell(); + if (ifcell) + { + temp_cell = $input.cell_value(); + } + else + { + temp_matrix = $input.char_matrix_value(); + // Allow one extra space for null termination. + max_length= _dim($input, 1) + 1; + } + for(i=0; i<Alen; i++) { // Must copy string to "permanent" location because the string // location corresponding to tmp_cstring gets // overwritten for each iteration of loop. - const char *tmp_cstring = temp.row_as_string(i).c_str(); + if(ifcell) + { + if(temp_cell.elem(i).is_string()) + { + str = temp_cell.elem(i).string_value(); + // leave room for null termination. + max_length = str.size() + 1; + tmp_cstring = (char *)str.c_str(); + } + else + { + // Use null string if user attempts to pass a cell array + // with a non-string element (likely an empty element + // since that should be allowed by the PLplot interface + // if that element is going to be unused). + // leave room for null termination. + max_length = 1; + tmp_cstring = (char*)""; + } + } + else + { + tmp_cstring = (char *)temp_matrix.row_as_string(i).c_str(); + } $1[i] = new char[max_length]; strncpy( $1[i], tmp_cstring, max_length-1 ); $1[i][max_length-1] = '\0'; - // remove trailing-blank padding that is used by the - // charMatrix class to insure all strings in a given - // charMatrix instance have the same length. - // This transformation also removes legitimate trailing - // blanks but there is nothing we can do about that - // for the charMatrix class. + // All the trailing blank crapola should not be needed for + // string cell arrays. + if(!ifcell) + { + // remove trailing-blank padding that is used by the + // charMatrix class to insure all strings in a given + // charMatrix instance have the same length. + // This transformation also removes legitimate trailing + // blanks but there is nothing we can do about that + // for the charMatrix class. - // Look for trailing nulls first (just in case, although that - // shouldn't happen if charMatrix implemented as documented) - // before looking for trailing blanks. - non_blank_length = max_length-2; - while(non_blank_length >= 0 && $1[i][non_blank_length] == '\0') {non_blank_length--;} - while(non_blank_length >= 0 && $1[i][non_blank_length] == ' ') {non_blank_length--;} - $1[i][non_blank_length+1] = '\0'; + // Look for trailing nulls first (just in case, although that + // shouldn't happen if charMatrix implemented as documented) + // before looking for trailing blanks. + non_blank_length = max_length-2; + while(non_blank_length >= 0 && $1[i][non_blank_length] == '\0') {non_blank_length--;} + while(non_blank_length >= 0 && $1[i][non_blank_length] == ' ') {non_blank_length--;} + $1[i][non_blank_length+1] = '\0'; + } } } Modified: trunk/examples/octave/x33c.m =================================================================== --- trunk/examples/octave/x33c.m 2011-01-11 07:51:42 UTC (rev 11475) +++ trunk/examples/octave/x33c.m 2011-01-11 07:57:04 UTC (rev 11476) @@ -782,17 +782,19 @@ max_height = max(max_height, legend_height); ## Set up line legend entries with various colours. - ## Reset text and symbols, because otherwise legend may come out with - ## the wrong length text/symbol with prior results embedded. - text = " "; - text(nlegend,1:length(" ")) = " "; - symbols = " "; - symbols(nlegend,1:length(" ")) = " "; + ## From here on use the cell array of strings paradigm for + ## text (and symbols) to show that the PLplot interface works properly for + ## this case (and also to demonstrate how to use a cell array of strings + ## with PLplot). + ## Reset text and symbols cell arrays. + text = {}; + text{nlegend} = ""; + symbols = {}; + symbols{nlegend} = ""; for i=0:nlegend-1 opt_array(i+1) = PL_LEGEND_LINE; - string = sprintf("%s %d", "Line Color",i+1); - text(i+1,1:length(string)) = string; + text{i+1} = sprintf("%s %d", "Line Color",i+1); text_colors(i+1) = i+1; line_colors(i+1) = i+1; line_styles(i+1) = 1; @@ -808,24 +810,22 @@ [legend_width, legend_height] = \ pllegend( opt, x, y, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, - 0., text_colors, text, + 0., text_colors, text', box_colors, box_patterns, box_scales, box_line_widths, line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + symbol_colors, symbol_scales, symbol_numbers, symbols' ); max_height = max(max_height, legend_height); ## Set up line legend entries with various styles - ## Reset text and symbols, because otherwise legend may come out with - ## the wrong length text/symbol with prior results embedded. - text = " "; - text(nlegend,1:length(" ")) = " "; - symbols = " "; - symbols(nlegend,1:length(" ")) = " "; + ## Reset text and symbols cell arrays. + text = {}; + text{nlegend} = ""; + symbols = {}; + symbols{nlegend} = ""; for i=0:nlegend-1 opt_array(i+1) = PL_LEGEND_LINE; - string = sprintf("%s %d", "Line Style",i+1); - text(i+1,1:length(string)) = string; + text{i+1} = sprintf("%s %d", "Line Style",i+1); text_colors(i+1) = 2; line_colors(i+1) = 2; line_styles(i+1) = i+1; @@ -837,24 +837,22 @@ [legend_width, legend_height] = \ pllegend( opt, x, y, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, - 0., text_colors, text, + 0., text_colors, text', box_colors, box_patterns, box_scales, box_line_widths, line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + symbol_colors, symbol_scales, symbol_numbers, symbols' ); max_height = max(max_height, legend_height); ## Set up line legend entries with various widths. - ## Reset text and symbols, because otherwise legend may come out with - ## the wrong length text/symbol with prior results embedded. - text = " "; - text(nlegend,1:length(" ")) = " "; - symbols = " "; - symbols(nlegend,1:length(" ")) = " "; + ## Reset text and symbols cell arrays. + text = {}; + text{nlegend} = ""; + symbols = {}; + symbols{nlegend} = ""; for i=0:nlegend-1 opt_array(i+1) = PL_LEGEND_LINE; - string = sprintf("%s %d", "Line Width",i+1); - text(i+1,1:length(string)) = string; + text{i+1} = sprintf("%s %d", "Line Width",i+1); text_colors(i+1) = 2; line_colors(i+1) = 2; line_styles(i+1) = 1; @@ -867,10 +865,10 @@ [legend_width, legend_height] = \ pllegend( opt, x, y, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, - 0., text_colors, text, + 0., text_colors, text', box_colors, box_patterns, box_scales, box_line_widths, line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + symbol_colors, symbol_scales, symbol_numbers, symbols' ); max_height = max(max_height, legend_height); ## Color bar examples This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2011-01-11 15:51:14
|
Revision: 11478 http://plplot.svn.sourceforge.net/plplot/?rev=11478&view=rev Author: andrewross Date: 2011-01-11 15:51:08 +0000 (Tue, 11 Jan 2011) Log Message: ----------- Add in support for plstring3, pllegend and plcolorbar to java. Update examples accordingly. Modified Paths: -------------- trunk/bindings/java/PLStream.java trunk/bindings/java/plplotjavac.i trunk/bindings/swig-support/plplotcapi.i trunk/examples/java/x04.java trunk/examples/java/x18.java trunk/examples/java/x26.java trunk/examples/java/x27.java Modified: trunk/bindings/java/PLStream.java =================================================================== --- trunk/bindings/java/PLStream.java 2011-01-11 08:22:48 UTC (rev 11477) +++ trunk/bindings/java/PLStream.java 2011-01-11 15:51:08 UTC (rev 11478) @@ -528,6 +528,42 @@ plplotjavac.pllab( xlabel, ylabel, tlabel ); } + public void legend( double[] p_legend_width, double[] p_legend_height, + int opt, double x, double y, double plot_width, + int bg_color, int bb_color, int bb_style, + int nrow, int ncolumn, int[] opt_array, + double text_offset, double text_scale, + double text_spacing, double text_justification, + int[] text_colors, String[] text, + int[] box_colors, int[] box_patterns, + double[] box_scales, int[] box_line_widths, + int[] line_colors, int[] line_styles, + int[] line_widths, + int[] symbol_colors, double[]symbol_scales, + int[] symbol_numbers, String[] symbols ) + { + if ( set_stream() == -1 ) return; + plplotjavac.pllegend( p_legend_width, p_legend_height, + opt, x, y, plot_width, bg_color, bb_color, + bb_style, nrow, ncolumn, opt_array, + text_offset, text_scale, text_spacing, + text_justification, text_colors, text, + box_colors, box_patterns, box_scales, + box_line_widths, line_colors, line_styles, + line_widths, symbol_colors, symbol_scales, + symbol_numbers, symbols ); + } + + public void colorbar( int opt, double x, double y, double length, + double width, double ticks, double subticks, + String axis_opts, String label, + double[] colors, double[] values ) + { + if ( set_stream() == -1 ) return; + plplotjavac.plcolorbar( opt, x, y, length, width, ticks, subticks, + axis_opts, label, colors, values ); + } + public void lightsource( double x, double y, double z ) { if ( set_stream() == -1 ) return; @@ -1001,6 +1037,12 @@ plplotjavac.plstring( x, y, string ); } + public void string3( double[] x, double[] y, double[] z, String string ) + { + if ( set_stream() == -1 ) return; + plplotjavac.plstring3( x, y, z, string ); + } + public void stripa( int id, int pen, double x, double y ) { if ( set_stream() == -1 ) return; Modified: trunk/bindings/java/plplotjavac.i =================================================================== --- trunk/bindings/java/plplotjavac.i 2011-01-11 08:22:48 UTC (rev 11477) +++ trunk/bindings/java/plplotjavac.i 2011-01-11 15:51:08 UTC (rev 11478) @@ -321,6 +321,7 @@ Naming rules: Array (sets Alen to dim[0]) ArrayCk (tests that dim[0] == Alen) + ArrayCkNull (tests that dim[0] == Alen or array is null) ArrayX (sets Xlen to dim[0] ArrayCkX (tests dim[0] == Xlen) ArrayY (sets Ylen to dim[1]) @@ -398,6 +399,33 @@ return $jnicall; } +/* no count but check consistency with previous or is null */ +%typemap(in) PLINT *ArrayCkNull { + if ( $input != NULL ) { + jint *jydata = (*jenv)->GetIntArrayElements( jenv, $input, 0 ); + if((*jenv)->GetArrayLength( jenv, $input ) != Alen) { + printf("Vectors must be same length.\n"); + return; + } + setup_array_1d_i( &$1, jydata, Alen); + (*jenv)->ReleaseIntArrayElements( jenv, $input, jydata, 0 ); + } + else { + $1 == NULL; + } +} +%typemap(freearg) PLINT *ArrayCkNull { + if ($1 != NULL) + free($1); +} +%typemap(jni) PLINT *ArrayCkNull "jintArray" +%typemap(jtype) PLINT *ArrayCkNull "int[]" +%typemap(jstype) PLINT *ArrayCkNull "int[]" +%typemap(javain) PLINT *ArrayCkNull "$javainput" +%typemap(javaout) PLINT *ArrayCkNull { + return $jnicall; +} + /* Weird case to allow argument to be one shorter than others */ /* This case is used both for PLBOOL and PLINT. Define PLBOOL version * first. (AWI thinks this may be necessary because of the above @@ -610,6 +638,33 @@ return $jnicall; } +/* no count, but check consistency with previous or NULL */ +%typemap(in) PLFLT *ArrayCkNull { + if ( $input != NULL ) { + jPLFLT *jydata = (*jenv)->GetPLFLTArrayElements( jenv, $input, 0 ); + if((*jenv)->GetArrayLength( jenv, $input ) != Alen) { + printf("Vectors must be same length.\n"); + return; + } + setup_array_1d_PLFLT( &$1, jydata, Alen ); + (*jenv)->ReleasePLFLTArrayElements( jenv, $input, jydata, 0 ); + } + else { + $1 = NULL; + } +} +%typemap(freearg) PLFLT *ArrayCkNull { + if ($1 != NULL) + free($1); +} +%typemap(jni) PLFLT *ArrayCkNull jPLFLTArray +%typemap(jtype) PLFLT *ArrayCkNull jPLFLTbracket +%typemap(jstype) PLFLT *ArrayCkNull jPLFLTbracket +%typemap(javain) PLFLT *ArrayCkNull "$javainput" +%typemap(javaout) PLFLT *ArrayCkNull{ + return $jnicall; +} + /* set X length for later consistency checking */ %typemap(in) (PLFLT *ArrayX, PLINT nx) { jPLFLT *jxdata = (*jenv)->GetPLFLTArrayElements( jenv, $input, 0 ); @@ -1720,6 +1775,47 @@ free($1); } +%typemap(jni) (char **ArrayCk) "jobjectArray" +%typemap(jtype) (char **ArrayCk) "String[]" +%typemap(jstype) (char **ArrayCk) "String[]" +%typemap(javain) (char **ArrayCk) "$javainput" +%typemap(javaout) (char **ArrayCk) { + return $jnicall; +} +%typemap(in) (char **ArrayCk) { + int i = 0; + if ($input != NULL) { + int size = (*jenv)->GetArrayLength(jenv, $input); + if (size != Alen) { + printf("Arrays must be the same length\n"); + return; + } + $1 = (char **) malloc(Alen*sizeof(char *)); + /* make a copy of each string */ + for (i = 0; i<Alen; i++) { + jstring j_string = (jstring)(*jenv)->GetObjectArrayElement(jenv, $input, i); + const char * c_string = (char *) (*jenv)->GetStringUTFChars(jenv, j_string, 0); + $1[i] = malloc((strlen(c_string)+1)*sizeof(const char *)); + strcpy($1[i], c_string); + (*jenv)->ReleaseStringUTFChars(jenv, j_string, c_string); + (*jenv)->DeleteLocalRef(jenv, j_string); + } + } + else { + $1 = NULL; + } +} + +/* This cleans up the memory we malloc'd before the function call */ +%typemap(freearg) (char **ArrayCk) { + int i; + if ($1 != NULL) { + for (i=0; i<Alen; i++) + free($1[i]); + free($1); + } +} + #if 0 %typemap(in) PLGraphicsIn *gin (PLGraphicsIn tmp) { if(!PySequence_Check($input) || PySequence_Size($input) != 2) { @@ -1739,8 +1835,5 @@ } #endif -// Not implemented yet. -%ignore pllegend; - /* swig compatible PLplot API definitions from here on. */ %include plplotcapi.i Modified: trunk/bindings/swig-support/plplotcapi.i =================================================================== --- trunk/bindings/swig-support/plplotcapi.i 2011-01-11 08:22:48 UTC (rev 11477) +++ trunk/bindings/swig-support/plplotcapi.i 2011-01-11 15:51:08 UTC (rev 11478) @@ -554,17 +554,17 @@ PLFLT text_offset, PLFLT text_scale, PLFLT text_spacing, PLFLT text_justification, const PLINT *ArrayCk, const char **ArrayCk, - const PLINT *ArrayCk, const PLINT *ArrayCk, - const PLFLT *ArrayCk, const PLINT *ArrayCk, - const PLINT *ArrayCk, const PLINT *ArrayCk, - const PLINT *ArrayCk, - const PLINT *ArrayCk, const PLFLT *ArrayCk, - const PLINT *ArrayCk, const char **ArrayCk ); + const PLINT *ArrayCkNull, const PLINT *ArrayCkNull, + const PLFLT *ArrayCkNull, const PLINT *ArrayCkNull, + const PLINT *ArrayCkNull, const PLINT *ArrayCkNull, + const PLINT *ArrayCkNull, + const PLINT *ArrayCkNull, const PLFLT *ArrayCkNull, + const PLINT *ArrayCkNull, const char **ArrayCk ); %feature( "docstring", "Create a continous colorbar using an image, shade, or gradient with an optional axis label." ) plcolorbar; void plcolorbar( PLINT opt, PLFLT x, PLFLT y, PLFLT length, PLFLT width, - PLFLT ticks, PLINT sub_ticks, + PLFLT ticks, PLFLT sub_ticks, const char *axis_opts, const char *label, PLINT n, PLFLT *Array, PLFLT *ArrayCk ); Modified: trunk/examples/java/x04.java =================================================================== --- trunk/examples/java/x04.java 2011-01-11 08:22:48 UTC (rev 11477) +++ trunk/examples/java/x04.java 2011-01-11 15:51:08 UTC (rev 11478) @@ -69,6 +69,19 @@ double[] ampl = new double[101]; double[] phase = new double[101]; double f0, freq; + int nlegend; + String[] text; + String[] symbols; + int[] opt_array; + int[] text_colors; + int[] line_colors; + int[] line_styles; + int[] line_widths; + int[] symbol_numbers; + int[] symbol_colors; + double[] symbol_scales; + double[] legend_width = new double[1]; + double[] legend_height = new double[1]; pls.adv( 0 ); @@ -104,7 +117,7 @@ pls.col0( 2 ); pls.line( freql, ampl ); - pls.col0( 1 ); + pls.col0( 2 ); pls.ptex( 1.6, -30.0, 1.0, -20.0, 0.5, "-20 dB/decade" ); // Put labels on. @@ -114,6 +127,7 @@ pls.mtex( "t", 2.0, 0.5, 0.5, "Single Pole Low-Pass Filter" ); pls.col0( 2 ); pls.mtex( "l", 5.0, 0.5, 0.5, "Amplitude (dB)" ); + nlegend = 1; // For the gridless case, put phase vs freq on same plot. @@ -127,7 +141,61 @@ pls.string( freql, phase, "*" ); pls.col0( 3 ); pls.mtex( "r", 5.0, 0.5, 0.5, "Phase shift (degrees)" ); + nlegend = 2; } + text = new String[nlegend]; + symbols = new String[nlegend]; + opt_array = new int[nlegend]; + text_colors = new int[nlegend]; + line_colors = new int[nlegend]; + line_styles = new int[nlegend]; + line_widths = new int[nlegend]; + symbol_numbers = new int[nlegend]; + symbol_colors = new int[nlegend]; + symbol_scales = new double[nlegend]; + + // Draw a legend + // First legend entry. + opt_array[0] = PLStream.PL_LEGEND_LINE; + text_colors[0] = 2; + text[0] = "Amplitude"; + line_colors[0] = 2; + line_styles[0] = 1; + line_widths[0] = 1; + // note from the above opt_array the first symbol (and box) indices + // do not have to be specified EXCEPT for symbols. + // Although this is unused, it can't be undefined as the String + // array is copied as part of the java bindings. + symbols[0] = " "; + + // Second legend entry. + if (nlegend == 2) { + opt_array[1] = PLStream.PL_LEGEND_LINE | PLStream.PL_LEGEND_SYMBOL; + text_colors[1] = 3; + text[1] = "Phase shift"; + line_colors[1] = 3; + line_styles[1] = 1; + line_widths[1] = 1; + symbol_colors[1] = 3; + symbol_scales[1] = 1.; + symbol_numbers[1] = 4; + symbols[1] = "*"; + } + + // from the above opt_arrays we can completely ignore everything + // to do with boxes. + + pls.scol0a( 15, 32, 32, 32, 0.70 ); + pls.legend( legend_width, legend_height, + PLStream.PL_LEGEND_BACKGROUND | PLStream.PL_LEGEND_BOUNDING_BOX, + 0.0, 0.0, 0.1, 15, + 1, 1, 0, 0, opt_array, + 1.0, 1.0, 2.0, + 1., text_colors, text, + null, null, null, null, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + } } Modified: trunk/examples/java/x18.java =================================================================== --- trunk/examples/java/x18.java 2011-01-11 08:22:48 UTC (rev 11477) +++ trunk/examples/java/x18.java 2011-01-11 15:51:08 UTC (rev 11478) @@ -167,7 +167,8 @@ if ( opt[k] > 0 ) pls.line3( x, y, z ); else - pls.poin3( x, y, z, 1 ); + // U+22C5 DOT OPERATOR. + pls.string3( x, y, z, "⋅" ); pls.col0( 3 ); String title = "#frPLplot Example 18 - Alt=" + Modified: trunk/examples/java/x26.java =================================================================== --- trunk/examples/java/x26.java 2011-01-11 08:22:48 UTC (rev 11477) +++ trunk/examples/java/x26.java 2011-01-11 15:51:08 UTC (rev 11478) @@ -85,6 +85,12 @@ "Фазовый сдвиг (градусы)" }; + // Short rearranged versions of y_label and alty_label. + static String[][] legend_text = { + { "Amplitude", "Phase shift"}, + { "Амплитуда", "Фазовый сдвиг" } + }; + static String[] title_label = { "Single Pole Low-Pass Filter", "Однополюсный Низко-Частотный Фильтр" @@ -126,8 +132,8 @@ for ( i = 0; i < nlang; i++ ) { - plot1( 0, x_label[i], y_label[i], alty_label[i], title_label[i], - line_label[i] ); + plot1( 0, x_label[i], y_label[i], alty_label[i], + legend_text[i], title_label[i], line_label[i] ); } pls.end(); @@ -136,13 +142,25 @@ // Log-linear plot. void plot1( int type, String x_label, String y_label, String alty_label, - String title_label, String line_label ) + String[] legend_text, String title_label, String line_label ) { int i; double[] freql = new double[101]; double[] ampl = new double[101]; double[] phase = new double[101]; double f0, freq; + int nlegend = 2; + int[] opt_array = new int[2]; + int[] text_colors = new int[2]; + int[] line_colors = new int[2]; + int[] line_styles = new int[2]; + int[] line_widths = new int[2]; + int[] symbol_numbers = new int[2]; + int[] symbol_colors = new int[2]; + double[] symbol_scales = new double[2]; + String[] symbols = new String[2]; + double[] legend_width = new double[1]; + double[] legend_height = new double[1]; pls.adv( 0 ); @@ -178,7 +196,7 @@ pls.col0( 2 ); pls.line( freql, ampl ); - pls.col0( 1 ); + pls.col0( 2 ); pls.ptex( 1.6, -30.0, 1.0, -20.0, 0.5, line_label ); // Put labels on. @@ -202,6 +220,43 @@ pls.col0( 3 ); pls.mtex( "r", 5.0, 0.5, 0.5, alty_label ); } + // Draw a legend + // First legend entry. + opt_array[0] = PLStream.PL_LEGEND_LINE; + text_colors[0] = 2; + line_colors[0] = 2; + line_styles[0] = 1; + line_widths[0] = 1; + // note from the above opt_array the first symbol (and box) indices + // do not have to be specified EXCEPT for symbols. + // Although this is unused, it can't be undefined as the String + // array is copied as part of the java bindings. + symbols[0] = ""; + + // Second legend entry. + opt_array[1] = PLStream.PL_LEGEND_LINE | PLStream.PL_LEGEND_SYMBOL; + text_colors[1] = 3; + line_colors[1] = 3; + line_styles[1] = 1; + line_widths[1] = 1; + symbol_colors[1] = 3; + symbol_scales[1] = 1.; + symbol_numbers[1] = 4; + symbols[1] = "*"; + // from the above opt_arrays we can completely ignore everything + // to do with boxes. + + pls.scol0a( 15, 32, 32, 32, 0.70 ); + pls.legend( legend_width, legend_height, + PLStream.PL_LEGEND_BACKGROUND | PLStream.PL_LEGEND_BOUNDING_BOX, + 0.0, 0.0, 0.10, 15, + 1, 1, 0, 0, opt_array, + 1.0, 1.0, 2.0, + 1., text_colors, legend_text, + null, null, null, null, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + } } Modified: trunk/examples/java/x27.java =================================================================== --- trunk/examples/java/x27.java 2011-01-11 08:22:48 UTC (rev 11477) +++ trunk/examples/java/x27.java 2011-01-11 15:51:08 UTC (rev 11478) @@ -61,6 +61,7 @@ { 20.0, -13.0, 20.0, 20.0 } }; int i; + boolean fill; // plplot initialization @@ -77,11 +78,12 @@ // First an overview, then all curves one by one pls.ssub( 3, 3 ); // Three by three window + fill = false; for ( i = 0; i < 9; i++ ) { pls.adv( 0 ); pls.vpor( 0.0, 1.0, 0.0, 1.0 ); - spiro( params[i] ); + spiro( params[i], fill ); } pls.adv( 0 ); @@ -91,9 +93,22 @@ { pls.adv( 0 ); pls.vpor( 0.0, 1.0, 0.0, 1.0 ); - spiro( params[i] ); + spiro( params[i], fill ); } + // Fill the curves + fill = true; + + pls.adv( 0 ); + pls.ssub( 1, 1 ); // One window per curve + + for ( i = 0; i < 9; i++ ) + { + pls.adv( 0 ); + pls.vpor( 0.0, 1.0, 0.0, 1.0 ); + spiro( params[i], fill ); + } + pls.end(); } @@ -106,7 +121,7 @@ // =============================================================== - void spiro( double params[] ) + void spiro( double params[], boolean fill ) { int NPNT = 20000; double xcoord[]; @@ -167,7 +182,11 @@ pls.wind( xmin, xmax, ymin, ymax ); pls.col0( 1 ); - pls.line( xcoord, ycoord ); + + if ( fill ) + pls.fill( xcoord, ycoord ); + else + pls.line( xcoord, ycoord ); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2011-01-11 15:54:26
|
Revision: 11481 http://plplot.svn.sourceforge.net/plplot/?rev=11481&view=rev Author: andrewross Date: 2011-01-11 15:54:19 +0000 (Tue, 11 Jan 2011) Log Message: ----------- Swig interfaces now specify whether or not an array is allowed to be NULL. This is used for unused arguments in pllegend. Octave example 4 and 33 demonstrate this. Python was already slacker in allowing NULL arrays in all cases, but java and octave did not. Modified Paths: -------------- trunk/bindings/lua/plplotluac.i trunk/bindings/octave/plplot_octave.i trunk/bindings/python/plplotcmodule.i trunk/examples/octave/x04c.m trunk/examples/octave/x33c.m Modified: trunk/bindings/lua/plplotluac.i =================================================================== --- trunk/bindings/lua/plplotluac.i 2011-01-11 15:52:26 UTC (rev 11480) +++ trunk/bindings/lua/plplotluac.i 2011-01-11 15:54:19 UTC (rev 11481) @@ -159,6 +159,17 @@ } %typemap(freearg) PLINT *ArrayCk { LUA_FREE_ARRAY($1); } +/* No count but check consistency with previous, or NULL */ +%typemap(in) PLINT *ArrayCkNull (int temp) { + $1 = (PLINT*)LUA_get_int_num_array_var(L, $input, &temp); + if(!$1) SWIG_fail; + if(temp != Alen) { + lua_pushfstring(L, "Tables must be of same length."); + SWIG_fail; + } +} +%typemap(freearg) PLINT *ArrayCkNull { LUA_FREE_ARRAY($1); } +%typemap(default) PLINT *ArrayCkNull { $1=NULL; } /* Weird case to allow argument to be one shorter than others */ %typemap(in) PLINT *ArrayCkMinus1 (int temp) { @@ -232,6 +243,18 @@ %typemap(freearg) PLFLT *ArrayCk { LUA_FREE_ARRAY($1); } +/* no count, but check consistency with previous, or NULL */ +%typemap(in) PLFLT *ArrayCkNull (int temp) { + $1 = (PLFLT*)LUA_get_double_num_array_var(L, $input, &temp); + if(!$1) SWIG_fail; + if(temp != Alen) { + lua_pushfstring(L, "Tables must be of same length."); + SWIG_fail; + } +} +%typemap(freearg) PLFLT *ArrayCkNull { LUA_FREE_ARRAY($1); } + + /* No length but remember size to check others */ %typemap(in) PLFLT *Array { int temp; @@ -240,8 +263,8 @@ Alen = temp; } %typemap(freearg) (PLFLT *Array) { LUA_FREE_ARRAY($1); } +%typemap(default) PLFLT *ArrayCkNull { $1=NULL; } - /* with trailing count */ %typemap(in) (PLFLT *Array, PLINT n) { int temp; Modified: trunk/bindings/octave/plplot_octave.i =================================================================== --- trunk/bindings/octave/plplot_octave.i 2011-01-11 15:52:26 UTC (rev 11480) +++ trunk/bindings/octave/plplot_octave.i 2011-01-11 15:54:19 UTC (rev 11481) @@ -220,6 +220,23 @@ } %typemap(freearg) PLINT *ArrayCk {delete [] $1;} +// No count but check consistency with previous +%typemap(in) PLINT *ArrayCkNull (Matrix temp) { + if ( _n_dims($input) > 1 ) + { error("argument must be a scalar or vector"); SWIG_fail; } + if ( ! $input.is_empty() ) { + if ( _dim($input, 0) != Alen ) + { error("argument vectors must be same length"); SWIG_fail; } + temp = $input.matrix_value(); + $1 = new PLINT[Alen]; + _cvt_double_to($1, &temp(0,0), Alen); + } + else { + $1 = NULL; + } +} +%typemap(freearg) PLINT *ArrayCkNull {if ($1 != NULL) delete [] $1;} + // No count but remember size to check others %typemap(in) PLINT *Array (Matrix temp) { if ( _n_dims($input) > 1 ) @@ -295,6 +312,22 @@ } %typemap(freearg) PLFLT *ArrayCk {} +// No count but check consistency with previous or NULL +%typemap(in) PLFLT *ArrayCkNull (Matrix temp) { + if ( _n_dims($input) > 1 ) + { error("argument must be a scalar or vector"); SWIG_fail; } + if ( ! $input.is_empty() ) { + if ( _dim($input, 0) != Alen ) + { error("argument vectors must be same length"); SWIG_fail; } + temp = $input.matrix_value(); + $1 = &temp(0,0); + } + else { + $1 = NULL; + } +} +%typemap(freearg) PLFLT *ArrayCkNull {} + // No count but remember size to check others %typemap(in) PLFLT *Array (Matrix temp) { if ( _n_dims($input) > 1 ) @@ -1138,7 +1171,7 @@ printf("nlegend = %d\n", nlegend); for(i=0;i<nlegend;i++) { printf("opt_array[%d] = %d\n", i, opt_array[i]); - printf("strlen(text[%d]) = %d\n", i, strlen(text[i])); + printf("strlen(text[%d]) = %d\n", i, (int) strlen(text[i])); printf("text[%d] = %s\n", i, text[i]); } } @@ -1156,6 +1189,7 @@ { error("argument must be a scalar or vector or matrix"); SWIG_fail; } + if ( ! $input.is_empty() ) { if ( _dim($input, 0) != Alen ) { error("first dimension must be same length as previous vector"); SWIG_fail; @@ -1224,14 +1258,20 @@ $1[i][non_blank_length+1] = '\0'; } } + } + else { + $1 = NULL; + } } %typemap(freearg) char **ArrayCk { int i; + if ($1 != NULL) { for(i=0; i<Alen; i++) { delete[] $1[i]; } delete[] $1; + } } // This test function should be removed when we are confident of our Modified: trunk/bindings/python/plplotcmodule.i =================================================================== --- trunk/bindings/python/plplotcmodule.i 2011-01-11 15:52:26 UTC (rev 11480) +++ trunk/bindings/python/plplotcmodule.i 2011-01-11 15:54:19 UTC (rev 11481) @@ -178,6 +178,18 @@ } %typemap(freearg) PLINT *ArrayCk { Py_DECREF(tmp$argnum);} +/* No count but check consistency with previous or NULL */ +%typemap(in) PLINT *ArrayCkNull (PyArrayObject* tmp) { + tmp = (PyArrayObject *)myIntArray_ContiguousFromObject($input, PyArray_PLINT, 1, 1); + if(tmp == NULL) return NULL; + if(tmp->dimensions[0] != Alen) { + PyErr_SetString(PyExc_ValueError, "Vectors must be same length."); + return NULL; + } + $1 = (PLINT*)tmp->data; +} +%typemap(freearg) PLINT *ArrayCkNull { Py_DECREF(tmp$argnum);} + /* Weird case to allow argument to be one shorter than others */ %typemap(in) PLINT *ArrayCkMinus1 (PyArrayObject* tmp) { tmp = (PyArrayObject *)myIntArray_ContiguousFromObject($input, PyArray_PLINT, 1, 1); @@ -271,6 +283,18 @@ } %typemap(freearg) PLFLT *ArrayCk { Py_DECREF(tmp$argnum);} +/* no count, but check consistency with previous, or NULL */ +%typemap(in) PLFLT *ArrayCkNull (PyArrayObject* tmp) { + tmp = (PyArrayObject *)myArray_ContiguousFromObject($input, PyArray_PLFLT, 1, 1); + if(tmp == NULL) return NULL; + if(tmp->dimensions[0] != Alen) { + PyErr_SetString(PyExc_ValueError, "Vectors must be same length."); + return NULL; + } + $1 = (PLFLT*)tmp->data; +} +%typemap(freearg) PLFLT *ArrayCkNull { Py_DECREF(tmp$argnum);} + /* check consistency with X dimension of previous */ %typemap(in) PLFLT *ArrayCkX (PyArrayObject* tmp) { tmp = (PyArrayObject *)myArray_ContiguousFromObject($input, PyArray_PLFLT, 1, 1); @@ -460,7 +484,7 @@ /*************************** special for pllegend, char ** ArrayCk ****************************/ -/* no count, but check consistency with previous */ +/* no count, but check consistency with previous. Always allow NULL strings. */ %typemap(in) char **ArrayCk (PyArrayObject* tmp) { int i; tmp = (PyArrayObject *)PyArray_ContiguousFromObject($input, NPY_STRING, 1, 1); Modified: trunk/examples/octave/x04c.m =================================================================== --- trunk/examples/octave/x04c.m 2011-01-11 15:52:26 UTC (rev 11480) +++ trunk/examples/octave/x04c.m 2011-01-11 15:54:19 UTC (rev 11481) @@ -109,10 +109,6 @@ opt_array = 0; text_colors = 0; text = " "; - box_colors = 0; - box_patterns = 0; - box_scales = 0.; - box_line_widths = 0; line_colors = 0; line_styles = 0; line_widths = 0; @@ -124,10 +120,6 @@ opt_array(nlegend,1) = 0; text_colors(nlegend,1) = 0; text(nlegend,1:length(" ")) = " "; - box_colors(nlegend,1) = 0; - box_patterns(nlegend,1) = 0; - box_scales(nlegend,1) = 0.; - box_line_widths(nlegend,1) = 0; line_colors(nlegend,1) = 0; line_styles(nlegend,1) = 0; line_widths(nlegend,1) = 0; @@ -167,7 +159,7 @@ pllegend( bitor(PL_LEGEND_BACKGROUND, PL_LEGEND_BOUNDING_BOX), 0.0, 0.0, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, 1.0, 2.0, 1., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, + [], [], [], [], line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ); Modified: trunk/examples/octave/x33c.m =================================================================== --- trunk/examples/octave/x33c.m 2011-01-11 15:52:26 UTC (rev 11480) +++ trunk/examples/octave/x33c.m 2011-01-11 15:54:19 UTC (rev 11481) @@ -216,10 +216,6 @@ opt_array(nlegend,1) = 0; text_colors(nlegend,1) = 0; text(nlegend,1:length(" ")) = " "; - box_colors(nlegend,1) = 0; - box_patterns(nlegend,1) = 0; - box_scales(nlegend,1) = 0.; - box_line_widths(nlegend,1) = 0; line_colors(nlegend,1) = 0; line_styles(nlegend,1) = 0; line_widths(nlegend,1) = 0; @@ -253,7 +249,7 @@ pllegend( opt, 0.05, 0.05, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, 1.0, 2.0, 1., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, + [], [], [], [], line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ); endfor @@ -294,10 +290,6 @@ opt_array(nlegend,1) = 0; text_colors(nlegend,1) = 0; text(nlegend,1:length(" ")) = " "; - box_colors(nlegend,1) = 0; - box_patterns(nlegend,1) = 0; - box_scales(nlegend,1) = 0.; - box_line_widths(nlegend,1) = 0; line_colors(nlegend,1) = 0; line_styles(nlegend,1) = 0; line_widths(nlegend,1) = 0; @@ -336,7 +328,7 @@ pllegend( opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, 1., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, + [], [], [], [], line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ); @@ -349,7 +341,7 @@ pllegend( opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, 1., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, + [], [], [], [], line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ); @@ -362,7 +354,7 @@ pllegend( opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, 1., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, + [], [], [], [], line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ); @@ -375,7 +367,7 @@ pllegend( opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, 1., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, + [], [], [], [], line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ); @@ -388,7 +380,7 @@ pllegend( opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, 1., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, + [], [], [], [], line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ); @@ -401,7 +393,7 @@ pllegend( opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, 1., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, + [], [], [], [], line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ); @@ -414,7 +406,7 @@ pllegend( opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 2.0, 1., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, + [], [], [], [], line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ); @@ -503,7 +495,7 @@ pllegend( opt, x, y, 0.025, 15, 1, 1, nrow, ncolumn, opt_array, 1.0, 1.0, 1.5, 1., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, + [], [], [], [], line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ); if(i == nturn) @@ -649,8 +641,8 @@ pllegend( opt, x, y, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, 0., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, - line_colors, line_styles, line_widths, + [], [], [], [], + [], [], [], symbol_colors, symbol_scales, symbol_numbers, symbols ); max_height = max(max_height, legend_height); @@ -680,8 +672,8 @@ pllegend( opt, x, y, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, 0., text_colors, text, - box_colors, box_patterns, box_scales, box_line_widths, - line_colors, line_styles, line_widths, + [], [], [], [], + [], [], [], symbol_colors, symbol_scales, symbol_numbers, symbols ); max_height = max(max_height, legend_height); @@ -715,8 +707,8 @@ 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, 0., text_colors, text, box_colors, box_patterns, box_scales, box_line_widths, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + [], [], [], + [], [], [], [] ); max_height = max(max_height, legend_height); ## Set up box legend entries with various patterns. @@ -746,8 +738,8 @@ 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, 0., text_colors, text, box_colors, box_patterns, box_scales, box_line_widths, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + [], [], [], + [], [], [], [] ); max_height = max(max_height, legend_height); ## Set up box legend entries with various box pattern line widths. @@ -777,8 +769,8 @@ 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, 0., text_colors, text, box_colors, box_patterns, box_scales, box_line_widths, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + [], [], [], + [], [], [], [] ); max_height = max(max_height, legend_height); ## Set up line legend entries with various colours. @@ -811,9 +803,9 @@ pllegend( opt, x, y, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, 0., text_colors, text', - box_colors, box_patterns, box_scales, box_line_widths, + [], [], [], [], line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols' ); + [], [], [], [] ); max_height = max(max_height, legend_height); ## Set up line legend entries with various styles @@ -838,9 +830,9 @@ pllegend( opt, x, y, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, 0., text_colors, text', - box_colors, box_patterns, box_scales, box_line_widths, + [], [], [], [], line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols' ); + [], [], [], [] ); max_height = max(max_height, legend_height); ## Set up line legend entries with various widths. @@ -866,9 +858,9 @@ pllegend( opt, x, y, 0.1, 15, 1, 1, 0, 0, opt_array, 1.0, text_scale, 2.0, 0., text_colors, text', - box_colors, box_patterns, box_scales, box_line_widths, + [], [], [], [], line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols' ); + [], [], [], [] ); max_height = max(max_height, legend_height); ## Color bar examples This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-01-12 00:22:53
|
Revision: 11485 http://plplot.svn.sourceforge.net/plplot/?rev=11485&view=rev Author: airwin Date: 2011-01-12 00:22:44 +0000 (Wed, 12 Jan 2011) Log Message: ----------- In perl script tweak output file format so that it can be parsed by swig. Escape description double quotes. Place semicolon after name of function. These changes are propagated to the generated file, swig_documentation.i. Modified Paths: -------------- trunk/bindings/swig-support/swig_documentation.i trunk/doc/docbook/bin/api2swigdoc.pl Modified: trunk/bindings/swig-support/swig_documentation.i =================================================================== --- trunk/bindings/swig-support/swig_documentation.i 2011-01-11 23:26:42 UTC (rev 11484) +++ trunk/bindings/swig-support/swig_documentation.i 2011-01-12 00:22:44 UTC (rev 11485) @@ -26,7 +26,8 @@ sigdig (PLINT, input) : Number of significant digits. Default value is 2. -") pl_setcontlabelformat +") +pl_setcontlabelformat; %feature( "docstring", "Set parameters of contour labelling other than format of numerical label @@ -58,7 +59,8 @@ active (PLINT, input) : Activate labels. Set to 1 if you want contour labels on. Default is off (0). -") pl_setcontlabelparam +") +pl_setcontlabelparam; %feature( "docstring", "Advance the (sub-)page @@ -89,7 +91,8 @@ sub (PLINT, input) : Specifies the subpage number (starting from 1 in the top left corner and increasing along the rows) to which to advance. Set to zero to advance to the next subpage. -") pladv +") +pladv; %feature( "docstring", "Draw a circular or elliptical arc @@ -124,7 +127,8 @@ angle2 (PLFLT, input) : Ending angle of the arc. fill (PLBOOL, input) : Draw a filled arc. -") plarc +") +plarc; %feature( "docstring", "Draw a box with axes, etc. with arbitrary origin @@ -212,7 +216,8 @@ nysub (PLINT, input) : Number of subintervals between major y axis ticks for minor ticks. If it is set to zero, PLplot automatically generates a suitable minor tick interval. -") plaxes +") +plaxes; %feature( "docstring", "Plot a histogram from binned data @@ -262,7 +267,8 @@ size as the ones inside. opt=PL_BIN_NOEMPTY|...: Bins with zero height are not drawn (there is a gap for such bins). -") plbin +") +plbin; %feature( "docstring", "Begin a new page @@ -288,7 +294,8 @@ SYNOPSIS: plbop() -") plbop +") +plbop; %feature( "docstring", "Draw a box with axes, etc @@ -369,7 +376,8 @@ nysub (PLINT, input) : Number of subintervals between major y axis ticks for minor ticks. If it is set to zero, PLplot automatically generates a suitable minor tick interval. -") plbox +") +plbox; %feature( "docstring", "Draw a box with axes, etc, in 3-d @@ -488,7 +496,8 @@ nzsub (PLINT, input) : Number of subintervals between major z axis ticks for minor ticks. If it is set to zero, PLplot automatically generates a suitable minor tick interval. -") plbox3 +") +plbox3; %feature( "docstring", "Calculate world coordinates and corresponding window index from relative device coordinates @@ -541,7 +550,8 @@ coordinates are inside it. Finally, in all cases where the input relative device coordinates are not inside any viewport/window, then window is set to -1. -") plcalc_world +") +plcalc_world; %feature( "docstring", "Clear current (sub)page @@ -565,7 +575,8 @@ SYNOPSIS: plclear() -") plclear +") +plclear; %feature( "docstring", "Set color, map0 @@ -592,7 +603,8 @@ magenta14 salmon15 white Use plscmap0 to change the entire map0 color palette and plscol0 to change an individual color in the map0 color palette. -") plcol0 +") +plcol0; %feature( "docstring", "Set color, map1 @@ -617,7 +629,8 @@ which by default ranges from blue to the background color to red. The map1 palette can also be straightforwardly changed by the user with plscmap1 or plscmap1l. -") plcol1 +") +plcol1; %feature( "docstring", "Contour plot @@ -682,7 +695,8 @@ pltr_data (PLPointer, input) : Extra parameter to help pass information to pltr0, pltr1, pltr2, or whatever routine that is externally supplied. -") plcont +") +plcont; %feature( "docstring", "Copy state parameters from the reference stream to the current stream @@ -715,7 +729,8 @@ flags (PLBOOL, input) : If flags is set to true the device coordinates are not copied from the reference to current stream. -") plcpstrm +") +plcpstrm; %feature( "docstring", "End plotting session @@ -738,7 +753,8 @@ SYNOPSIS: plend() -") plend +") +plend; %feature( "docstring", "End plotting session for current stream @@ -756,7 +772,8 @@ SYNOPSIS: plend1() -") plend1 +") +plend1; %feature( "docstring", "Same as plenv but if in multiplot mode does not advance the subpage, instead clears it. @@ -852,7 +869,8 @@ 71: same as 1 except custom x and y labels. 72: same as 2 except custom x and y labels. 73: same as 3 except custom x and y labels. -") plenv0 +") +plenv0; %feature( "docstring", "Set up standard window and draw box @@ -948,7 +966,8 @@ 71: same as 1 except custom x and y labels. 72: same as 2 except custom x and y labels. 73: same as 3 except custom x and y labels. -") plenv +") +plenv; %feature( "docstring", "Eject current page @@ -966,7 +985,8 @@ SYNOPSIS: pleop() -") pleop +") +pleop; %feature( "docstring", "Draw x error bar @@ -1001,7 +1021,8 @@ y (PLFLT *, input) : Pointer to array with y coordinates of error bar. -") plerrx +") +plerrx; %feature( "docstring", "Draw y error bar @@ -1036,7 +1057,8 @@ ymax (PLFLT *, input) : Pointer to array with y coordinate of upper endpoint of error bar. -") plerry +") +plerry; %feature( "docstring", "Advance to the next family file on the next new page @@ -1053,7 +1075,8 @@ SYNOPSIS: plfamadv() -") plfamadv +") +plfamadv; %feature( "docstring", "Draw filled polygon @@ -1085,7 +1108,8 @@ y (PLFLT *, input) : Pointer to array with y coordinates of vertices. -") plfill +") +plfill; %feature( "docstring", "Draw filled polygon in 3D @@ -1121,7 +1145,8 @@ z (PLFLT *, input) : Pointer to array with z coordinates of vertices. -") plfill3 +") +plfill3; %feature( "docstring", "Flushes the output stream @@ -1138,7 +1163,8 @@ SYNOPSIS: plflush() -") plflush +") +plflush; %feature( "docstring", "Set character font @@ -1165,7 +1191,8 @@ 2: Roman font 3: Italic font 4: Script font -") plfont +") +plfont; %feature( "docstring", "Load character font @@ -1189,7 +1216,8 @@ set (PLINT, input) : Specifies the character set to load: 0: Standard character set 1: Extended character set -") plfontld +") +plfontld; %feature( "docstring", "Get character default height and current (scaled) height @@ -1213,7 +1241,8 @@ p_ht (PLFLT *, output) : Pointer to current (scaled) character height (mm). -") plgchr +") +plgchr; %feature( "docstring", "Returns 8-bit RGB values for given color from color map0 @@ -1242,7 +1271,8 @@ g (PLINT *, output) : Pointer to 8-bit green value. b (PLINT *, output) : Pointer to 8-bit blue value. -") plgcol0 +") +plgcol0; %feature( "docstring", "Returns 8-bit RGB values and double alpha value for given color from color map0. @@ -1271,7 +1301,8 @@ b (PLINT *, output) : Pointer to 8-bit blue value. a (PLFLT *, output) : Pointer to PLFLT alpha value. -") plgcol0a +") +plgcol0a; %feature( "docstring", " Returns the background color (cmap0[0]) by 8-bit RGB value @@ -1299,7 +1330,8 @@ b (PLINT *, output) : Pointer to an unsigned 8-bit integer (0-255) representing the degree of blue in the color. -") plgcolbg +") +plgcolbg; %feature( "docstring", " Returns the background color (cmap0[0]) by 8-bit RGB value and double alpha value. @@ -1328,7 +1360,8 @@ representing the degree of blue in the color. a (PLFLT *, output) : Pointer to PLFLT alpha value. -") plgcolbga +") +plgcolbga; %feature( "docstring", "Get the current device-compression setting @@ -1351,7 +1384,8 @@ compression (PLINT *, output) : Pointer to a variable to be filled with the current device-compression setting. -") plgcompression +") +plgcompression; %feature( "docstring", "Get the current device (keyword) name @@ -1373,7 +1407,8 @@ ARGUMENTS: p_dev (char *, output) : Pointer to device (keyword) name string. -") plgdev +") +plgdev; %feature( "docstring", "Get parameters that define current device-space window @@ -1403,7 +1438,8 @@ p_jx (PLFLT *, output) : Pointer to relative justification in x. p_jy (PLFLT *, output) : Pointer to relative justification in y. -") plgdidev +") +plgdidev; %feature( "docstring", "Get plot orientation @@ -1430,7 +1466,8 @@ ARGUMENTS: p_rot (PLFLT *, output) : Pointer to orientation parameter. -") plgdiori +") +plgdiori; %feature( "docstring", "Get parameters that define current plot-space window @@ -1459,7 +1496,8 @@ p_xmax (PLFLT *, output) : Pointer to relative maximum in x. p_ymax (PLFLT *, output) : Pointer to relative maximum in y. -") plgdiplt +") +plgdiplt; %feature( "docstring", "Get family file parameters @@ -1488,7 +1526,8 @@ bmax (PLINT *, output) : Pointer to variable with the maximum file size (in bytes) for a family file. -") plgfam +") +plgfam; %feature( "docstring", "Get FCI (font characterization integer) @@ -1511,7 +1550,8 @@ fci (PLUNICODE *, output) : Pointer to PLUNICODE (unsigned 32-bit integer) variable which is updated with current FCI value. -") plgfci +") +plgfci; %feature( "docstring", "Get output file name @@ -1533,7 +1573,8 @@ fnam (char *, output) : Pointer to file name string (a preallocated string of 80 characters or more). -") plgfnam +") +plgfnam; %feature( "docstring", "Get family, style and weight of the current font @@ -1571,7 +1612,8 @@ constants in plplot.h. Current options are PL_FCI_MEDIUM and PL_FCI_BOLD. If p_weight is NULL then the font weight is not returned. -") plgfont +") +plgfont; %feature( "docstring", "Get the (current) run level @@ -1596,7 +1638,8 @@ ARGUMENTS: p_level (PLINT *, output) : Pointer to the run level. -") plglevel +") +plglevel; %feature( "docstring", "Get page parameters @@ -1630,7 +1673,8 @@ xoff (PLINT *, output) : Pointer to x page offset. yoff (PLINT *, output) : Pointer to y page offset. -") plgpage +") +plgpage; %feature( "docstring", "Switch to graphics screen @@ -1653,7 +1697,8 @@ SYNOPSIS: plgra() -") plgra +") +plgra; %feature( "docstring", "Draw linear gradient inside polygon @@ -1699,7 +1744,8 @@ angle (PLFLT, input) : Angle (degrees) of gradient vector from x axis. -") plgradient +") +plgradient; %feature( "docstring", "Grid data from irregularly sampled data @@ -1776,7 +1822,8 @@ the approximation. GRID_NNI, only weights greater than data will be accepted. If 0, all weights will be accepted. -") plgriddata +") +plgriddata; %feature( "docstring", "Get current subpage parameters @@ -1810,7 +1857,8 @@ ymax (PLFLT *, output) : Pointer to variable with position of top edge of subpage in millimeters. -") plgspa +") +plgspa; %feature( "docstring", "Get current stream number @@ -1831,7 +1879,8 @@ ARGUMENTS: strm (PLINT *, output) : Pointer to current stream value. -") plgstrm +") +plgstrm; %feature( "docstring", "Get the current library version number @@ -1854,7 +1903,8 @@ p_ver (char *, output) : Pointer to the current library version number. -") plgver +") +plgver; %feature( "docstring", "Get viewport limits in normalized device coordinates @@ -1887,7 +1937,8 @@ p_ymax (PLFLT *, output) : Upper viewport limit of the normalized device coordinate in y. -") plgvpd +") +plgvpd; %feature( "docstring", "Get viewport limits in world coordinates @@ -1920,7 +1971,8 @@ p_ymax (PLFLT *, output) : Upper viewport limit of the world coordinate in y. -") plgvpw +") +plgvpw; %feature( "docstring", "Get x axis parameters @@ -1951,7 +2003,8 @@ digits (PLINT *, output) : Pointer to variable with the actual number of digits for the numeric labels (x axis) from the last plot. -") plgxax +") +plgxax; %feature( "docstring", "Get y axis parameters @@ -1980,7 +2033,8 @@ digits (PLINT *, output) : Pointer to variable with the actual number of digits for the numeric labels (y axis) from the last plot. -") plgyax +") +plgyax; %feature( "docstring", "Get z axis parameters @@ -2009,7 +2063,8 @@ digits (PLINT *, output) : Pointer to variable with the actual number of digits for the numeric labels (z axis) from the last plot. -") plgzax +") +plgzax; %feature( "docstring", "Plot a histogram from unbinned data @@ -2062,7 +2117,8 @@ size as the ones inside. opt=PL_HIST_NOEMPTY|...: Bins with zero height are not drawn (there is a gap for such bins). -") plhist +") +plhist; %feature( "docstring", "Convert HLS color to RGB @@ -2100,7 +2156,8 @@ p_b (PLFLT *, output) : Pointer to blue intensity (0.0-1.0) of the colour -") plhlsrgb +") +plhlsrgb; %feature( "docstring", "Plot a 2D matrix using color map1 @@ -2157,7 +2214,8 @@ pltr_data (PLPointer, input) : Extra parameter to help pass information to pltr0, pltr1, pltr2, or whatever routine is externally supplied. -") plimagefr +") +plimagefr; %feature( "docstring", "Plot a 2D matrix using color map1 with automatic colour adjustment @@ -2196,7 +2254,8 @@ Dxmin, Dxmax, Dymin, Dymax (PLFLT, input) : Plot only the window of points whose plot coordinates fall inside the window of (Dxmin, Dymin) to (Dxmax, Dymax). -") plimage +") +plimage; %feature( "docstring", "Initialize PLplot @@ -2223,7 +2282,8 @@ SYNOPSIS: plinit() -") plinit +") +plinit; %feature( "docstring", "Draw a line between two points @@ -2254,7 +2314,8 @@ x2 (PLFLT, input) : x coordinate of second point. y2 (PLFLT, input) : y coordinate of second point. -") pljoin +") +pljoin; %feature( "docstring", "Simple routine to write labels @@ -2279,7 +2340,8 @@ ylabel (const char *, input) : Label for vertical axis. tlabel (const char *, input) : Title of graph. -") pllab +") +pllab; %feature( "docstring", "Create a discrete annotated legend using colored boxes, lines, and/or lines of symbols @@ -2469,7 +2531,8 @@ symbols (const char **, input) : Array of nlegend symbols (plpoin indices) ( PL_LEGEND_SYMBOL). -") pllegend +") +pllegend; %feature( "docstring", "Sets the 3D position of the light source @@ -2494,7 +2557,8 @@ y (PLFLT, input) : Y-coordinate of the light source. z (PLFLT, input) : Z-coordinate of the light source. -") pllightsource +") +pllightsource; %feature( "docstring", "Draw a line @@ -2519,7 +2583,8 @@ x (PLFLT *, input) : Pointer to array with x coordinates of points. y (PLFLT *, input) : Pointer to array with y coordinates of points. -") plline +") +plline; %feature( "docstring", "Draw a line in 3 space @@ -2549,7 +2614,8 @@ y (PLFLT *, input) : Pointer to array with y coordinates of points. z (PLFLT *, input) : Pointer to array with z coordinates of points. -") plline3 +") +plline3; %feature( "docstring", "Select line style @@ -2574,7 +2640,8 @@ continuous line, line style 2 is a line with short dashes and gaps, line style 3 is a line with long dashes and gaps, line style 4 has long dashes and short gaps and so on. -") pllsty +") +pllsty; %feature( "docstring", "Plot continental outline in world coordinates. @@ -2634,7 +2701,8 @@ maxlat (PLFLT, input) : The maximum latitudes to be plotted on the background. One can always use 90.0 as the boundary outside the plot window will be automatically eliminated. -") plmap +") +plmap; %feature( "docstring", "Plot latitude and longitude lines. @@ -2691,7 +2759,8 @@ maxlat (PLFLT, input) : The maximum latitudes to be plotted on the background. One can always use 90.0 as the boundary outside the plot window will be automatically eliminated. -") plmeridians +") +plmeridians; %feature( "docstring", "Plot surface mesh @@ -2741,7 +2810,8 @@ for each value of x[i]. opt=DRAW_LINEXY: Network of lines is drawn connecting points at which function is defined. -") plmesh +") +plmesh; %feature( "docstring", "Magnitude colored plot surface mesh with contour. @@ -2802,7 +2872,8 @@ contour level spacing. nlevel (PLINT, input) : Number of elements in the clevel array. -") plmeshc +") +plmeshc; %feature( "docstring", "Creates a new stream and makes it the default @@ -2830,7 +2901,8 @@ p_strm (PLINT *, output) : Pointer to stream number of the created stream. -") plmkstrm +") +plmkstrm; %feature( "docstring", "Write text relative to viewport boundaries @@ -2885,7 +2957,8 @@ values of just give intermediate justifications. text (const char *, input) : The string to be written out. -") plmtex +") +plmtex; %feature( "docstring", "Write text relative to viewport boundaries in 3D plots. @@ -2940,7 +3013,8 @@ values of just give intermediate justifications. text (const char *, input) : The string to be written out. -") plmtex3 +") +plmtex3; %feature( "docstring", "Plot 3-d surface plot @@ -2997,7 +3071,8 @@ side (PLBOOL, input) : Flag to indicate whether or not ``sides'' should be draw on the figure. If side is true sides are drawn, otherwise no sides are drawn. -") plot3d +") +plot3d; %feature( "docstring", "Magnitude colored plot surface with contour. @@ -3022,7 +3097,8 @@ SYNOPSIS: plot3dc(x, y, z, nx, ny, opt, clevel, nlevel) -") plot3dc +") +plot3dc; %feature( "docstring", "Parse command-line arguments @@ -3044,7 +3120,7 @@ non-option command line argument is found. Returns with the return code of the option handler, if one was called. Deletes command line arguments from argv list as they are found, and decrements argc - accordingly. Does not show "invisible" options in usage or help + accordingly. Does not show \"invisible\" options in usage or help messages. Assumes the program name is contained in argv[0]. These behaviors may be controlled through the @@ -3084,7 +3160,8 @@ PL_PARSE_NODASH (64) -- Set if leading dash is NOT required. PL_PARSE_SKIP (128) -- Set to quietly skip over any unrecognized arguments. -") plparseopts +") +plparseopts; %feature( "docstring", "Set area fill pattern @@ -3121,7 +3198,8 @@ del (PLINT *, input) : Pointer to array with nlin elements. Specifies the spacing in micrometers between the lines making up the pattern. -") plpat +") +plpat; %feature( "docstring", "Draw a line between two points, accounting for coordinate transforms. @@ -3156,7 +3234,8 @@ x2 (PLFLT, input) : x coordinate of second point. y2 (PLFLT, input) : y coordinate of second point. -") plpath +") +plpath; %feature( "docstring", "Plot a glyph at the specified points @@ -3170,7 +3249,7 @@ same place. Not ideal, since a sufficiently intelligent output device may optimize it away, or there may be faster ways of doing it. This is OK for now, though, and offers a 4X speedup over drawing a Hershey - font "point" (which is actually diamond shaped and therefore takes 4 + font \"point\" (which is actually diamond shaped and therefore takes 4 strokes to draw). If 0 < code < 32, then a useful (but small subset) of Hershey symbols is plotted. If 32 <= code <= 127 the corresponding printable ASCII character is plotted. @@ -3197,7 +3276,8 @@ code (PLINT, input) : Hershey symbol code corresponding to a glyph to be plotted at each of the n points. -") plpoin +") +plpoin; %feature( "docstring", "Plot a glyph at the specified 3D points @@ -3210,7 +3290,7 @@ a point. Right now it's just a move and a draw at the same place. Not ideal, since a sufficiently intelligent output device may optimize it away, or there may be faster ways of doing it. This is OK for now, - though, and offers a 4X speedup over drawing a Hershey font "point" + though, and offers a 4X speedup over drawing a Hershey font \"point\" (which is actually diamond shaped and therefore takes 4 strokes to draw). If 0 < code < 32, then a useful (but small subset) of Hershey symbols is plotted. If 32 <= code <= 127 the corresponding printable @@ -3242,7 +3322,8 @@ code (PLINT, input) : Hershey symbol code (in \"ascii-indexed\" form with -1 <= code <= 127) corresponding to a glyph to be plotted at each of the n points. -") plpoin3 +") +plpoin3; %feature( "docstring", "Draw a polygon in 3 space @@ -3297,7 +3378,8 @@ counter-clockwise order. Otherwise, the directionality of the polygon is determined by assuming the points are laid out in a clockwise order. -") plpoly3 +") +plpoly3; %feature( "docstring", "Set precision in numeric labels @@ -3324,7 +3406,8 @@ prec (PLINT, input) : The number of characters to draw after the decimal point in numeric labels. -") plprec +") +plprec; %feature( "docstring", "Select area fill pattern @@ -3348,7 +3431,8 @@ n (PLINT, input) : The desired pattern. Pattern 1 consists of horizontal lines, pattern 2 consists of vertical lines, pattern 3 consists of lines at 45 degrees angle (upward), and so on. -") plpsty +") +plpsty; %feature( "docstring", "Write text inside the viewport @@ -3400,7 +3484,8 @@ values of just give intermediate justifications. text (const char *, input) : The string to be written out. -") plptex +") +plptex; %feature( "docstring", "Write text inside the viewport of a 3D plot. @@ -3482,7 +3567,8 @@ values of just give intermediate justifications. text (const char *, input) : The string to be written out. -") plptex3 +") +plptex3; %feature( "docstring", "Random number generator returning a real random number in the range [0,1]. @@ -3505,7 +3591,8 @@ SYNOPSIS: plrandd() -") plrandd +") +plrandd; %feature( "docstring", "Replays contents of plot buffer to current device/file @@ -3522,7 +3609,8 @@ SYNOPSIS: plreplot() -") plreplot +") +plreplot; %feature( "docstring", "Convert RGB color to HLS @@ -3558,7 +3646,8 @@ p_s (PLFLT *, output) : Pointer to saturation, expressed as a fraction of the radius of the colour cone (0.0-1.0) -") plrgbhls +") +plrgbhls; %feature( "docstring", "Set character size @@ -3586,7 +3675,8 @@ scale (PLFLT, input) : Scale factor to be applied to default to get actual character height. -") plschr +") +plschr; %feature( "docstring", "Set color map0 colors by 8-bit RGB values @@ -3618,7 +3708,8 @@ integers (0-255) representing the degree of blue in the color. ncol0 (PLINT, input) : Number of items in the r, g, and b arrays. -") plscmap0 +") +plscmap0; %feature( "docstring", "Set color map0 colors by 8-bit RGB values and double alpha value. @@ -3652,7 +3743,8 @@ ncol0 (PLINT, input) : Number of items in the r, g, b, and a arrays. -") plscmap0a +") +plscmap0a; %feature( "docstring", "Set number of colors in color map0 @@ -3682,7 +3774,8 @@ the map0 palette. If this number is zero or less, then the value from the previous call to plscmap0n is used and if there is no previous call, then a default value is used. -") plscmap0n +") +plscmap0n; %feature( "docstring", "Set color map1 colors using 8-bit RGB values @@ -3713,7 +3806,8 @@ integers (0-255) representing the degree of blue in the color. ncol1 (PLINT, input) : Number of items in the r, g, and b arrays. -") plscmap1 +") +plscmap1; %feature( "docstring", "Set color map1 colors using 8-bit RGB values and double alpha values. @@ -3747,7 +3841,8 @@ ncol1 (PLINT, input) : Number of items in the r, g, b, and a arrays. -") plscmap1a +") +plscmap1a; %feature( "docstring", "Set color map1 colors using a piece-wise linear relationship @@ -3779,8 +3874,8 @@ three coordinates in HLS or RGB space. The first point must correspond to position = 0, and the last to position = 1. - The hue is interpolated around the "front" of the color wheel - (red<->green<->blue<->red) unless the "rev" flag is set to true, in + The hue is interpolated around the \"front\" of the color wheel + (red<->green<->blue<->red) unless the \"rev\" flag is set to true, in which case interpolation (between the i and i + 1 control point for rev[i]) proceeds around the back (reverse) side. Specifying rev=NULL is equivalent to setting rev[]= false for every control point. @@ -3820,7 +3915,8 @@ rev (PLBOOL: *, input) : reverse flag for each control point. (rev[i] refers to the interpolation interval between the i and i + 1 control points). -") plscmap1l +") +plscmap1l; %feature( "docstring", "Set color map1 colors using a piece-wise linear relationship @@ -3864,7 +3960,8 @@ rev (PLBOOL: *, input) : reverse flag for each control point. (rev[i] refers to the interpolation interval between the i and i + 1 control points). -") plscmap1la +") +plscmap1la; %feature( "docstring", "Set number of colors in color map1 @@ -3890,7 +3987,8 @@ the map1 palette. If this number is zero or less, then the value from the previous call to plscmap1n is used and if there is no previous call, then a default value is used. -") plscmap1n +") +plscmap1n; %feature( "docstring", " Set a given color from color map0 by 8 bit RGB value @@ -3925,7 +4023,8 @@ b (PLINT, input) : Unsigned 8-bit integer (0-255) representing the degree of blue in the color. -") plscol0 +") +plscol0; %feature( "docstring", " Set a given color from color map0 by 8 bit RGB value and double alpha value. @@ -3961,7 +4060,8 @@ a (PLFLT, input) : double value (0.0-1.0) representing the alpha value of the color. -") plscol0a +") +plscol0a; %feature( "docstring", "Set the background color by 8-bit RGB value @@ -3990,7 +4090,8 @@ b (PLINT, input) : Unsigned 8-bit integer (0-255) representing the degree of blue in the color. -") plscolbg +") +plscolbg; %feature( "docstring", "Set the background color by 8-bit RGB value and double alpha value. @@ -4020,7 +4121,8 @@ a (PLFLT, input) : double value (0.0-1.0) representing the alpha value of the color. -") plscolbga +") +plscolbga; %feature( "docstring", "Used to globally turn color output on/off @@ -4043,7 +4145,8 @@ color (PLINT, input) : Color flag (Boolean). If zero, color is turned off. If non-zero, color is turned on. -") plscolor +") +plscolor; %feature( "docstring", "Set device-compression level @@ -4076,7 +4179,8 @@ compression level. Higher compression levels correspond to greater compression and small file sizes at the expense of more computation. -") plscompression +") +plscompression; %feature( "docstring", "Set the device (keyword) name @@ -4098,7 +4202,8 @@ devname (const char *, input) : Pointer to device (keyword) name string. -") plsdev +") +plsdev; %feature( "docstring", "Set parameters that define current device-space window @@ -4133,7 +4238,8 @@ jy (PLFLT, input) : Relative justification in y. Value must lie in the range -0.5 to 0.5. -") plsdidev +") +plsdidev; %feature( "docstring", "Set up transformation from metafile coordinates @@ -4168,7 +4274,8 @@ dimxpmm (PLFLT, input) : NEEDS DOCUMENTATION dimypmm (PLFLT, input) : NEEDS DOCUMENTATION -") plsdimap +") +plsdimap; %feature( "docstring", "Set plot orientation @@ -4203,7 +4310,8 @@ ARGUMENTS: rot (PLFLT, input) : Plot orientation parameter. -") plsdiori +") +plsdiori; %feature( "docstring", "Set parameters that define current plot-space window @@ -4232,7 +4340,8 @@ xmax (PLFLT, input) : Relative maximum in x. ymax (PLFLT, input) : Relative maximum in y. -") plsdiplt +") +plsdiplt; %feature( "docstring", "Set parameters incrementally (zoom mode) that define current plot-space window @@ -4265,7 +4374,8 @@ xmax (PLFLT, input) : Relative (incremental) maximum in x. ymax (PLFLT, input) : Relative (incremental) maximum in y. -") plsdiplz +") +plsdiplz; %feature( "docstring", "Set seed for internal random number generator. @@ -4287,7 +4397,8 @@ ARGUMENTS: seed (unsigned int, input) : Seed for random number generator. -") plseed +") +plseed; %feature( "docstring", "Set the escape character for text strings @@ -4325,7 +4436,8 @@ ARGUMENTS: esc (char, input) : Escape character. -") plsesc +") +plsesc; %feature( "docstring", "Set any command-line option @@ -4354,7 +4466,8 @@ optarg (const char *, input) : Pointer to string containing the argument of the command-line option. -") plsetopt +") +plsetopt; %feature( "docstring", "Set family file parameters @@ -4384,7 +4497,8 @@ bmax (PLINT, input) : Maximum file size (in bytes) for a family file. -") plsfam +") +plsfam; %feature( "docstring", "Set FCI (font characterization integer) @@ -4410,7 +4524,8 @@ fci (PLUNICODE, input) : PLUNICODE (unsigned 32-bit integer) value of FCI. -") plsfci +") +plsfci; %feature( "docstring", "Set output file name @@ -4435,7 +4550,8 @@ ARGUMENTS: fnam (const char *, input) : Pointer to file name string. -") plsfnam +") +plsfnam; %feature( "docstring", "Set family, style and weight of the current font @@ -4473,7 +4589,8 @@ plplot.h. Current options are PL_FCI_MEDIUM and PL_FCI_BOLD. A negative value signifies that the font weight should not be altered. -") plsfont +") +plsfont; %feature( "docstring", "Shade regions on the basis of value @@ -4580,7 +4697,8 @@ pltr_data (PLPointer, input) : Extra parameter to help pass information to pltr0, pltr1, pltr2, or whatever routine that is externally supplied. -") plshades +") +plshades; %feature( "docstring", " Shade individual region on the basis of value @@ -4648,7 +4766,8 @@ pltr (void (*) (PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer) , input) : pltr_data (PLPointer, input) : -") plshade +") +plshade; %feature( "docstring", "Shade individual region on the basis of value @@ -4772,7 +4891,8 @@ pltr_data (PLPointer, input) : Extra parameter to help pass information to pltr0, pltr1, pltr2, or whatever routine that is externally supplied. -") plshade1 +") +plshade1; %feature( "docstring", "Assign a function to use for generating custom axis labels @@ -4810,7 +4930,8 @@ label_data (void *, input) : This parameter may be used to pass data to the label_func function. -") plslabelfunc +") +plslabelfunc; %feature( "docstring", "Set length of major ticks @@ -4838,7 +4959,8 @@ scale (PLFLT, input) : Scale factor to be applied to default to get actual tick length. -") plsmaj +") +plsmaj; %feature( "docstring", "Set the memory area to be plotted (RGB) @@ -4871,7 +4993,8 @@ plotmem (void *, input) : Pointer to the beginning of the user-supplied memory area. -") plsmem +") +plsmem; %feature( "docstring", "Set the memory area to be plotted (RGBA) @@ -4904,7 +5027,8 @@ plotmem (void *, input) : Pointer to the beginning of the user-supplied memory area. -") plsmema +") +plsmema; %feature( "docstring", "Set length of minor ticks @@ -4932,7 +5056,8 @@ scale (PLFLT, input) : Scale factor to be applied to default to get actual tick length. -") plsmin +") +plsmin; %feature( "docstring", "Set orientation @@ -4957,7 +5082,8 @@ ori (PLINT, input) : Orientation value (0 for landscape, 1 for portrait, etc.) The value is multiplied by 90 degrees to get the angle. -") plsori +") +plsori; %feature( "docstring", "Set page parameters @@ -4996,7 +5122,8 @@ xoff (PLINT, input) : Page offset, x. yoff (PLINT, input) : Page offset, y. -") plspage +") +plspage; %feature( "docstring", "Set the colors for color table 0 from a cmap0 file @@ -5018,7 +5145,8 @@ filename (const char *, input) : The name of the cmap0 file, or a empty to string to specify the default cmap0 file. -") plspal0 +") +plspal0; %feature( "docstring", "Set the colors for color table 1 from a cmap1 file @@ -5040,7 +5168,8 @@ filename (const char *, input) : The name of the cmap1 file, or a empty to string to specify the default cmap1 file. -") plspal1 +") +plspal1; %feature( "docstring", "Set the pause (on end-of-page) status @@ -5063,7 +5192,8 @@ pause (PLBOOL, input) : If pause is true there will be a pause on end-of-page for those drivers which support this. Otherwise there is no pause. -") plspause +") +plspause; %feature( "docstring", "Set current output stream @@ -5086,7 +5216,8 @@ ARGUMENTS: strm (PLINT, input) : The current stream number. -") plsstrm +") +plsstrm; %feature( "docstring", "Set the number of subpages in x and y @@ -5111,7 +5242,8 @@ ny (PLINT, input) : Number of windows in y direction (i.e., number of window rows). -") plssub +") +plssub; %feature( "docstring", "Set symbol size @@ -5139,7 +5271,8 @@ scale (PLFLT, input) : Scale factor to be applied to default to get actual symbol height. -") plssym +") +plssym; %feature( "docstring", "Initialization @@ -5170,7 +5303,8 @@ ny (PLINT, input) : Number of subpages to divide output page in the vertical direction. -") plstar +") +plstar; %feature( "docstring", "Initialization @@ -5208,7 +5342,8 @@ ny (PLINT, input) : Number of subpages to divide output page in the vertical direction. -") plstart +") +plstart; %feature( "docstring", "Set a global coordinate transform function @@ -5239,7 +5374,8 @@ data (PLPointer, input) : Optional extra data for transform_fun. -") plstransform +") +plstransform; %feature( "docstring", "Plot a glyph at the specified points @@ -5277,7 +5413,8 @@ string (const char *, input) : PLplot user string corresponding to the glyph to be plotted at each of the n points. -") plstring +") +plstring; %feature( "docstring", "Add a point to a stripchart @@ -5307,7 +5444,8 @@ x (PLFLT, input) : X coordinate of point to plot. y (PLFLT, input) : Y coordinate of point to plot. -") plstripa +") +plstripa; %feature( "docstring", "Create a 4-pen stripchart @@ -5384,7 +5522,8 @@ laby (char *, input) : Y-axis label. labtop (char *, input) : Plot title. -") plstripc +") +plstripc; %feature( "docstring", "Deletes and releases memory used by a stripchart @@ -5405,7 +5544,8 @@ ARGUMENTS: id (PLINT, input) : Identification number of stripchart to delete. -") plstripd +") +plstripd; %feature( "docstring", "Set line style @@ -5439,7 +5579,8 @@ space (PLINT *, input) : Pointer to array with the lengths of the segments during which the pen is up, measured in micrometers. -") plstyl +") +plstyl; %feature( "docstring", "Plot shaded 3-d surface plot @@ -5507,7 +5648,8 @@ contour level spacing. nlevel (PLINT, input) : Number of elements in the clevel array. -") plsurf3d +") +plsurf3d; %feature( "docstring", "Plot shaded 3-d surface plot @@ -5582,7 +5724,8 @@ contour level spacing. nlevel (PLINT, input) : Number of elements in the clevel array. -") plfsurf3d +") +plfsurf3d; %feature( "docstring", "Set arrow style for vector plots @@ -5613,7 +5756,8 @@ fill (PLBOOL,input) : If fill is true then the arrow is closed, if fill is false then the arrow is open. -") plsvect +") +plsvect; %feature( "docstring", "Specify viewport in absolute coordinates @@ -5647,7 +5791,8 @@ ymax (PLFLT, input) : The distance of the top edge of the viewport from the bottom edge of the subpage in millimeters. -") plsvpa +") +plsvpa; %feature( "docstring", "Set x axis parameters @@ -5677,7 +5822,8 @@ its value here has no effect since it is set only by plbox or plbox3. However, the user may obtain its value after a call to either of these functions by calling plgxax. -") plsxax +") +plsxax; %feature( "docstring", "Set y axis parameters @@ -5707,7 +5853,8 @@ its value here has no effect since it is set only by plbox or plbox3. However, the user may obtain its value after a call to either of these functions by calling plgyax. -") plsyax +") +plsyax; %feature( "docstring", "Plot a glyph at the specified points @@ -5741,7 +5888,8 @@ code (PLINT, input) : Hershey symbol code corresponding to a glyph to be plotted at each of the n points. -") plsym +") +plsym; %feature( "docstring", "Set z axis parameters @@ -5771,7 +5919,8 @@ its value here has no effect since it is set only by plbox or plbox3. However, the user may obtain its value after a call to either of these functions by calling plgzax. -") plszax +") +plszax; %feature( "docstring", "Switch to text screen @@ -5798,7 +5947,8 @@ SYNOPSIS: pltext() -") pltext +") +pltext; %feature( "docstring", "Set format for date / time labels @@ -5834,7 +5984,8 @@ %S: The second as a decimal number. %y: The year as a decimal number without a century. %Y: The year as a decimal number including a century. -") pltimefmt +") +pltimefmt; %feature( "docstring", "Specify viewport using aspect ratio only @@ -5857,7 +6008,8 @@ aspect (PLFLT, input) : Ratio of length of y axis to length of x axis. -") plvasp +") +plvasp; %feature( "docstring", "Vector plot @@ -5914,7 +6066,8 @@ pltr_data (PLPointer, input) : Extra parameter to help pass information to pltr0, pltr1, pltr2, or whatever routine that is externally supplied. -") plvect +") +plvect; %feature( "docstring", "Specify viewport using coordinates and aspect ratio @@ -5953,7 +6106,8 @@ aspect (PLFLT, input) : Ratio of length of y axis to length of x axis. -") plvpas +") +plvpas; %feature( "docstring", "Specify viewport using coordinates @@ -5989,7 +6143,8 @@ ymax (PLFLT, input) : The normalized subpage coordinate of the top edge of the viewport. -") plvpor +") +plvpor; %feature( "docstring", "Select standard viewport @@ -6008,7 +6163,8 @@ SYNOPSIS: plvsta() -") plvsta +") +plvsta; %feature( "docstring", "Set up window for 3-d plotting @@ -6067,7 +6223,8 @@ observer is looking face onto the ZX plane, and as az is increased, the observer moves clockwise around the box when viewed from above the XY plane. -") plw3d +") +plw3d; %feature( "docstring", "Set pen width @@ -6092,7 +6249,8 @@ should be interpreted as as the minimum valid pen width for the device. The interpretation of positive width values is also device dependent. -") plwid +") +plwid; %feature( "docstring", "Specify world coordinates of viewport boundaries @@ -6123,7 +6281,8 @@ ymax (PLFLT, input) : The world y coordinate of the top edge of the viewport. -") plwind +") +plwind; %feature( "docstring", "Enter or leave xor mode @@ -6151,5 +6310,6 @@ status (PLBOOL *, output) : Pointer to status. Returned modestatus of true (false) means driver is capable (incapable) of xor mode. -") plxormod +") +plxormod; Modified: trunk/doc/docbook/bin/api2swigdoc.pl =================================================================== --- trunk/doc/docbook/bin/api2swigdoc.pl 2011-01-11 23:26:42 UTC (rev 11484) +++ trunk/doc/docbook/bin/api2swigdoc.pl 2011-01-12 00:22:44 UTC (rev 11485) @@ -196,7 +196,6 @@ } } } - #$desc = wrap ($indent, $indent, split(/\n\s*\n/, $desc)); $varlist = join ("\n", map { s/\t/ /g; /(^\s+)/; @@ -209,13 +208,14 @@ # part of the raw title in api.xml. $title =~s/^.*: //; - # Escape double quotes in arguments + # Escape double quotes in description and arguments + $desc =~ s/\"/\\"/g; $varlist =~ s/\"/\\"/g; print MAN "%feature( \"docstring\", \"$title\n"; print MAN "\nDESCRIPTION:\n\n$desc\n"; print MAN "\nSYNOPSIS:\n\n$synopsis\n"; print MAN "\nARGUMENTS:\n\n$varlist\n" if not $varlist eq ""; - print MAN "\") $name\n\n"; + print MAN "\")\n$name;\n\n"; } close MAN; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2011-01-12 14:04:56
|
Revision: 11490 http://plplot.svn.sourceforge.net/plplot/?rev=11490&view=rev Author: andrewross Date: 2011-01-12 14:04:49 +0000 (Wed, 12 Jan 2011) Log Message: ----------- Add java version of example 33. Java examples now produce identical results to the C examples. Modified Paths: -------------- trunk/examples/java/CMakeLists.txt trunk/plplot_test/test_java.sh.in Added Paths: ----------- trunk/examples/java/x33.java Modified: trunk/examples/java/CMakeLists.txt =================================================================== --- trunk/examples/java/CMakeLists.txt 2011-01-12 05:07:12 UTC (rev 11489) +++ trunk/examples/java/CMakeLists.txt 2011-01-12 14:04:49 UTC (rev 11490) @@ -56,6 +56,7 @@ "29" "30" "31" + "33" ) if(CORE_BUILD) Added: trunk/examples/java/x33.java =================================================================== --- trunk/examples/java/x33.java (rev 0) +++ trunk/examples/java/x33.java 2011-01-12 14:04:49 UTC (rev 11490) @@ -0,0 +1,841 @@ +// -*- coding: utf-8; -*- +// +// $Id$ +// +// Demonstrate most pllegend capability including unicode symbols. +// +// Copyright (C) 2010 Alan Irwin +// Copyright (C) 2011 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 General Library Public License as published +// by the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// PLplot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public License +// along with PLplot; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// + +// This example designed just for devices (e.g., the cairo-related and +// qt-related devices) where the best choice of glyph is automatically +// selected by the related libraries (pango/cairo or Qt4) for each +// unicode character depending on what system fonts are installed. Of +// course, you must have the appropriate TrueType fonts installed to +// have access to all the required glyphs. + +package plplot.examples; + +import plplot.core.*; + +import java.lang.Math; +import java.text.*; + +class x33 { + + PLStream pls = new PLStream(); + + public static void main( String[] args ) + { + new x33( args ); + } + + + static String[] special_symbols = { + "✰", + "✴", + "✱", + "✽", + "✦" + }; + + void plcolorbar_example_1( int bar_type, double ticks, int sub_ticks, int n, double[] values, String title ) +{ + pls.adv( 0 ); + // Setup color palette 1 + pls.spal1( "cmap1_blue_red.pal", true ); + + double[] colors = new double[n]; + int i; + double color_step; + color_step = 1.0 / (double) ( n - 1 ); + for ( i = 0; i < n; i++ ) + { + colors[i] = 0.0 + color_step * (double) ( i ); + } + + int opt; + opt = PLStream.PL_COLORBAR_LEFT | bar_type | PLStream.PL_COLORBAR_LABEL_LEFT | + PLStream.PL_COLORBAR_CAP_HIGH; + + String axis_opts_1, axis_opts_2; + if ( (bar_type & PLStream.PL_COLORBAR_SHADE_LABEL ) > 0 ) + { + axis_opts_1 = "iv"; + axis_opts_2 = "i"; + } + else + { + if ( sub_ticks != 0 ) + { + axis_opts_1 = "stv"; + axis_opts_2 = "st"; + } + else + { + axis_opts_1 = "tv"; + axis_opts_2 = "t"; + } + } + + pls.colorbar( opt, 0.1, 0.1, 0.5, 0.1, + ticks, sub_ticks, + axis_opts_1, "Test label - Left, High Cap", + colors, values ); + + opt = PLStream.PL_COLORBAR_RIGHT | bar_type | PLStream.PL_COLORBAR_LABEL_RIGHT | + PLStream.PL_COLORBAR_CAP_LOW; + + pls.colorbar( opt, 0.1, 0.4, 0.5, 0.1, + ticks, sub_ticks, + axis_opts_1, "Test label - Right, Low Cap", + colors, values ); + + opt = PLStream.PL_COLORBAR_UPPER | bar_type | PLStream.PL_COLORBAR_LABEL_UPPER | + PLStream.PL_COLORBAR_CAP_HIGH; + + pls.colorbar( opt, 0.1, 0.1, 0.5, 0.1, + ticks, sub_ticks, + axis_opts_2, "Test label - Upper, High Cap", + colors, values ); + + opt = PLStream.PL_COLORBAR_LOWER | bar_type | PLStream.PL_COLORBAR_LABEL_LOWER | + PLStream.PL_COLORBAR_CAP_LOW; + + pls.colorbar( opt, 0.4, 0.1, 0.5, 0.1, + ticks, sub_ticks, + axis_opts_2, "Test label - Lower, Low Cap", + colors, values ); + + pls.vpor( 0.0, 1.0, 0.0, 1.0 ); + pls.wind( 0.0, 1.0, 0.0, 1.0 ); + pls.ptex( 0.5, 0.5, 0.0, 0.0, 0.5, title ); +} + +void plcolorbar_example_2( int bar_type, double ticks, double sub_ticks, int n, double[] values, String title ) +{ + pls.adv( 0 ); + // Setup color palette 1 + pls.spal1( "cmap1_blue_yellow.pal", true ); + + double[] colors = new double[n]; + int i; + double color_step; + color_step = 1.0 / (double) ( n - 1 ); + for ( i = 0; i < n; i++ ) + { + colors[i] = 0.0 + color_step * (double) ( i ); + } + + int opt; + opt = PLStream.PL_COLORBAR_LEFT | bar_type | PLStream.PL_COLORBAR_LABEL_LEFT | + PLStream.PL_COLORBAR_CAP_LOW; + + String axis_opts_1, axis_opts_2; + if ( bar_type == PLStream.PL_COLORBAR_SHADE_LABEL ) + { + axis_opts_1 = ""; + axis_opts_2 = ""; + } + else + { + if ( sub_ticks != 0 ) + { + axis_opts_1 = "stv"; + axis_opts_2 = "st"; + } + else + { + axis_opts_1 = "tv"; + axis_opts_2 = "t"; + } + } + + pls.colorbar( opt, 0.1, 0.1, 0.5, 0.1, + ticks, sub_ticks, + axis_opts_1, "Test label - Left, Low Cap", + colors, values ); + + opt = PLStream.PL_COLORBAR_RIGHT | bar_type | PLStream.PL_COLORBAR_LABEL_RIGHT | + PLStream.PL_COLORBAR_CAP_HIGH; + + pls.colorbar( opt, 0.1, 0.4, 0.5, 0.1, + ticks, sub_ticks, + axis_opts_1, "Test label - Right, High Cap", + colors, values ); + + opt = PLStream.PL_COLORBAR_UPPER | bar_type | PLStream.PL_COLORBAR_LABEL_UPPER | + PLStream.PL_COLORBAR_CAP_LOW; + + pls.colorbar( opt, 0.1, 0.1, 0.5, 0.1, + ticks, sub_ticks, + axis_opts_2, "Test label - Upper, Low Cap", + colors, values ); + + opt = PLStream.PL_COLORBAR_LOWER | bar_type | PLStream.PL_COLORBAR_LABEL_LOWER | + PLStream.PL_COLORBAR_CAP_HIGH; + + pls.colorbar( opt, 0.4, 0.1, 0.5, 0.1, + ticks, sub_ticks, + axis_opts_2, "Test label - Lower, High Cap", + colors, values ); + + pls.vpor( 0.0, 1.0, 0.0, 1.0 ); + pls.wind( 0.0, 1.0, 0.0, 1.0 ); + pls.ptex( 0.5, 0.5, 0.0, 0.0, 0.5, title ); +} + +//-------------------------------------------------------------------------- +// x33 +// +// Demonstrate most pllegend capability including unicode symbols. +//-------------------------------------------------------------------------- + +public x33( String[] args ) +{ + int i, k; + int opt; + int nlegend, nturn; + int[] opt_array; + int[] text_colors; + int[] box_colors; + int[] box_patterns; + double[] box_scales; + int[] box_line_widths; + int[] line_colors; + int[] line_styles; + int[] line_widths; + int[] symbol_numbers; + int[] symbol_colors; + double[] symbol_scales; + String[] text; + String[] symbols; + double[] legend_width = new double[1], legend_height = new double[1]; + double x, y, xstart, ystart; + double max_height, text_scale; + int opt_base, nrow, ncolumn; + int[] position_options = { + PLStream.PL_LEGEND_LEFT | PLStream.PL_LEGEND_UPPER | PLStream.PL_LEGEND_OUTSIDE, + PLStream.PL_LEGEND_UPPER | PLStream.PL_LEGEND_OUTSIDE, + PLStream.PL_LEGEND_RIGHT | PLStream.PL_LEGEND_UPPER | PLStream.PL_LEGEND_OUTSIDE, + PLStream.PL_LEGEND_RIGHT | PLStream.PL_LEGEND_OUTSIDE, + PLStream.PL_LEGEND_RIGHT | PLStream.PL_LEGEND_LOWER | PLStream.PL_LEGEND_OUTSIDE, + PLStream.PL_LEGEND_LOWER | PLStream.PL_LEGEND_OUTSIDE, + PLStream.PL_LEGEND_LEFT | PLStream.PL_LEGEND_LOWER | PLStream.PL_LEGEND_OUTSIDE, + PLStream.PL_LEGEND_LEFT | PLStream.PL_LEGEND_OUTSIDE, + PLStream.PL_LEGEND_LEFT | PLStream.PL_LEGEND_UPPER | PLStream.PL_LEGEND_INSIDE, + PLStream.PL_LEGEND_UPPER | PLStream.PL_LEGEND_INSIDE, + PLStream.PL_LEGEND_RIGHT | PLStream.PL_LEGEND_UPPER | PLStream.PL_LEGEND_INSIDE, + PLStream.PL_LEGEND_RIGHT | PLStream.PL_LEGEND_INSIDE, + PLStream.PL_LEGEND_RIGHT | PLStream.PL_LEGEND_LOWER | PLStream.PL_LEGEND_INSIDE, + PLStream.PL_LEGEND_LOWER | PLStream.PL_LEGEND_INSIDE, + PLStream.PL_LEGEND_LEFT | PLStream.PL_LEGEND_LOWER | PLStream.PL_LEGEND_INSIDE, + PLStream.PL_LEGEND_LEFT | PLStream.PL_LEGEND_INSIDE + }; + + NumberFormat nf = NumberFormat.getNumberInstance(); + nf.setMinimumIntegerDigits(2); + + // Parse and process command line arguments + pls.parseopts( args, PLStream.PL_PARSE_FULL | PLStream.PL_PARSE_NOPROGRAM ); + + // Initialize plplot + pls.init(); + + // First page illustrating the 16 standard positions. + pls.adv( 0 ); + pls.vpor( 0.25, 0.75, 0.25, 0.75 ); + pls.wind( 0.0, 1.0, 0.0, 1.0 ); + pls.box( "bc", 0.0, 0, "bc", 0.0, 0 ); + pls.sfont( PLStream.PL_FCI_SANS, -1, -1 ); + pls.mtex( "t", 8.0, 0.5, 0.5, "The 16 standard legend positions with" ); + pls.mtex( "t", 6.0, 0.5, 0.5, "the same (0.05) offset in x and y" ); + + nlegend = 1; + opt_array = new int[nlegend]; + text_colors = new int[nlegend]; + line_colors = new int[nlegend]; + line_styles = new int[nlegend]; + line_widths = new int[nlegend]; + symbol_numbers = new int[nlegend]; + symbol_colors = new int[nlegend]; + symbol_scales = new double[nlegend]; + text = new String[nlegend]; + symbols = new String[nlegend]; + // Only specify legend data that are required according to the + // value of opt_array for that entry. + opt_base = PLStream.PL_LEGEND_BACKGROUND | PLStream.PL_LEGEND_BOUNDING_BOX; + opt_array[0] = PLStream.PL_LEGEND_LINE | PLStream.PL_LEGEND_SYMBOL; + line_styles[0] = 1; + line_widths[0] = 1; + symbol_scales[0] = 1.; + symbol_numbers[0] = 4; + symbols[0] = "*"; + + // Use monotype fonts so that all legends are the same size. + pls.sfont( PLStream.PL_FCI_MONO, -1, -1 ); + pls.scol0a( 15, 32, 32, 32, 0.70 ); + + for ( k = 0; k < 16; k++ ) + { + opt = opt_base | position_options[k]; + text[0] = nf.format( k ); + text_colors[0] = 1 + ( k % 8 ); + line_colors[0] = 1 + ( k % 8 ); + symbol_colors[0] = 1 + ( k % 8 ); + + pls.legend( legend_width, legend_height, opt, 0.05, 0.05, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, 1.0, 2.0, + 1., text_colors, text, + null, null, null, null, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + } + + // Second page illustrating effect of nrow, ncolumn for the same legend + // data.; + pls.adv( 0 ); + pls.vpor( 0.25, 0.75, 0.25, 0.75 ); + pls.wind( 0.0, 1.0, 0.0, 1.0 ); + pls.box( "bc", 0.0, 0, "bc", 0.0, 0 ); + pls.sfont( PLStream.PL_FCI_SANS, -1, -1 ); + pls.mtex( "t", 8.0, 0.5, 0.5, "The effect of nrow, ncolumn, PL_LEGEND_ROW_MAJOR," ); + pls.mtex( "t", 6.0, 0.5, 0.5, "and position for the same legend data" ); + + nlegend = 7; + opt_array = new int[nlegend]; + text_colors = new int[nlegend]; + line_colors = new int[nlegend]; + line_styles = new int[nlegend]; + line_widths = new int[nlegend]; + box_colors = new int[nlegend]; + box_patterns = new int[nlegend]; + box_scales = new double[nlegend]; + box_line_widths = new int[nlegend]; + symbol_numbers = new int[nlegend]; + symbol_colors = new int[nlegend]; + symbol_scales = new double[nlegend]; + text = new String[nlegend]; + symbols = new String[nlegend]; + + // Only specify legend data that are required according to the + // value of opt_array for that entry. + opt_base = PLStream.PL_LEGEND_BACKGROUND | PLStream.PL_LEGEND_BOUNDING_BOX; + for ( k = 0; k < nlegend; k++ ) + { + opt_array[k] = PLStream.PL_LEGEND_LINE | PLStream.PL_LEGEND_SYMBOL; + line_styles[k] = 1; + line_widths[k] = 1; + symbol_scales[k] = 1.; + symbol_numbers[k] = 2; + symbols[k] = "*"; + text[k] = nf.format( k ); + text_colors[k] = 1 + ( k % 8 ); + line_colors[k] = 1 + ( k % 8 ); + symbol_colors[k] = 1 + ( k % 8 ); + } + + // Use monotype fonts so that all legends are the same size. + pls.sfont( PLStream.PL_FCI_MONO, -1, -1 ); + pls.scol0a( 15, 32, 32, 32, 0.70 ); + + opt = opt_base | PLStream.PL_LEGEND_UPPER | PLStream.PL_LEGEND_OUTSIDE; + x = 0.; + y = 0.1; + nrow = 1; + ncolumn = nlegend; + pls.legend( legend_width, legend_height, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + opt_array, 1.0, 1.0, 2.0, + 1., text_colors, text, + null, null, null, null, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + + opt = opt_base | PLStream.PL_LEGEND_LOWER | PLStream.PL_LEGEND_OUTSIDE; + x = 0.; + y = 0.1; + nrow = 1; + ncolumn = nlegend; + pls.legend( legend_width, legend_height, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + opt_array, 1.0, 1.0, 2.0, + 1., text_colors, text, + null, null, null, null, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + + opt = opt_base | PLStream.PL_LEGEND_LEFT | PLStream.PL_LEGEND_OUTSIDE; + x = 0.1; + y = 0.; + nrow = nlegend; + ncolumn = 1; + pls.legend( legend_width, legend_height, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + opt_array, 1.0, 1.0, 2.0, + 1., text_colors, text, + null, null, null, null, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + + opt = opt_base | PLStream.PL_LEGEND_RIGHT | PLStream.PL_LEGEND_OUTSIDE; + x = 0.1; + y = 0.; + nrow = nlegend; + ncolumn = 1; + pls.legend( legend_width, legend_height, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + opt_array, 1.0, 1.0, 2.0, + 1., text_colors, text, + null, null, null, null, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + + opt = opt_base | PLStream.PL_LEGEND_LEFT | PLStream.PL_LEGEND_UPPER | PLStream.PL_LEGEND_INSIDE; + x = 0.; + y = 0.; + nrow = 6; + ncolumn = 2; + pls.legend( legend_width, legend_height, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + opt_array, 1.0, 1.0, 2.0, + 1., text_colors, text, + null, null, null, null, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + + opt = opt_base | PLStream.PL_LEGEND_RIGHT | PLStream.PL_LEGEND_UPPER | PLStream.PL_LEGEND_INSIDE | PLStream.PL_LEGEND_ROW_MAJOR; + x = 0.; + y = 0.; + nrow = 6; + ncolumn = 2; + pls.legend( legend_width, legend_height, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + opt_array, 1.0, 1.0, 2.0, + 1., text_colors, text, + null, null, null, null, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + + opt = opt_base | PLStream.PL_LEGEND_LOWER | PLStream.PL_LEGEND_INSIDE | PLStream.PL_LEGEND_ROW_MAJOR; + x = 0.; + y = 0.; + nrow = 3; + ncolumn = 3; + pls.legend( legend_width, legend_height, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + opt_array, 1.0, 1.0, 2.0, + 1., text_colors, text, + null, null, null, null, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + + // Third page demonstrating legend alignment + pls.adv( 0 ); + pls.vpor( 0., 1., 0., 1. ); + pls.wind( 0.0, 1.0, 0.0, 1.0 ); + pls.sfont( PLStream.PL_FCI_SANS, -1, -1 ); + pls.mtex( "t", -2.0, 0.5, 0.5, "Demonstrate legend alignment" ); + + x = 0.1; + y = 0.1; + nturn = 4; + nlegend = 0; + opt_base = PLStream.PL_LEGEND_BACKGROUND | PLStream.PL_LEGEND_BOUNDING_BOX | PLStream.PL_LEGEND_UPPER; + opt = opt_base | PLStream.PL_LEGEND_LEFT; + for ( i = 0; i < 9; i++ ) + { + // Set up legend arrays with the correct size, type. + if ( i <= nturn ) + nlegend = nlegend + 1; + else + nlegend = nlegend - 1; + nlegend = Math.max( 1, nlegend ); + opt_array = new int[nlegend]; + text_colors = new int[nlegend]; + line_colors = new int[nlegend]; + line_styles = new int[nlegend]; + line_widths = new int[nlegend]; + box_colors = new int[nlegend]; + box_patterns = new int[nlegend]; + box_scales = new double[nlegend]; + box_line_widths = new int[nlegend]; + symbol_numbers = new int[nlegend]; + symbol_colors = new int[nlegend]; + symbol_scales = new double[nlegend]; + text = new String[nlegend]; + symbols = new String[nlegend]; + + // Only specify legend data that are required according to the + // value of opt_array for that entry. + for ( k = 0; k < nlegend; k++ ) + { + opt_array[k] = PLStream.PL_LEGEND_LINE | PLStream.PL_LEGEND_SYMBOL; + line_styles[k] = 1; + line_widths[k] = 1; + symbol_scales[k] = 1.; + symbol_numbers[k] = 2; + symbols[k] = "*"; + text[k] = nf.format( k ); + text_colors[k] = 1 + ( k % 8 ); + line_colors[k] = 1 + ( k % 8 ); + symbol_colors[k] = 1 + ( k % 8 ); + } + // Use monotype fonts so that all legends are the same size. + pls.sfont( PLStream.PL_FCI_MONO, -1, -1 ); + pls.scol0a( 15, 32, 32, 32, 0.70 ); + + nrow = Math.min( 3, nlegend ); + ncolumn = 0; + + pls.legend( legend_width, legend_height, opt, x, y, + 0.025, 15, 1, 1, nrow, ncolumn, + opt_array, 1.0, 1.0, 1.5, + 1., text_colors, text, + null, null, null, null, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + + if ( i == nturn ) + { + opt = opt_base | PLStream.PL_LEGEND_RIGHT; + x = 1. - x; + y = y + legend_height[0]; + } + else + { + x = x + legend_width[0]; + y = y + legend_height[0]; + } + } + + // Fourth page illustrating various kinds of legends + max_height = 0.; + xstart = 0.0; + ystart = 0.1; + x = xstart; + y = ystart; + text_scale = 0.90; + pls.adv( 0 ); + pls.vpor( 0.0, 1., 0.0, 0.90 ); + pls.wind( 0.0, 1.0, 0.0, 1.0 ); + //plbox("bc", 0.0, 0, "bc", 0.0, 0); + pls.sfont( PLStream.PL_FCI_SANS, -1, -1 ); + pls.mtex( "t", 2.0, 0.5, 0.5, "Demonstrate Various Kinds of Legends" ); + + nlegend = 5; + opt_array = new int[nlegend]; + text_colors = new int[nlegend]; + line_colors = new int[nlegend]; + line_styles = new int[nlegend]; + line_widths = new int[nlegend]; + box_colors = new int[nlegend]; + box_patterns = new int[nlegend]; + box_scales = new double[nlegend]; + box_line_widths = new int[nlegend]; + symbol_numbers = new int[nlegend]; + symbol_colors = new int[nlegend]; + symbol_scales = new double[nlegend]; + text = new String[nlegend]; + symbols = new String[nlegend]; + // In Java symbols array needs setting to null strings first, since + // even unused values are copied over in the bindings. + for ( k = 0; k<nlegend; k++ ) + symbols[k] = ""; + + // Only specify legend data that are required according to the + // value of opt_array for that entry. + opt_base = PLStream.PL_LEGEND_BACKGROUND | PLStream.PL_LEGEND_BOUNDING_BOX | PLStream.PL_LEGEND_LEFT | PLStream.PL_LEGEND_UPPER | PLStream.PL_LEGEND_TEXT_LEFT; + + // Set up None, Box, Line, Symbol, and Line & Symbol legend entries. + opt_array[0] = PLStream.PL_LEGEND_NONE; + text[0] = "None"; + text_colors[0] = 1; + + opt_array[1] = PLStream.PL_LEGEND_COLOR_BOX; + text[1] = "Box"; + text_colors[1] = 2; + box_colors[1] = 2; + box_patterns[1] = 0; + box_scales[1] = 0.8; + box_line_widths[1] = 1; + + opt_array[2] = PLStream.PL_LEGEND_LINE; + text[2] = "Line"; + text_colors[2] = 3; + line_colors[2] = 3; + line_styles[2] = 1; + line_widths[2] = 1; + + opt_array[3] = PLStream.PL_LEGEND_SYMBOL; + text[3] = "Symbol"; + text_colors[3] = 4; + symbol_colors[3] = 4; + symbol_scales[3] = text_scale; + symbol_numbers[3] = 4; + symbols[3] = special_symbols[2]; + + opt_array[4] = PLStream.PL_LEGEND_SYMBOL | PLStream.PL_LEGEND_LINE; + text[4] = "L & S"; + text_colors[4] = 5; + line_colors[4] = 5; + line_styles[4] = 1; + line_widths[4] = 1; + symbol_colors[4] = 5; + symbol_scales[4] = text_scale; + symbol_numbers[4] = 4; + symbols[4] = special_symbols[2]; + + opt = opt_base; + pls.scol0a( 15, 32, 32, 32, 0.70 ); + + pls.legend( legend_width, legend_height, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, text_scale, 2.0, + 0., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + max_height = Math.max( max_height, legend_height[0] ); + + // Set up symbol legend entries with various symbols. + for ( i = 0; i < nlegend; i++ ) + { + opt_array[i] = PLStream.PL_LEGEND_SYMBOL; + text[i] = "Symbol "+ special_symbols[i]; + text_colors[i] = i + 1; + symbol_colors[i] = i + 1; + symbol_scales[i] = text_scale; + symbol_numbers[i] = 4; + symbols[i] = special_symbols[i]; + } + + opt = opt_base; + x = x + legend_width[0]; + pls.scol0a( 15, 32, 32, 32, 0.70 ); + + pls.legend( legend_width, legend_height, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, text_scale, 2.0, + 0., text_colors, text, + null, null, null, null, + null, null, null, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + max_height = Math.max( max_height, legend_height[0] ); + + // Set up symbol legend entries with various numbers of symbols. + for ( i = 0; i < nlegend; i++ ) + { + opt_array[i] = PLStream.PL_LEGEND_SYMBOL; + text[i] = "Symbol Number " + (i + 2); + text_colors[i] = i + 1; + symbol_colors[i] = i + 1; + symbol_scales[i] = text_scale; + symbol_numbers[i] = i + 2; + symbols[i] = special_symbols[2]; + } + + opt = opt_base; + x = x + legend_width[0]; + pls.scol0a( 15, 32, 32, 32, 0.70 ); + + pls.legend( legend_width, legend_height, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, text_scale, 2.0, + 0., text_colors, text, + null, null, null, null, + null, null, null, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + max_height = Math.max( max_height, legend_height[0] ); + + // Set up box legend entries with various colours. + for ( i = 0; i < nlegend; i++ ) + { + opt_array[i] = PLStream.PL_LEGEND_COLOR_BOX; + text[i] = "Box Color " + ( i + 1 ); + text_colors[i] = i + 1; + box_colors[i] = i + 1; + box_patterns[i] = 0; + box_scales[i] = 0.8; + box_line_widths[i] = 1; + } + + opt = opt_base; + // Use new origin + x = xstart; + y = y + max_height; + max_height = 0.; + pls.scol0a( 15, 32, 32, 32, 0.70 ); + + pls.legend( legend_width, legend_height, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, text_scale, 2.0, + 0., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + null, null, null, + null, null, null, null ); + max_height = Math.max( max_height, legend_height[0] ); + + // Set up box legend entries with various patterns. + for ( i = 0; i < nlegend; i++ ) + { + opt_array[i] = PLStream.PL_LEGEND_COLOR_BOX; + text[i] = "Box Pattern " + i; + text_colors[i] = 2; + box_colors[i] = 2; + box_patterns[i] = i; + box_scales[i] = 0.8; + box_line_widths[i] = 1; + } + + opt = opt_base; + x = x + legend_width[0]; + pls.scol0a( 15, 32, 32, 32, 0.70 ); + + pls.legend( legend_width, legend_height, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, text_scale, 2.0, + 0., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + null, null, null, + null, null, null, null ); + max_height = Math.max( max_height, legend_height[0] ); + + // Set up box legend entries with various box pattern line widths. + for ( i = 0; i < nlegend; i++ ) + { + opt_array[i] = PLStream.PL_LEGEND_COLOR_BOX; + text[i]= "Box Line Width " + ( i + 1 ); + text_colors[i] = 2; + box_colors[i] = 2; + box_patterns[i] = 3; + box_scales[i] = 0.8; + box_line_widths[i] = i + 1; + } + + opt = opt_base; + x = x + legend_width[0]; + pls.scol0a( 15, 32, 32, 32, 0.70 ); + + pls.legend( legend_width, legend_height, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, text_scale, 2.0, + 0., text_colors, text, + box_colors, box_patterns, box_scales, box_line_widths, + null, null, null, + null, null, null, null ); + max_height = Math.max( max_height, legend_height[0] ); + + // Set up line legend entries with various colours. + for ( i = 0; i < nlegend; i++ ) + { + opt_array[i] = PLStream.PL_LEGEND_LINE; + text[i] = "Line Color " + ( i + 1 ); + text_colors[i] = i + 1; + line_colors[i] = i + 1; + line_styles[i] = 1; + line_widths[i] = 1; + } + + opt = opt_base; + // Use new origin + x = xstart; + y = y + max_height; + max_height = 0.; + pls.scol0a( 15, 32, 32, 32, 0.70 ); + + pls.legend( legend_width, legend_height, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, text_scale, 2.0, + 0., text_colors, text, + null, null, null, null, + line_colors, line_styles, line_widths, + null, null, null, null ); + max_height = Math.max( max_height, legend_height[0] ); + + // Set up line legend entries with various styles. + for ( i = 0; i < nlegend; i++ ) + { + opt_array[i] = PLStream.PL_LEGEND_LINE; + text[i] = "Line Style " + ( i + 1 ); + text_colors[i] = 2; + line_colors[i] = 2; + line_styles[i] = i + 1; + line_widths[i] = 1; + } + + opt = opt_base; + x = x + legend_width[0]; + pls.scol0a( 15, 32, 32, 32, 0.70 ); + + pls.legend( legend_width, legend_height, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, text_scale, 2.0, + 0., text_colors, text, + null, null, null, null, + line_colors, line_styles, line_widths, + null, null, null, null ); + max_height = Math.max( max_height, legend_height[0] ); + + // Set up line legend entries with various widths. + for ( i = 0; i < nlegend; i++ ) + { + opt_array[i] = PLStream.PL_LEGEND_LINE; + text[i] = "Line Width " + ( i + 1 ); + text_colors[i] = 2; + line_colors[i] = 2; + line_styles[i] = 1; + line_widths[i] = i + 1; + } + + opt = opt_base; + x = x + legend_width[0]; + pls.scol0a( 15, 32, 32, 32, 0.70 ); + + pls.legend( legend_width, legend_height, opt, x, y, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, text_scale, 2.0, + 0., text_colors, text, + null, null, null, null, + line_colors, line_styles, line_widths, + null, null, null, null ); + max_height = Math.max( max_height, legend_height[0] ); + + // Color bar examples + double[] values_small = { 0.0, 1.0 }; + double[] values_uneven = { 0.0, 2.0, 2.6, 3.4, 6.0, 7.0, 8.0, 9.0, 10.0 }; + double[] values_even = { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 }; + plcolorbar_example_1( PLStream.PL_COLORBAR_IMAGE, 0.0, 0, 2, values_small, "Image Color Bars" ); + plcolorbar_example_2( PLStream.PL_COLORBAR_IMAGE, 0.0, 0, 2, values_small, "Image Color Bars" ); + plcolorbar_example_1( PLStream.PL_COLORBAR_SHADE | PLStream.PL_COLORBAR_SHADE_LABEL, 0.0, 0, 9, values_uneven, + "Shade Color Bars - Uneven Steps" ); + plcolorbar_example_2( PLStream.PL_COLORBAR_SHADE, 3.0, 3, 9, values_even, + "Shade Color Bars - Even Steps" ); + plcolorbar_example_1( PLStream.PL_COLORBAR_GRADIENT, 0.5, 5, 2, values_small, + "Gradient Color Bars" ); + plcolorbar_example_2( PLStream.PL_COLORBAR_GRADIENT, 0.5, 5, 2, values_small, + "Gradient Color Bars" ); + + pls.end(); + +} + +} Property changes on: trunk/examples/java/x33.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/plplot_test/test_java.sh.in =================================================================== --- trunk/plplot_test/test_java.sh.in 2011-01-12 05:07:12 UTC (rev 11489) +++ trunk/plplot_test/test_java.sh.in 2011-01-12 14:04:49 UTC (rev 11490) @@ -44,7 +44,7 @@ PLPLOT_CLASSPATH="${javadir}":"${PLPLOT_CLASSPATH}" fi -for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 ; do +for index in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33 ; do if [ "$verbose_test" ] ; then echo "x${index}" fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arj...@us...> - 2011-01-19 08:21:50
|
Revision: 11494 http://plplot.svn.sourceforge.net/plplot/?rev=11494&view=rev Author: arjenmarkus Date: 2011-01-19 08:21:43 +0000 (Wed, 19 Jan 2011) Log Message: ----------- Preliminary implementation of pllegend for Fortran 77: - We probably want to introduce a new include file, because of the PL_LEGEND_* constants. The alternative is to copy them into the source code for each example, as done now. (Note that we can solve this for Fortran 90/95 via the module, no need for an extra file here) - The implementation now uses two extra static variables to convert the arrays of strings to the C conventions. However, that is not thread-safe (it does avoid a complication with passing the string lengths, though) - Not checked against the C output yet. The other examples still need to be done. - Only checked for gfortran. Modified Paths: -------------- trunk/bindings/f77/plplotf77.def trunk/bindings/f77/plplotf77_ifort.def trunk/bindings/f77/plplotf77_mingw.def trunk/bindings/f77/plstubs.h trunk/bindings/f77/scstubs.c trunk/bindings/f77/sfstubs.fm4 trunk/bindings/f77/sfstubs.h trunk/examples/f77/x04f.fm4 Modified: trunk/bindings/f77/plplotf77.def =================================================================== --- trunk/bindings/f77/plplotf77.def 2011-01-16 12:17:22 UTC (rev 11493) +++ trunk/bindings/f77/plplotf77.def 2011-01-19 08:21:43 UTC (rev 11494) @@ -16,6 +16,8 @@ _PLIMAGEFR2@56 _PLIMAGEFR@48 _PLLAB@24 + _PLLEGEND@128 + _PLLEGEND_CNV_TEXT@16 _PLMAP@28 _PLMAP_NONE@24 _PLMERIDIANS@28 Modified: trunk/bindings/f77/plplotf77_ifort.def =================================================================== --- trunk/bindings/f77/plplotf77_ifort.def 2011-01-16 12:17:22 UTC (rev 11493) +++ trunk/bindings/f77/plplotf77_ifort.def 2011-01-19 08:21:43 UTC (rev 11494) @@ -16,6 +16,8 @@ PLIMAGEFR2 PLIMAGEFR PLLAB + PLLEGEND + PLLEGEND_CNV_TEXT PLMAP PLMAP_NONE PLMERIDIANS Modified: trunk/bindings/f77/plplotf77_mingw.def =================================================================== --- trunk/bindings/f77/plplotf77_mingw.def 2011-01-16 12:17:22 UTC (rev 11493) +++ trunk/bindings/f77/plplotf77_mingw.def 2011-01-19 08:21:43 UTC (rev 11494) @@ -17,6 +17,8 @@ plimagefr2_ plimagefr_ pllab_ + pllegend_cnv_text_ + pllegend_ plmap_ plmap_none_ plmeridians_ Modified: trunk/bindings/f77/plstubs.h =================================================================== --- trunk/bindings/f77/plstubs.h 2011-01-16 12:17:22 UTC (rev 11493) +++ trunk/bindings/f77/plstubs.h 2011-01-19 08:21:43 UTC (rev 11494) @@ -244,6 +244,8 @@ #define PLINIT FNAME( PLINIT, plinit ) #define PLJOIN FNAME( PLJOIN, pljoin ) #define PLLAB7 FNAME( PLLAB7, pllab7 ) +#define PLLEGEND FNAME( PLLEGEND07, pllegend07 ) +#define PLLEGEND_CNV_TEXT FNAME( PLLEGEND07_CNVV_TEXT, pllegend07_cnv_text ) #define PLLIGHTSOURCE FNAME( PLLIGHTSOURCE, pllightsource ) #define PLLINE FNAME( PLLINE, plline ) #define PLLINE3 FNAME( PLLINE3, plline3 ) Modified: trunk/bindings/f77/scstubs.c =================================================================== --- trunk/bindings/f77/scstubs.c 2011-01-16 12:17:22 UTC (rev 11493) +++ trunk/bindings/f77/scstubs.c 2011-01-19 08:21:43 UTC (rev 11494) @@ -43,6 +43,9 @@ // Slightly different to C version as we don't support PLPointer for additional data static void ( STDCALL *pltransform )( PLFLT *, PLFLT *, PLFLT *, PLFLT * ); +static char **pllegend_text; +static char **pllegend_symbols; + static void pltransformf2c( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, PLPointer data ) { @@ -509,7 +512,79 @@ label[i + 1] = '\0'; } +// Auxiliary function to create a C-compatible string array +// Note the hidden argument void +PLLEGEND_CNV_TEXT( PLINT *id, PLINT *number, char *string, PLINT length ) +{ + int j; + int i; + char **p_string; + char *data; + + // Ensure the strings are null terminated + + p_string = (char **) malloc( sizeof(char *) * (*number) ); + data = (char *) malloc( sizeof(char *) * (*number) * (length+1) ); + + for ( j = 0; j < (*number); j ++ ) + { + p_string[j] = data + j*(length+1); + memcpy( p_string[j], &string[j*length], length ); + i = length - 1; + while ( ( i >= 0 ) && ( p_string[j][i] == ' ' ) ) + i--; + p_string[j][i + 1] = '\0'; + } + + if ( *id == 1 ) + { + pllegend_text = p_string; + } + else + { + pllegend_symbols = p_string; + } +} + +void PLLEGEND( + PLFLT *p_legend_width, PLFLT *p_legend_height, + PLINT *opt, PLFLT *x, PLFLT *y, PLFLT *plot_width, + PLINT *bg_color, PLINT *bb_color, PLINT *bb_style, + PLINT *nrow, PLINT *ncolumn, + PLINT *nlegend, const PLINT *opt_array, + PLFLT *text_offset, PLFLT *text_scale, PLFLT *text_spacing, + PLFLT *text_justification, + const PLINT *text_colors, + const PLINT *box_colors, const PLINT *box_patterns, + const PLFLT *box_scales, const PLINT *box_line_widths, + const PLINT *line_colors, const PLINT *line_styles, + const PLINT *line_widths, + const PLINT *symbol_colors, const PLFLT *symbol_scales, + const PLINT *symbol_numbers ) +{ + c_pllegend( p_legend_width, p_legend_height, + *opt, *x, *y, *plot_width, + *bg_color, *bb_color, *bb_style, + *nrow, *ncolumn, + *nlegend, opt_array, + *text_offset, *text_scale, *text_spacing, + *text_justification, + text_colors, pllegend_text, + box_colors, box_patterns, + box_scales, box_line_widths, + line_colors, line_styles, + line_widths, + symbol_colors, symbol_scales, + symbol_numbers, pllegend_symbols ) ; + + free( *pllegend_text ); + free( pllegend_text ); + free( *pllegend_symbols ); + free( pllegend_symbols ); +} + +void PLLIGHTSOURCE( PLFLT *x, PLFLT *y, PLFLT *z ) { c_pllightsource( *x, *y, *z ); Modified: trunk/bindings/f77/sfstubs.fm4 =================================================================== --- trunk/bindings/f77/sfstubs.fm4 2011-01-16 12:17:22 UTC (rev 11493) +++ trunk/bindings/f77/sfstubs.fm4 2011-01-19 08:21:43 UTC (rev 11494) @@ -265,6 +265,61 @@ c*********************************************************************** + subroutine pllegend( legend_width, legend_height, opt, x, y, + & plot_width, bg_color, bb_color, bb_style, + & nrow, ncolumn, nlegend, opt_array, + & text_offset, text_scale, text_spacing, + & text_justification, text_colors, text, + & box_colors, box_patterns, box_scales, + & box_line_widths, + & line_colors, line_styles, line_widths, + & symbol_colors, symbol_scales, + & symbol_numbers, symbols ) + & + + implicit none + real*8 legend_width, legend_height, plot_width, x, y + real*8 text_offset, text_scale, text_spacing, text_justification + integer opt, bg_color, bb_color, bb_style + integer nrow, ncolumn, nlegend + + integer opt_array, text_colors, box_colors, box_patterns + integer box_scales, line_colors, line_styles + real*8 box_line_widths, line_widths, symbol_scales + integer symbol_colors, symbol_numbers + + character*(*) text, symbols + + dimension opt_array(*), text_colors(*), box_colors(*) + dimension box_patterns(*), box_scales(*) + dimension line_colors(*), line_styles(*) + dimension symbol_colors(*), symbol_numbers(*) + dimension box_line_widths(*), line_widths(*), symbol_scales(*) + dimension text(*), symbols(*) + +c +c Convert the text arrays and store the results in a convenient +c albeit global location. This way we avoid all manner of complications. +c (Though introducing a potentially nasty one: non-threadsafety) +c + call pllegend07_cnv_text( 1, nlegend, text ) + call pllegend07_cnv_text( 2, nlegend, symbols ) + + call pllegend07( legend_width, legend_height, opt, x, y, + & plot_width, bg_color, bb_color, bb_style, + & nrow, ncolumn, nlegend, opt_array, + & text_offset, text_scale, text_spacing, + & text_justification, text_colors, + & box_colors, box_patterns, box_scales, + & box_line_widths, + & line_colors, line_styles, line_widths, + & symbol_colors, symbol_scales, + & symbol_numbers ) + + end + +c*********************************************************************** + subroutine plvec0(u, v, nx, ny, scale) implicit none Modified: trunk/bindings/f77/sfstubs.h =================================================================== --- trunk/bindings/f77/sfstubs.h 2011-01-16 12:17:22 UTC (rev 11493) +++ trunk/bindings/f77/sfstubs.h 2011-01-19 08:21:43 UTC (rev 11494) @@ -40,3 +40,66 @@ common /zzplstr7/ string7 common /zzplstr8/ string8 common /zzplstr9/ string9 + +c Flags for pllegend. + integer PL_LEGEND_NONE + integer PL_LEGEND_COLOR_BOX + integer PL_LEGEND_LINE + integer PL_LEGEND_SYMBOL + integer PL_LEGEND_TEXT_LEFT + integer PL_LEGEND_BACKGROUND + integer PL_LEGEND_BOUNDING_BOX + integer PL_LEGEND_ROW_MAJOR + integer PL_LEGEND_LEFT + integer PL_LEGEND_RIGHT + integer PL_LEGEND_UPPER + integer PL_LEGEND_LOWER + integer PL_LEGEND_INSIDE + integer PL_LEGEND_OUTSIDE + + parameter (PL_LEGEND_NONE = 1 ) + parameter (PL_LEGEND_COLOR_BOX = 2 ) + parameter (PL_LEGEND_LINE = 4 ) + parameter (PL_LEGEND_SYMBOL = 8 ) + parameter (PL_LEGEND_TEXT_LEFT = 16 ) + parameter (PL_LEGEND_BACKGROUND = 32 ) + parameter (PL_LEGEND_BOUNDING_BOX = 64 ) + parameter (PL_LEGEND_ROW_MAJOR = 128 ) + parameter (PL_LEGEND_LEFT = 256 ) + parameter (PL_LEGEND_RIGHT = 512 ) + parameter (PL_LEGEND_UPPER = 1024 ) + parameter (PL_LEGEND_LOWER = 2048 ) + parameter (PL_LEGEND_INSIDE = 4096 ) + parameter (PL_LEGEND_OUTSIDE = 8192 ) + +c Flags for plcolorbar + integer PL_COLORBAR_LEFT + integer PL_COLORBAR_RIGHT + integer PL_COLORBAR_UPPER + integer PL_COLORBAR_LOWER + integer PL_COLORBAR_LABEL_LEFT + integer PL_COLORBAR_LABEL_RIGHT + integer PL_COLORBAR_LABEL_UPPER + integer PL_COLORBAR_LABEL_LOWER + integer PL_COLORBAR_IMAGE + integer PL_COLORBAR_SHADE + integer PL_COLORBAR_GRADIENT + integer PL_COLORBAR_CAP_LOW + integer PL_COLORBAR_CAP_HIGH + integer PL_COLORBAR_SHADE_LABEL + + parameter (PL_COLORBAR_LEFT = 1 ) + parameter (PL_COLORBAR_RIGHT = 2 ) + parameter (PL_COLORBAR_UPPER = 4 ) + parameter (PL_COLORBAR_LOWER = 8 ) + parameter (PL_COLORBAR_LABEL_LEFT = 16 ) + parameter (PL_COLORBAR_LABEL_RIGHT = 32 ) + parameter (PL_COLORBAR_LABEL_UPPER = 64 ) + parameter (PL_COLORBAR_LABEL_LOWER = 128 ) + parameter (PL_COLORBAR_IMAGE = 256 ) + parameter (PL_COLORBAR_SHADE = 512 ) + parameter (PL_COLORBAR_GRADIENT = 1024 ) + parameter (PL_COLORBAR_CAP_LOW = 2048 ) + parameter (PL_COLORBAR_CAP_HIGH = 4096 ) + parameter (PL_COLORBAR_SHADE_LABEL = 8192 ) + Modified: trunk/examples/f77/x04f.fm4 =================================================================== --- trunk/examples/f77/x04f.fm4 2011-01-16 12:17:22 UTC (rev 11493) +++ trunk/examples/f77/x04f.fm4 2011-01-19 08:21:43 UTC (rev 11494) @@ -40,6 +40,51 @@ real*8 freql(0:100),ampl(0:100),phase(0:100), freq, f0 integer i, type + real*8 legend_width, legend_height + integer nlegend + integer opt_array(2), text_colors(2), line_colors(2), + & line_styles(2), symbol_colors(2), + & symbol_numbers(2) + real*8 line_widths(2), symbol_scales(2) + integer box_colors(1), box_patterns(1), box_scales(1) + real*8 box_line_widths(1) + character*20 text(2) + character*1 symbols(2) + +c To include file! + + integer PL_LEGEND_NONE + integer PL_LEGEND_COLOR_BOX + integer PL_LEGEND_LINE + integer PL_LEGEND_SYMBOL + integer PL_LEGEND_TEXT_LEFT + integer PL_LEGEND_BACKGROUND + integer PL_LEGEND_BOUNDING_BOX + integer PL_LEGEND_ROW_MAJOR + integer PL_LEGEND_LEFT + integer PL_LEGEND_RIGHT + integer PL_LEGEND_UPPER + integer PL_LEGEND_LOWER + integer PL_LEGEND_INSIDE + integer PL_LEGEND_OUTSIDE + + parameter (PL_LEGEND_NONE = 1 ) + parameter (PL_LEGEND_COLOR_BOX = 2 ) + parameter (PL_LEGEND_LINE = 4 ) + parameter (PL_LEGEND_SYMBOL = 8 ) + parameter (PL_LEGEND_TEXT_LEFT = 16 ) + parameter (PL_LEGEND_BACKGROUND = 32 ) + parameter (PL_LEGEND_BOUNDING_BOX = 64 ) + parameter (PL_LEGEND_ROW_MAJOR = 128 ) + parameter (PL_LEGEND_LEFT = 256 ) + parameter (PL_LEGEND_RIGHT = 512 ) + parameter (PL_LEGEND_UPPER = 1024 ) + parameter (PL_LEGEND_LOWER = 2048 ) + parameter (PL_LEGEND_INSIDE = 4096 ) + parameter (PL_LEGEND_OUTSIDE = 8192 ) + + + call pladv(0) c Set up data for log plot. f0 = 1.d0 @@ -73,6 +118,7 @@ & 'Single Pole Low-Pass Filter') call plcol0(2) call plmtex('l', 5.0d0, 0.5d0, 0.5d0, 'Amplitude (dB)') + nlegend = 1 c For the gridless case, put phase vs freq on same plot. if(type.eq.0) then call plcol0(1) @@ -84,5 +130,43 @@ call plcol0(3) call plmtex('r', 5.0d0, 0.5d0, 0.5d0, & 'Phase shift (degrees)') + nlegend = 2 endif +c Draw a legend +c First legend entry. + opt_array(1) = PL_LEGEND_LINE + text_colors(1) = 2 + text(1) = 'Amplitude' + line_colors(1) = 2 + line_styles(1) = 1 + line_widths(1) = 1 +c note from the above opt_array the first symbol (and box) indices +c do not have to be specified + +c Second legend entry. + opt_array(2) = PL_LEGEND_LINE + PL_LEGEND_SYMBOL + text_colors(2) = 3 + text(2) = 'Phase shift' + line_colors(2) = 3 + line_styles(2) = 1 + line_widths(2) = 1 + symbol_colors(2) = 3 + symbol_scales(2) = 1.0 + symbol_numbers(2) = 4 + symbols(2) = '*' +c from the above opt_arrays we can completely ignore everything +c to do with boxes. + + call plscol0a( 15, 32, 32, 32, 0.70 ) + call pllegend( legend_width, legend_height, + & PL_LEGEND_BACKGROUND + PL_LEGEND_BOUNDING_BOX, + & 0.0d0, 0.0d0, 0.1d0, 15, + & 1, 1, 0, 0, + & nlegend, opt_array, + & 1.0d0, 1.0d0, 2.0d0, + & 1.0d0, text_colors, text, + & box_colors, box_patterns, box_scales, box_line_widths, + & line_colors, line_styles, line_widths, + & symbol_colors, symbol_scales, symbol_numbers, symbols ) + end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-01-26 22:37:19
|
Revision: 11503 http://plplot.svn.sourceforge.net/plplot/?rev=11503&view=rev Author: airwin Date: 2011-01-26 22:23:15 +0000 (Wed, 26 Jan 2011) Log Message: ----------- Expand plplot_parameters.h so it can be used for examples 9 through 16 (and 16a) for f77. Modified Paths: -------------- trunk/bindings/f77/plplot_parameters.h trunk/examples/f77/x09f.fm4 trunk/examples/f77/x10f.fm4 trunk/examples/f77/x11f.fm4 trunk/examples/f77/x12f.fm4 trunk/examples/f77/x13f.fm4 trunk/examples/f77/x14f.fm4 trunk/examples/f77/x15f.fm4 trunk/examples/f77/x16af.fm4 trunk/examples/f77/x16f.fm4 Modified: trunk/bindings/f77/plplot_parameters.h =================================================================== --- trunk/bindings/f77/plplot_parameters.h 2011-01-26 22:01:08 UTC (rev 11502) +++ trunk/bindings/f77/plplot_parameters.h 2011-01-26 22:23:15 UTC (rev 11503) @@ -22,8 +22,9 @@ integer PL_PARSE_FULL parameter(PL_PARSE_FULL = 1) - real*8 PI + real*8 PI, TWOPI parameter (PI = 3.1415926535897932384d0) + parameter (TWOPI = 2.d0*PI) c flags used for position argument of both pllegend and plcolorbar integer PL_POSITION_LEFT Modified: trunk/examples/f77/x09f.fm4 =================================================================== --- trunk/examples/f77/x09f.fm4 2011-01-26 22:01:08 UTC (rev 11502) +++ trunk/examples/f77/x09f.fm4 2011-01-26 22:23:15 UTC (rev 11503) @@ -21,8 +21,7 @@ c Does several contour plots using different coordinate mappings. implicit none - real*8 PI - parameter (PI = 3.1415926535897932384d0) + include 'plplot_parameters.h' integer i, j, nptsx, nptsy, xdim, ydim c xdim and ydim are the absolute static dimensions. c nptsx, and nptsy are the (potentially dynamic) defined area of the 2D @@ -39,8 +38,6 @@ data clevel /-1.d0, -0.8d0, -0.6d0, -0.4d0, -0.2d0, & 0.d0, 0.2d0, 0.4d0, 0.6d0 ,0.8d0, 1.d0/ - integer PL_PARSE_FULL - parameter(PL_PARSE_FULL = 1) c Process command-line arguments call plparseopts(PL_PARSE_FULL) @@ -144,8 +141,7 @@ c polar contour plot example. subroutine polar() implicit none - real*8 PI - parameter (PI = 3.1415926535897932384d0) + include 'plplot_parameters.h' integer PERIMETERPTS, RPTS, THETAPTS, NLEVEL, xdim, ydim parameter(PERIMETERPTS = 100) c xdim and ydim are the absolute static size of the 2D arrays. @@ -200,7 +196,7 @@ & nlevel, ilevgt, ilevlt, nlevlt, nlevgt, & ncollin, ncolbox, ncollab, & nxsub, nysub, xdim, ydim - real*8 TWOPI, r, theta, rmax, x0, y0, xmin, xmax, eps, q1, d1, + real*8 r, theta, rmax, x0, y0, xmin, xmax, eps, q1, d1, & ymin, ymax, & q1i, d1i, q2, d2, q2i, d2i, div1, div1i, div2, div2i, & zmin, zmax, dz, xpmin, xpmax, ypmin, ypmax, @@ -209,7 +205,7 @@ c NCX and NCY are associated with the part of the c 2D arrays that are defined. parameter (xdim=99, NCX=40, ydim=100, NCY=64, NPLT=100) - parameter (TWOPI=6.2831853071795864768d0) + include 'plplot_parameters.h' real*8 z(xdim, ydim), ztmp(xdim, ydim+1) real*8 xg(xdim, ydim+1), yg(xdim, ydim+1), xtm(NPLT), ytm(NPLT) Modified: trunk/examples/f77/x10f.fm4 =================================================================== --- trunk/examples/f77/x10f.fm4 2011-01-26 22:01:08 UTC (rev 11502) +++ trunk/examples/f77/x10f.fm4 2011-01-26 22:23:15 UTC (rev 11503) @@ -21,8 +21,7 @@ c Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA implicit none - integer PL_PARSE_FULL - parameter(PL_PARSE_FULL = 1) + include 'plplot_parameters.h' c Process command-line arguments call plparseopts(PL_PARSE_FULL) Modified: trunk/examples/f77/x11f.fm4 =================================================================== --- trunk/examples/f77/x11f.fm4 2011-01-26 22:01:08 UTC (rev 11502) +++ trunk/examples/f77/x11f.fm4 2011-01-26 22:23:15 UTC (rev 11503) @@ -20,8 +20,7 @@ c Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA implicit none - real*8 PI - parameter (PI = 3.1415926535897932384d0) + include 'plplot_parameters.h' integer i, j, k, ifshade, xpts, ypts parameter (xpts=35, ypts=46) @@ -32,29 +31,13 @@ integer opt(2) data alt /33.0d0,17.0d0/ data az /24.0d0,115.0d0/ -c DRAW_LINEXY +c DRAW_LINEXY = 3 data opt /2*3/ data title /'#frPLplot Example 11 - Alt=33, Az=24, Opt=3', & '#frPLplot Example 11 - Alt=17, Az=115, Opt=3'/ integer nlevel parameter (nlevel = 10) real*8 zmin, zmax, step, clevel(nlevel) -c Plotting options for 3d plots, see plplot.h for the C definitions -c of these options. - integer DRAW_LINEX, DRAW_LINEY, DRAW_LINEXY, MAG_COLOR, - & BASE_CONT, TOP_CONT, SURF_CONT, DRAW_SIDES, FACETED, MESH - parameter(DRAW_LINEX = 1) - parameter(DRAW_LINEY = 2) - parameter(DRAW_LINEXY = 3) - parameter(MAG_COLOR = 4) - parameter(BASE_CONT = 8) - parameter(TOP_CONT = 16) - parameter(SURF_CONT = 32) - parameter(DRAW_SIDES = 64) - parameter(FACETED = 128) - parameter(MESH = 256) - integer PL_PARSE_FULL - parameter(PL_PARSE_FULL = 1) c Process command-line arguments call plparseopts(PL_PARSE_FULL) Modified: trunk/examples/f77/x12f.fm4 =================================================================== --- trunk/examples/f77/x12f.fm4 2011-01-26 22:01:08 UTC (rev 11502) +++ trunk/examples/f77/x12f.fm4 2011-01-26 22:23:15 UTC (rev 11503) @@ -26,8 +26,7 @@ real*8 y0(10) real*8 pos(5), rcoord(5), gcoord(5), bcoord(5) integer rev(5) - integer PL_PARSE_FULL - parameter(PL_PARSE_FULL = 1) + include 'plplot_parameters.h' data pos /0.0d0, 0.25d0, 0.5d0, 0.75d0, 1.0d0/ data rcoord /0.0d0, 0.25d0, 0.5d0, 1.0d0, 1.0d0/ Modified: trunk/examples/f77/x13f.fm4 =================================================================== --- trunk/examples/f77/x13f.fm4 2011-01-26 22:01:08 UTC (rev 11502) +++ trunk/examples/f77/x13f.fm4 2011-01-26 22:23:15 UTC (rev 11503) @@ -20,15 +20,12 @@ c Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA implicit none - real*8 PI - parameter (PI = 3.1415926535897932384d0) + include 'plplot_parameters.h' real*8 just, dx, dy, x(500), y(500), per(5) integer i, j, dthet, theta0, theta1, theta character*20 text(5) data text / 'Maurice', 'Geoffrey', 'Alan', 'Rafael', 'Vince'/ - integer PL_PARSE_FULL - parameter(PL_PARSE_FULL = 1) c Process command-line arguments call plparseopts(PL_PARSE_FULL) Modified: trunk/examples/f77/x14f.fm4 =================================================================== --- trunk/examples/f77/x14f.fm4 2011-01-26 22:01:08 UTC (rev 11502) +++ trunk/examples/f77/x14f.fm4 2011-01-26 22:23:15 UTC (rev 11503) @@ -42,8 +42,7 @@ c some fortran compilers demand typing of intrinsic lnblnk, and c although this is not demanded on g77 it also works there. integer lnblnk - integer PL_PARSE_FULL - parameter(PL_PARSE_FULL = 1) + include 'plplot_parameters.h' real*8 xp0, yp0 integer xleng0, yleng0, xoff0, yoff0 logical valid_geometry @@ -256,8 +255,7 @@ c and so do not use_ PLENV implicit none - real*8 PI - parameter (PI = 3.1415926535897932384d0) + include 'plplot_parameters.h' real*8 x(101), y(101) real*8 xs(6), ys(6) real*8 xscale, yscale, xoff, yoff @@ -307,8 +305,7 @@ real*8 x0(0:360), y0(0:360) real*8 x(0:360), y(0:360), dtr, theta, dx, dy, r integer i, j, nsp - real*8 PI - parameter (PI = 3.1415926535897932384d0) + include 'plplot_parameters.h' dtr = PI/180.0d0 do i=0,360 @@ -393,8 +390,7 @@ subroutine plot5() implicit none - real*8 PI - parameter (PI = 3.1415926535897932384d0) + include 'plplot_parameters.h' integer i, j, nptsx, nptsy, xdim, ydim c xdim and ydim are the absolute static dimensions. c nptsx, and nptsy are the (potentially dynamic) defined area of the 2D Modified: trunk/examples/f77/x15f.fm4 =================================================================== --- trunk/examples/f77/x15f.fm4 2011-01-26 22:01:08 UTC (rev 11502) +++ trunk/examples/f77/x15f.fm4 2011-01-26 22:23:15 UTC (rev 11503) @@ -31,8 +31,7 @@ real*8 xx, yy real*8 z(xdim, ydim), zmin, zmax - integer PL_PARSE_FULL - parameter(PL_PARSE_FULL = 1) + include 'plplot_parameters.h' c Process command-line arguments call plparseopts(PL_PARSE_FULL) Modified: trunk/examples/f77/x16af.fm4 =================================================================== --- trunk/examples/f77/x16af.fm4 2011-01-26 22:01:08 UTC (rev 11502) +++ trunk/examples/f77/x16af.fm4 2011-01-26 22:23:15 UTC (rev 11503) @@ -22,8 +22,7 @@ implicit none - integer PL_PARSE_FULL - parameter(PL_PARSE_FULL = 1) + include 'plplot_parameters.h' c Process command-line arguments call plparseopts(PL_PARSE_FULL) @@ -124,12 +123,11 @@ implicit none integer xdim, ydim, NX, NY, NCONTR, NBDRY - real*8 TWOPI c xdim and ydim are the static dimensions of the 2D arrays while c NX and NY are the defined area. parameter (xdim = 99, NX = 40, ydim = 100, NY = 64) parameter (NCONTR = 14, NBDRY=200) - parameter (TWOPI=6.2831853071795864768d0) + include 'plplot_parameters.h' real*8 z(xdim, ydim), ztmp(xdim, ydim+1) real*8 xg(xdim, ydim+1), yg(xdim, ydim+1), Modified: trunk/examples/f77/x16f.fm4 =================================================================== --- trunk/examples/f77/x16f.fm4 2011-01-26 22:01:08 UTC (rev 11502) +++ trunk/examples/f77/x16f.fm4 2011-01-26 22:23:15 UTC (rev 11503) @@ -20,8 +20,7 @@ c Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA implicit none - real*8 PI - parameter (PI = 3.1415926535897932384d0) + include 'plplot_parameters.h' real*8 xx, yy, argx, argy, distort, r, t integer NLEVEL, NX, NY, PERIMETERPTS, xdim, ydim parameter(NLEVEL = 20) @@ -41,8 +40,6 @@ real*8 tr(6) common /plplot/tr - integer PL_PARSE_FULL - parameter(PL_PARSE_FULL = 1) c Process command-line arguments call plparseopts(PL_PARSE_FULL) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-01-26 22:37:23
|
Revision: 11502 http://plplot.svn.sourceforge.net/plplot/?rev=11502&view=rev Author: airwin Date: 2011-01-26 22:01:08 +0000 (Wed, 26 Jan 2011) Log Message: ----------- Expand plplot_parameters.h so it can be used in first 8 f77 examples. Modified Paths: -------------- trunk/bindings/f77/plplot_parameters.h trunk/examples/f77/x01f.fm4 trunk/examples/f77/x02f.fm4 trunk/examples/f77/x03f.fm4 trunk/examples/f77/x04f.fm4 trunk/examples/f77/x05f.fm4 trunk/examples/f77/x06f.fm4 trunk/examples/f77/x07f.fm4 trunk/examples/f77/x08f.fm4 Modified: trunk/bindings/f77/plplot_parameters.h =================================================================== --- trunk/bindings/f77/plplot_parameters.h 2011-01-26 21:22:01 UTC (rev 11501) +++ trunk/bindings/f77/plplot_parameters.h 2011-01-26 22:01:08 UTC (rev 11502) @@ -20,6 +20,11 @@ C License along with PLplot; if not, write to the Free Software C Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + integer PL_PARSE_FULL + parameter(PL_PARSE_FULL = 1) + real*8 PI + parameter (PI = 3.1415926535897932384d0) + c flags used for position argument of both pllegend and plcolorbar integer PL_POSITION_LEFT integer PL_POSITION_RIGHT @@ -39,6 +44,20 @@ parameter (PL_POSITION_VIEWPORT = 64 ) parameter (PL_POSITION_SUBPAGE = 128 ) +c Flags for plot3dc() and plsurf3d(). + integer DRAW_LINEX, DRAW_LINEY, DRAW_LINEXY, MAG_COLOR, + & BASE_CONT, TOP_CONT, SURF_CONT, DRAW_SIDES, FACETED, MESH + parameter(DRAW_LINEX = 1) + parameter(DRAW_LINEY = 2) + parameter(DRAW_LINEXY = 3) + parameter(MAG_COLOR = 4) + parameter(BASE_CONT = 8) + parameter(TOP_CONT = 16) + parameter(SURF_CONT = 32) + parameter(DRAW_SIDES = 64) + parameter(FACETED = 128) + parameter(MESH = 256) + c Flags for pllegend. integer PL_LEGEND_NONE integer PL_LEGEND_COLOR_BOX Modified: trunk/examples/f77/x01f.fm4 =================================================================== --- trunk/examples/f77/x01f.fm4 2011-01-26 21:22:01 UTC (rev 11501) +++ trunk/examples/f77/x01f.fm4 2011-01-26 22:01:08 UTC (rev 11502) @@ -26,8 +26,7 @@ common /plotdat/ x, y, xs, ys, xscale, yscale, xoff, yoff character*80 version integer digmax - integer PL_PARSE_FULL - parameter(PL_PARSE_FULL = 1) + include 'plplot_parameters.h' c some fortran compilers demand typing of intrinsic lnblnk, and c although this is not demanded on g77 it also works there. integer lnblnk @@ -165,8 +164,7 @@ c For the final graph we wish to override the default tick intervals, c and so do not use_ PLENV - real*8 PI - parameter (PI = 3.1415926535897932384d0) + include 'plplot_parameters.h' real*8 x(101), y(101) real*8 xs(6), ys(6) real*8 xscale, yscale, xoff, yoff Modified: trunk/examples/f77/x02f.fm4 =================================================================== --- trunk/examples/f77/x02f.fm4 2011-01-26 21:22:01 UTC (rev 11501) +++ trunk/examples/f77/x02f.fm4 2011-01-26 22:01:08 UTC (rev 11502) @@ -22,8 +22,7 @@ implicit none - integer PL_PARSE_FULL - parameter(PL_PARSE_FULL = 1) + include 'plplot_parameters.h' c Process command-line arguments call plparseopts(PL_PARSE_FULL) Modified: trunk/examples/f77/x03f.fm4 =================================================================== --- trunk/examples/f77/x03f.fm4 2011-01-26 21:22:01 UTC (rev 11501) +++ trunk/examples/f77/x03f.fm4 2011-01-26 22:01:08 UTC (rev 11502) @@ -20,15 +20,12 @@ c Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA implicit none - real*8 PI - parameter (PI = 3.1415926535897932384d0) + include 'plplot_parameters.h' character*3 text real*8 x0(0:360), y0(0:360) real*8 x(0:360), y(0:360), dtr, theta, dx, dy, r, offset integer i, j, nsp - integer PL_PARSE_FULL - parameter(PL_PARSE_FULL = 1) c Process command-line arguments call plparseopts(PL_PARSE_FULL) Modified: trunk/examples/f77/x04f.fm4 =================================================================== --- trunk/examples/f77/x04f.fm4 2011-01-26 21:22:01 UTC (rev 11501) +++ trunk/examples/f77/x04f.fm4 2011-01-26 22:01:08 UTC (rev 11502) @@ -20,8 +20,7 @@ c Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA implicit none - integer PL_PARSE_FULL - parameter(PL_PARSE_FULL = 1) + include 'plplot_parameters.h' c Process command-line arguments call plparseopts(PL_PARSE_FULL) @@ -35,8 +34,7 @@ subroutine plot1(type) implicit none - real*8 PI - parameter (PI = 3.1415926535897932384d0) + include 'plplot_parameters.h' real*8 freql(0:100),ampl(0:100),phase(0:100), freq, f0 integer i, type @@ -51,8 +49,6 @@ character*20 text(2) character*1 symbols(2) - include 'plplot_parameters.h' - call pladv(0) c Set up data for log plot. f0 = 1.d0 Modified: trunk/examples/f77/x05f.fm4 =================================================================== --- trunk/examples/f77/x05f.fm4 2011-01-26 21:22:01 UTC (rev 11501) +++ trunk/examples/f77/x05f.fm4 2011-01-26 22:01:08 UTC (rev 11502) @@ -20,15 +20,12 @@ c Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA implicit none - real*8 PI - parameter (PI = 3.1415926535897932384d0) + include 'plplot_parameters.h' integer i integer NPTS parameter ( NPTS = 2047 ) real*8 data(NPTS), delta - integer PL_PARSE_FULL - parameter(PL_PARSE_FULL = 1) c Process command-line arguments call plparseopts(PL_PARSE_FULL) Modified: trunk/examples/f77/x06f.fm4 =================================================================== --- trunk/examples/f77/x06f.fm4 2011-01-26 21:22:01 UTC (rev 11501) +++ trunk/examples/f77/x06f.fm4 2011-01-26 22:01:08 UTC (rev 11502) @@ -24,8 +24,7 @@ real*8 x, y character*3 text - integer PL_PARSE_FULL - parameter(PL_PARSE_FULL = 1) + include 'plplot_parameters.h' c Process command-line arguments call plparseopts(PL_PARSE_FULL) Modified: trunk/examples/f77/x07f.fm4 =================================================================== --- trunk/examples/f77/x07f.fm4 2011-01-26 21:22:01 UTC (rev 11501) +++ trunk/examples/f77/x07f.fm4 2011-01-26 22:01:08 UTC (rev 11502) @@ -28,8 +28,7 @@ & 0, 100, 0, 100, 200, 500, 600, 700, 800, 900, & 2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900 / real*8 x, y - integer PL_PARSE_FULL - parameter(PL_PARSE_FULL = 1) + include 'plplot_parameters.h' c Process command-line arguments call plparseopts(PL_PARSE_FULL) Modified: trunk/examples/f77/x08f.fm4 =================================================================== --- trunk/examples/f77/x08f.fm4 2011-01-26 21:22:01 UTC (rev 11501) +++ trunk/examples/f77/x08f.fm4 2011-01-26 22:01:08 UTC (rev 11502) @@ -20,8 +20,7 @@ c Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA implicit none - real*8 PI - parameter (PI = 3.1415926535897932384d0) + include 'plplot_parameters.h' integer i, j, k, ifshade, xpts, ypts, xdim, ydim c xdim is the leading dimension of z, xpts <= xdim is the leading c dimension of z that is defined. @@ -40,24 +39,9 @@ real*8 zmin, zmax, step, clevel(nlevel) c Plotting options for 3d plots, see plplot.h for the C definitions c of these options. - integer DRAW_LINEX, DRAW_LINEY, DRAW_LINEXY, MAG_COLOR, - & BASE_CONT, TOP_CONT, SURF_CONT, DRAW_SIDES, FACETED, MESH - parameter(DRAW_LINEX = 1) - parameter(DRAW_LINEY = 2) - parameter(DRAW_LINEXY = 3) - parameter(MAG_COLOR = 4) - parameter(BASE_CONT = 8) - parameter(TOP_CONT = 16) - parameter(SURF_CONT = 32) - parameter(DRAW_SIDES = 64) - parameter(FACETED = 128) - parameter(MESH = 256) - integer PL_PARSE_FULL - parameter(PL_PARSE_FULL = 1) c Process command-line arguments call plparseopts(PL_PARSE_FULL) - rosen = 1 do i = 1,xpts This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-01-26 22:37:30
|
Revision: 11501 http://plplot.svn.sourceforge.net/plplot/?rev=11501&view=rev Author: airwin Date: 2011-01-26 21:22:01 +0000 (Wed, 26 Jan 2011) Log Message: ----------- Put Fortran 77 PLplot parameters in their own separate include file (plplot_parameters.h) since this file is only used by Fortran 77 applications (e.g., the examples) and not by the bindings. Make build system adjustments so this include file is installed and found during build-tree and install-tree f77 example builds. Use this include file for example 4. Modified Paths: -------------- trunk/bindings/f77/CMakeLists.txt trunk/bindings/f77/sfstubs.h trunk/cmake/modules/fortran.cmake trunk/examples/f77/CMakeLists.txt trunk/examples/f77/x04f.fm4 Added Paths: ----------- trunk/bindings/f77/plplot_parameters.h Modified: trunk/bindings/f77/CMakeLists.txt =================================================================== --- trunk/bindings/f77/CMakeLists.txt 2011-01-26 21:09:43 UTC (rev 11500) +++ trunk/bindings/f77/CMakeLists.txt 2011-01-26 21:22:01 UTC (rev 11501) @@ -223,6 +223,7 @@ string(REGEX REPLACE "^.*:.*:.*:(.*)$" "\\1" PC_LIBRARY_NAME ${PC_DATA}) set(PC_LINK_FLAGS "${lib${PC_LIBRARY_NAME}_LINK_FLAGS}") set(PC_COMPILE_FLAGS "${lib${PC_LIBRARY_NAME}_COMPILE_FLAGS}") + set(PC_COMPILE_FLAGS "-I${F77_INCLUDE_DIR} ${PC_COMPILE_FLAGS}") set(PC_LINK_FLAGS "-l${PC_LIBRARY_NAME} -lplplotf77c${LIB_TAG}${VERSION_SUFFIX} ${PC_LINK_FLAGS}" ) @@ -236,4 +237,11 @@ ) install(FILES ${PC_CONFIGURED_FILE} DESTINATION ${PKG_CONFIG_DIR}) endif(PKG_CONFIG_EXECUTABLE) + + install( + FILES + ${CMAKE_CURRENT_SOURCE_DIR}/plplot_parameters.h + DESTINATION ${F77_INCLUDE_DIR} + ) + endif(ENABLE_f77) Added: trunk/bindings/f77/plplot_parameters.h =================================================================== --- trunk/bindings/f77/plplot_parameters.h (rev 0) +++ trunk/bindings/f77/plplot_parameters.h 2011-01-26 21:22:01 UTC (rev 11501) @@ -0,0 +1,90 @@ +C $Id$ +C parameters required for routines that use the plplotf77 library +C such as some of our f77 examples. +C +C Copyright (C) 2011 Alan W. Irwin +C +C This file is part of PLplot. +C +C PLplot is free software; you can redistribute it and/or modify +C it under the terms of the GNU General Library Public License as +C published by the Free Software Foundation; either version 2 of the +C License, or (at your option) any later version. +C +C PLplot is distributed in the hope that it will be useful, +C but WITHOUT ANY WARRANTY; without even the implied warranty of +C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +C GNU Library General Public License for more details. +C +C You should have received a copy of the GNU Library General Public +C License along with PLplot; if not, write to the Free Software +C Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +c flags used for position argument of both pllegend and plcolorbar + integer PL_POSITION_LEFT + integer PL_POSITION_RIGHT + integer PL_POSITION_UPPER + integer PL_POSITION_LOWER + integer PL_POSITION_INSIDE + integer PL_POSITION_OUTSIDE + integer PL_POSITION_VIEWPORT + integer PL_POSITION_SUBPAGE + + parameter (PL_POSITION_LEFT = 1 ) + parameter (PL_POSITION_RIGHT = 2 ) + parameter (PL_POSITION_UPPER = 4 ) + parameter (PL_POSITION_LOWER = 8 ) + parameter (PL_POSITION_INSIDE = 16 ) + parameter (PL_POSITION_OUTSIDE = 32 ) + parameter (PL_POSITION_VIEWPORT = 64 ) + parameter (PL_POSITION_SUBPAGE = 128 ) + +c Flags for pllegend. + integer PL_LEGEND_NONE + integer PL_LEGEND_COLOR_BOX + integer PL_LEGEND_LINE + integer PL_LEGEND_SYMBOL + integer PL_LEGEND_TEXT_LEFT + integer PL_LEGEND_BACKGROUND + integer PL_LEGEND_BOUNDING_BOX + integer PL_LEGEND_ROW_MAJOR + + parameter (PL_LEGEND_NONE = 1 ) + parameter (PL_LEGEND_COLOR_BOX = 2 ) + parameter (PL_LEGEND_LINE = 4 ) + parameter (PL_LEGEND_SYMBOL = 8 ) + parameter (PL_LEGEND_TEXT_LEFT = 16 ) + parameter (PL_LEGEND_BACKGROUND = 32 ) + parameter (PL_LEGEND_BOUNDING_BOX = 64 ) + parameter (PL_LEGEND_ROW_MAJOR = 128 ) + +c Flags for plcolorbar + integer PL_COLORBAR_LEFT + integer PL_COLORBAR_RIGHT + integer PL_COLORBAR_UPPER + integer PL_COLORBAR_LOWER + integer PL_COLORBAR_LABEL_LEFT + integer PL_COLORBAR_LABEL_RIGHT + integer PL_COLORBAR_LABEL_UPPER + integer PL_COLORBAR_LABEL_LOWER + integer PL_COLORBAR_IMAGE + integer PL_COLORBAR_SHADE + integer PL_COLORBAR_GRADIENT + integer PL_COLORBAR_CAP_LOW + integer PL_COLORBAR_CAP_HIGH + integer PL_COLORBAR_SHADE_LABEL + + parameter (PL_COLORBAR_LEFT = 1 ) + parameter (PL_COLORBAR_RIGHT = 2 ) + parameter (PL_COLORBAR_UPPER = 4 ) + parameter (PL_COLORBAR_LOWER = 8 ) + parameter (PL_COLORBAR_LABEL_LEFT = 16 ) + parameter (PL_COLORBAR_LABEL_RIGHT = 32 ) + parameter (PL_COLORBAR_LABEL_UPPER = 64 ) + parameter (PL_COLORBAR_LABEL_LOWER = 128 ) + parameter (PL_COLORBAR_IMAGE = 256 ) + parameter (PL_COLORBAR_SHADE = 512 ) + parameter (PL_COLORBAR_GRADIENT = 1024 ) + parameter (PL_COLORBAR_CAP_LOW = 2048 ) + parameter (PL_COLORBAR_CAP_HIGH = 4096 ) + parameter (PL_COLORBAR_SHADE_LABEL = 8192 ) Property changes on: trunk/bindings/f77/plplot_parameters.h ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/bindings/f77/sfstubs.h =================================================================== --- trunk/bindings/f77/sfstubs.h 2011-01-26 21:09:43 UTC (rev 11500) +++ trunk/bindings/f77/sfstubs.h 2011-01-26 21:22:01 UTC (rev 11501) @@ -40,73 +40,3 @@ common /zzplstr7/ string7 common /zzplstr8/ string8 common /zzplstr9/ string9 - - -c flags used for position argument of both pllegend and plcolorbar - integer PL_POSITION_LEFT - integer PL_POSITION_RIGHT - integer PL_POSITION_UPPER - integer PL_POSITION_LOWER - integer PL_POSITION_INSIDE - integer PL_POSITION_OUTSIDE - integer PL_POSITION_VIEWPORT - integer PL_POSITION_SUBPAGE - - parameter (PL_POSITION_LEFT = 1 ) - parameter (PL_POSITION_RIGHT = 2 ) - parameter (PL_POSITION_UPPER = 4 ) - parameter (PL_POSITION_LOWER = 8 ) - parameter (PL_POSITION_INSIDE = 16 ) - parameter (PL_POSITION_OUTSIDE = 32 ) - parameter (PL_POSITION_VIEWPORT = 64 ) - parameter (PL_POSITION_SUBPAGE = 128 ) - -c Flags for pllegend. - integer PL_LEGEND_NONE - integer PL_LEGEND_COLOR_BOX - integer PL_LEGEND_LINE - integer PL_LEGEND_SYMBOL - integer PL_LEGEND_TEXT_LEFT - integer PL_LEGEND_BACKGROUND - integer PL_LEGEND_BOUNDING_BOX - integer PL_LEGEND_ROW_MAJOR - - parameter (PL_LEGEND_NONE = 1 ) - parameter (PL_LEGEND_COLOR_BOX = 2 ) - parameter (PL_LEGEND_LINE = 4 ) - parameter (PL_LEGEND_SYMBOL = 8 ) - parameter (PL_LEGEND_TEXT_LEFT = 16 ) - parameter (PL_LEGEND_BACKGROUND = 32 ) - parameter (PL_LEGEND_BOUNDING_BOX = 64 ) - parameter (PL_LEGEND_ROW_MAJOR = 128 ) - -c Flags for plcolorbar - integer PL_COLORBAR_LEFT - integer PL_COLORBAR_RIGHT - integer PL_COLORBAR_UPPER - integer PL_COLORBAR_LOWER - integer PL_COLORBAR_LABEL_LEFT - integer PL_COLORBAR_LABEL_RIGHT - integer PL_COLORBAR_LABEL_UPPER - integer PL_COLORBAR_LABEL_LOWER - integer PL_COLORBAR_IMAGE - integer PL_COLORBAR_SHADE - integer PL_COLORBAR_GRADIENT - integer PL_COLORBAR_CAP_LOW - integer PL_COLORBAR_CAP_HIGH - integer PL_COLORBAR_SHADE_LABEL - - parameter (PL_COLORBAR_LEFT = 1 ) - parameter (PL_COLORBAR_RIGHT = 2 ) - parameter (PL_COLORBAR_UPPER = 4 ) - parameter (PL_COLORBAR_LOWER = 8 ) - parameter (PL_COLORBAR_LABEL_LEFT = 16 ) - parameter (PL_COLORBAR_LABEL_RIGHT = 32 ) - parameter (PL_COLORBAR_LABEL_UPPER = 64 ) - parameter (PL_COLORBAR_LABEL_LOWER = 128 ) - parameter (PL_COLORBAR_IMAGE = 256 ) - parameter (PL_COLORBAR_SHADE = 512 ) - parameter (PL_COLORBAR_GRADIENT = 1024 ) - parameter (PL_COLORBAR_CAP_LOW = 2048 ) - parameter (PL_COLORBAR_CAP_HIGH = 4096 ) - parameter (PL_COLORBAR_SHADE_LABEL = 8192 ) Modified: trunk/cmake/modules/fortran.cmake =================================================================== --- trunk/cmake/modules/fortran.cmake 2011-01-26 21:09:43 UTC (rev 11500) +++ trunk/cmake/modules/fortran.cmake 2011-01-26 21:22:01 UTC (rev 11501) @@ -62,6 +62,11 @@ set(ENABLE_f95 OFF CACHE BOOL "Enable f95 bindings" FORCE) endif(ENABLE_f95 AND NOT CMAKE_Fortran_COMPILER_SUPPORTS_F90) + # Set installation location for f77 include files + set(F77_INCLUDE_DIR ${LIB_DIR}/fortran/include/${PACKAGE} + CACHE PATH "installation location for f95 modules" + ) + # Set installation location for f95 modules. set(F95_MOD_DIR ${LIB_DIR}/fortran/modules/${PACKAGE} CACHE PATH "installation location for f95 modules" @@ -70,7 +75,7 @@ # Check if f77/f95 style command line parsing is possible include(TestF77CmdLine) - # Check if isnan is available as an fortran function + # Check if isnan is available as a fortran function include(TestFortranIsnan) # Determine which Fortran compiler we have. We do not need to Modified: trunk/examples/f77/CMakeLists.txt =================================================================== --- trunk/examples/f77/CMakeLists.txt 2011-01-26 21:09:43 UTC (rev 11500) +++ trunk/examples/f77/CMakeLists.txt 2011-01-26 21:22:01 UTC (rev 11501) @@ -128,11 +128,15 @@ if(CORE_BUILD) include_directories( ${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/bindings/f77 ${CMAKE_BINARY_DIR}/include ) set(f77_directory ${CMAKE_CURRENT_BINARY_DIR}) else(CORE_BUILD) - include_directories(${INCLUDE_DIR}) + include_directories( + ${INCLUDE_DIR} + ${F77_INCLUDE_DIR} + ) set(f77_directory ${CMAKE_CURRENT_SOURCE_DIR}) set(f77_target) endif(CORE_BUILD) Modified: trunk/examples/f77/x04f.fm4 =================================================================== --- trunk/examples/f77/x04f.fm4 2011-01-26 21:09:43 UTC (rev 11500) +++ trunk/examples/f77/x04f.fm4 2011-01-26 21:22:01 UTC (rev 11501) @@ -51,40 +51,8 @@ character*20 text(2) character*1 symbols(2) -c To include file! + include 'plplot_parameters.h' - integer PL_LEGEND_NONE - integer PL_LEGEND_COLOR_BOX - integer PL_LEGEND_LINE - integer PL_LEGEND_SYMBOL - integer PL_LEGEND_TEXT_LEFT - integer PL_LEGEND_BACKGROUND - integer PL_LEGEND_BOUNDING_BOX - integer PL_LEGEND_ROW_MAJOR - integer PL_LEGEND_LEFT - integer PL_LEGEND_RIGHT - integer PL_LEGEND_UPPER - integer PL_LEGEND_LOWER - integer PL_LEGEND_INSIDE - integer PL_LEGEND_OUTSIDE - - parameter (PL_LEGEND_NONE = 1 ) - parameter (PL_LEGEND_COLOR_BOX = 2 ) - parameter (PL_LEGEND_LINE = 4 ) - parameter (PL_LEGEND_SYMBOL = 8 ) - parameter (PL_LEGEND_TEXT_LEFT = 16 ) - parameter (PL_LEGEND_BACKGROUND = 32 ) - parameter (PL_LEGEND_BOUNDING_BOX = 64 ) - parameter (PL_LEGEND_ROW_MAJOR = 128 ) - parameter (PL_LEGEND_LEFT = 256 ) - parameter (PL_LEGEND_RIGHT = 512 ) - parameter (PL_LEGEND_UPPER = 1024 ) - parameter (PL_LEGEND_LOWER = 2048 ) - parameter (PL_LEGEND_INSIDE = 4096 ) - parameter (PL_LEGEND_OUTSIDE = 8192 ) - - - call pladv(0) c Set up data for log plot. f0 = 1.d0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-01-26 23:10:30
|
Revision: 11505 http://plplot.svn.sourceforge.net/plplot/?rev=11505&view=rev Author: airwin Date: 2011-01-26 23:10:23 +0000 (Wed, 26 Jan 2011) Log Message: ----------- Finish implementing plstring3 in the f77 bindings, and use plstring3 in f77 example 18 to give the same results as the corresponding C example. Modified Paths: -------------- trunk/bindings/f77/sfstubs.fm4 trunk/examples/f77/x18f.fm4 Modified: trunk/bindings/f77/sfstubs.fm4 =================================================================== --- trunk/bindings/f77/sfstubs.fm4 2011-01-26 22:56:42 UTC (rev 11504) +++ trunk/bindings/f77/sfstubs.fm4 2011-01-26 23:10:23 UTC (rev 11505) @@ -823,7 +823,6 @@ end - c*********************************************************************** subroutine plmeridians_none(dlong,dlat,minlong,maxlong, @@ -839,7 +838,6 @@ end - c*********************************************************************** subroutine plstring(n,x,y,string) @@ -856,7 +854,22 @@ end +c*********************************************************************** + subroutine plstring3(n,x,y,z,string) + + implicit none + integer n + real*8 x(n), y(n), z(n) + character*(*) string + + include 'sfstubs.h' + + call plstrf2c(string,s1,maxlen) + call plstring37(n,x,y,z,s1) + + end + c*********************************************************************** subroutine plstripc(id, xspec, yspec, xmin, xmax, xjump, Modified: trunk/examples/f77/x18f.fm4 =================================================================== --- trunk/examples/f77/x18f.fm4 2011-01-26 22:56:42 UTC (rev 11504) +++ trunk/examples/f77/x18f.fm4 2011-01-26 23:10:23 UTC (rev 11505) @@ -86,7 +86,8 @@ if ( opt(k).gt. 0 ) then call plline3( NPTS, x, y, z ) else - call plpoin3( NPTS, x, y, z, 1 ) +c U+22C5 DOT OPERATOR. + call plstring3( NPTS, x, y, z, "⋅" ) endif call plcol0(3) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-01-27 00:06:02
|
Revision: 11506 http://plplot.svn.sourceforge.net/plplot/?rev=11506&view=rev Author: airwin Date: 2011-01-27 00:05:56 +0000 (Thu, 27 Jan 2011) Log Message: ----------- Expand plplot_parameters.h to take care of the needs of f77 examples 19-21. Modified Paths: -------------- trunk/bindings/f77/plplot_parameters.h trunk/examples/f77/x19f.fm4 trunk/examples/f77/x20f.fm4 trunk/examples/f77/x21f.fm4 Modified: trunk/bindings/f77/plplot_parameters.h =================================================================== --- trunk/bindings/f77/plplot_parameters.h 2011-01-26 23:10:23 UTC (rev 11505) +++ trunk/bindings/f77/plplot_parameters.h 2011-01-27 00:05:56 UTC (rev 11506) @@ -20,12 +20,23 @@ C License along with PLplot; if not, write to the Free Software C Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +c common parameters integer PL_PARSE_FULL parameter(PL_PARSE_FULL = 1) real*8 PI, TWOPI parameter (PI = 3.1415926535897932384d0) parameter (TWOPI = 2.d0*PI) +c flags used for plgriddata() + integer GRID_CSA, GRID_DTLI, GRID_NNI, GRID_NNIDW, GRID_NNLI, + & GRID_NNAIDW + parameter (GRID_CSA = 1) + parameter (GRID_DTLI = 2) + parameter (GRID_NNI = 3) + parameter (GRID_NNIDW = 4) + parameter (GRID_NNLI = 5) + parameter (GRID_NNAIDW = 6) + c flags used for position argument of both pllegend and plcolorbar integer PL_POSITION_LEFT integer PL_POSITION_RIGHT Modified: trunk/examples/f77/x19f.fm4 =================================================================== --- trunk/examples/f77/x19f.fm4 2011-01-26 23:10:23 UTC (rev 11505) +++ trunk/examples/f77/x19f.fm4 2011-01-27 00:05:56 UTC (rev 11506) @@ -42,8 +42,7 @@ implicit none real*8 x, y, xt, yt, radius - real*8 PI - parameter ( PI = 3.1415926535897932384d0 ) + include 'plplot_parameters.h' radius = 90.0d0 - y xt = radius * cos(x * PI / 180.0d0) @@ -65,8 +64,7 @@ integer n real*8 x(n) real*8 y(n) - real*8 PI - parameter ( PI = 3.1415926535897932384d0 ) + include 'plplot_parameters.h' integer i real*8 xp, yp, radius @@ -155,8 +153,7 @@ external mapform19 external geolocation_labeler - integer PL_PARSE_FULL - parameter(PL_PARSE_FULL = 1) + include 'plplot_parameters.h' c Process command-line arguments call plparseopts(PL_PARSE_FULL) Modified: trunk/examples/f77/x20f.fm4 =================================================================== --- trunk/examples/f77/x20f.fm4 2011-01-26 23:10:23 UTC (rev 11505) +++ trunk/examples/f77/x20f.fm4 2011-01-27 00:05:56 UTC (rev 11506) @@ -74,8 +74,7 @@ real*8 XDIMR, YDIMR parameter(XDIM = 260, YDIM = 220) parameter(XDIMR = XDIM, YDIMR = YDIM) - real*8 PI - parameter(PI = 3.1415926535897932384d0) + include 'plplot_parameters.h' real*8 x(XDIM), y(YDIM), z(XDIM,YDIM), r(XDIM,YDIM) real*8 xi, yi, xe, ye @@ -109,10 +108,6 @@ logical nointeractive character*80 f_name - integer PL_PARSE_FULL - parameter( PL_PARSE_FULL = 1 ) - - c c Bugs in plimage(): c -at high magnifications, the left and right edge are ragged, try Modified: trunk/examples/f77/x21f.fm4 =================================================================== --- trunk/examples/f77/x21f.fm4 2011-01-26 23:10:23 UTC (rev 11505) +++ trunk/examples/f77/x21f.fm4 2011-01-27 00:05:56 UTC (rev 11506) @@ -19,31 +19,13 @@ c You should have received a copy of the GNU Library General Public c License along with PLplot; if not, write to the Free Software c Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - +c This is a separate routine so must be included before "implicit none" include 'plf77demos.inc' implicit none - real*8 PI - parameter (PI = 3.1415926535897932384d0) + include 'plplot_parameters.h' - integer PL_PARSE_FULL - parameter(PL_PARSE_FULL = 1) - - integer GRID_CSA, GRID_DTLI, GRID_NNI, GRID_NNIDW, GRID_NNLI, - & GRID_NNAIDW - parameter (GRID_CSA = 1) - parameter (GRID_DTLI = 2) - parameter (GRID_NNI = 3) - parameter (GRID_NNIDW = 4) - parameter (GRID_NNLI = 5) - parameter (GRID_NNAIDW = 6) - - integer DRAW_LINEXY, MAG_COLOR, BASE_CONT - parameter(DRAW_LINEXY = 3) - parameter(MAG_COLOR = 4) - parameter(BASE_CONT = 8) - external plrandd real*8 plrandd This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-01-27 03:42:11
|
Revision: 11509 http://plplot.svn.sourceforge.net/plplot/?rev=11509&view=rev Author: airwin Date: 2011-01-27 03:42:04 +0000 (Thu, 27 Jan 2011) Log Message: ----------- Expand plplot_parameters.h to include PL_NOTSET and include/use that file for f77 examples 27-31. Modified Paths: -------------- trunk/bindings/f77/plplot_parameters.h trunk/examples/f77/x27f.fm4 trunk/examples/f77/x28f.fm4 trunk/examples/f77/x29f.fm4 trunk/examples/f77/x30f.fm4 trunk/examples/f77/x31f.fm4 Modified: trunk/bindings/f77/plplot_parameters.h =================================================================== --- trunk/bindings/f77/plplot_parameters.h 2011-01-27 02:53:21 UTC (rev 11508) +++ trunk/bindings/f77/plplot_parameters.h 2011-01-27 03:42:04 UTC (rev 11509) @@ -26,6 +26,8 @@ real*8 PI, TWOPI parameter (PI = 3.1415926535897932384d0) parameter (TWOPI = 2.d0*PI) + real*8 PL_NOTSET + parameter(PL_NOTSET = -42.0d0) c flags used for plgriddata() integer GRID_CSA, GRID_DTLI, GRID_NNI, GRID_NNIDW, GRID_NNLI, Modified: trunk/examples/f77/x27f.fm4 =================================================================== --- trunk/examples/f77/x27f.fm4 2011-01-27 02:53:21 UTC (rev 11508) +++ trunk/examples/f77/x27f.fm4 2011-01-27 03:42:04 UTC (rev 11509) @@ -34,8 +34,7 @@ implicit none - integer PL_PARSE_FULL - parameter(PL_PARSE_FULL = 1) + include 'plplot_parameters.h' c R, r, p, N Modified: trunk/examples/f77/x28f.fm4 =================================================================== --- trunk/examples/f77/x28f.fm4 2011-01-27 02:53:21 UTC (rev 11508) +++ trunk/examples/f77/x28f.fm4 2011-01-27 03:42:04 UTC (rev 11509) @@ -24,6 +24,7 @@ program x28f implicit none + include 'plplot_parameters.h' integer XPTS, YPTS, NREVOLUTION, NROTATION, NSHEAR parameter(XPTS = 2) @@ -32,8 +33,6 @@ parameter(NROTATION = 8) parameter(NSHEAR = 8) real*8 x(XPTS), y(YPTS), z(XPTS,YPTS) - real*8 PI - parameter (PI = 3.1415926535897932384d0) real*8 xmin, xmax, xmid, xrange parameter(xmin = 0.d0) parameter(xmax = 1.d0) @@ -68,10 +67,6 @@ integer i, j real*8 radius, pitch, xpos, ypos, zpos integer lnblnk - integer PL_PARSE_FULL - parameter(PL_PARSE_FULL = 1) - integer DRAW_LINEXY - parameter(DRAW_LINEXY = 3) character*80 pstring pstring = Modified: trunk/examples/f77/x29f.fm4 =================================================================== --- trunk/examples/f77/x29f.fm4 2011-01-27 02:53:21 UTC (rev 11508) +++ trunk/examples/f77/x29f.fm4 2011-01-27 03:42:04 UTC (rev 11509) @@ -24,14 +24,12 @@ program x29f implicit none + include 'plplot_parameters.h' real*8 x(365), y(365), xerr1(365), xerr2(365), yerr1(365), & yerr2(365) common /plotdat/ x, y, xerr1, xerr2, yerr1, yerr2 - integer PL_PARSE_FULL - parameter(PL_PARSE_FULL = 1) - call plparseopts(PL_PARSE_FULL) call plinit() @@ -53,6 +51,7 @@ c subroutine plot1() implicit none + include 'plplot_parameters.h' real*8 x(365), y(365), xerr1(365), xerr2(365), yerr1(365), & yerr2(365) @@ -67,9 +66,6 @@ parameter(ymin = 10.0d0) parameter(ymax = 20.0d0) - real*8 PI - parameter (PI = 3.1415926535897932384d0) - do i = 1,npts x(i) = xmax*(dble(i-1)/dble(npts)) y(i) = 15.0d0 - 5.0d0*cos(2.0d0*PI*dble(i-1)/dble(npts)) @@ -120,6 +116,7 @@ c subroutine plot2() implicit none + include 'plplot_parameters.h' integer j, npts real*8 xmin, xmax, ymin, ymax @@ -139,9 +136,6 @@ parameter(ymin = 0) parameter(ymax = 24) - real*8 PI - parameter (PI = 3.1415926535897932384d0) - c Formula for hours of daylight from c "A Model Comparison for Daylength as a Function of Latitude and c Day of the Year", 1995, Ecological Modelling, 80, pp 87-95. @@ -178,6 +172,7 @@ c subroutine plot3() implicit none + include 'plplot_parameters.h' integer i, npts real*8 xmin, xmax, ymin, ymax @@ -187,9 +182,6 @@ & yerr2(365) common /plotdat/ x, y, xerr1, xerr2, yerr1, yerr2 - real*8 PI - parameter (PI = 3.1415926535897932384d0) - c integer tm(9) parameter (npts = 62) Modified: trunk/examples/f77/x30f.fm4 =================================================================== --- trunk/examples/f77/x30f.fm4 2011-01-27 02:53:21 UTC (rev 11508) +++ trunk/examples/f77/x30f.fm4 2011-01-27 03:42:04 UTC (rev 11509) @@ -25,6 +25,7 @@ program x30f implicit none + include 'plplot_parameters.h' integer red(4), green(4), blue(4) real*8 alpha(4), px(4), py(4) @@ -50,9 +51,6 @@ character*1 defined - integer PL_PARSE_FULL - parameter(PL_PARSE_FULL = 1) - call plparseopts(PL_PARSE_FULL) call plinit() Modified: trunk/examples/f77/x31f.fm4 =================================================================== --- trunk/examples/f77/x31f.fm4 2011-01-27 02:53:21 UTC (rev 11508) +++ trunk/examples/f77/x31f.fm4 2011-01-27 03:42:04 UTC (rev 11509) @@ -27,6 +27,7 @@ c-------------------------------------------------------------------------- implicit none + include 'plplot_parameters.h' real*8 xmin, xmax, ymin, ymax, zxmin, zxmax, zymin, zymax real*8 xmid, ymid, wx, wy real*8 mar, aspect, jx, jy, ori @@ -50,11 +51,6 @@ c Parse and process command line arguments - integer PL_PARSE_FULL - parameter(PL_PARSE_FULL = 1) - real*8 PL_NOTSET - parameter(PL_NOTSET = -42.0d0) - status = 0 stderr = 0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-01-27 09:59:52
|
Revision: 11511 http://plplot.svn.sourceforge.net/plplot/?rev=11511&view=rev Author: airwin Date: 2011-01-27 09:59:42 +0000 (Thu, 27 Jan 2011) Log Message: ----------- Use much more extensive plplot_parameters.h (generated by sed script) that allows (and also requires) removing many parameter statements from examples. Modified Paths: -------------- trunk/bindings/f95/plplot_parameters.h trunk/doc/docbook/src/api.xml trunk/doc/docbook/src/plplotdoc.xml.in trunk/examples/f95/x08f.f90 trunk/examples/f95/x09f.f90 trunk/examples/f95/x11f.f90 trunk/examples/f95/x16af.f90 trunk/examples/f95/x18f.f90 trunk/examples/f95/x21f.f90 trunk/examples/f95/x28f.f90 trunk/scripts/MinGW_MSYS_comprehensive_test.sh Modified: trunk/bindings/f95/plplot_parameters.h =================================================================== --- trunk/bindings/f95/plplot_parameters.h 2011-01-27 06:54:28 UTC (rev 11510) +++ trunk/bindings/f95/plplot_parameters.h 2011-01-27 09:59:42 UTC (rev 11511) @@ -1,40 +1,126 @@ - ! - ! Parameters connecting a mnemonic name to the - ! constants used by various routines - ! - integer, parameter :: PL_PARSE_FULL = 1 - - integer, parameter :: PL_GRID_CSA = 1 - integer, parameter :: PL_GRID_DTLI = 2 - integer, parameter :: PL_GRID_NNI = 3 - integer, parameter :: PL_GRID_NNIDW = 4 - integer, parameter :: PL_GRID_NNLI = 5 - integer, parameter :: PL_GRID_NNAIDW = 6 - - integer, parameter :: PL_JUST_NONE = -1 - integer, parameter :: PL_JUST_OPTIMAL = 0 - integer, parameter :: PL_JUST_SAME = 1 - integer, parameter :: PL_JUST_ISOMETRIC = 2 - - integer, parameter :: PL_AXIS_NOTHING = -2 - integer, parameter :: PL_AXIS_BOX_ONLY = -1 - integer, parameter :: PL_AXIS_NORMAL = 0 - integer, parameter :: PL_AXIS_ATZERO = 1 - integer, parameter :: PL_AXIS_MAJORGRID = 2 - integer, parameter :: PL_AXIS_MINORGRID = 3 - integer, parameter :: PL_AXIS_LOGX = 10 - integer, parameter :: PL_AXIS_LOGY = 20 - integer, parameter :: PL_AXIS_LOGXY = 30 - - integer, parameter :: PL_FONT_STANDARD = 0 - integer, parameter :: PL_FONT_EXTENDED = 1 - + integer, parameter :: PLESC_SET_RGB = 1 ! obsolete + integer, parameter :: PLESC_ALLOC_NCOL = 2 ! obsolete + integer, parameter :: PLESC_SET_LPB = 3 ! obsolete + integer, parameter :: PLESC_EXPOSE = 4 ! handle window expose + integer, parameter :: PLESC_RESIZE = 5 ! handle window resize + integer, parameter :: PLESC_REDRAW = 6 ! handle window redraw + integer, parameter :: PLESC_TEXT = 7 ! switch to text screen + integer, parameter :: PLESC_GRAPH = 8 ! switch to graphics screen + integer, parameter :: PLESC_FILL = 9 ! fill polygon + integer, parameter :: PLESC_DI = 10 ! handle DI command + integer, parameter :: PLESC_FLUSH = 11 ! flush output + integer, parameter :: PLESC_EH = 12 ! handle Window events + integer, parameter :: PLESC_GETC = 13 ! get cursor position + integer, parameter :: PLESC_SWIN = 14 ! set window parameters + integer, parameter :: PLESC_PLFLTBUFFERING = 15 ! configure PLFLT buffering + integer, parameter :: PLESC_XORMOD = 16 ! set xor mode + integer, parameter :: PLESC_SET_COMPRESSION = 17 ! AFR: set compression + integer, parameter :: PLESC_CLEAR = 18 ! RL: clear graphics region + integer, parameter :: PLESC_DASH = 19 ! RL: draw dashed line + integer, parameter :: PLESC_HAS_TEXT = 20 ! driver draws text + integer, parameter :: PLESC_IMAGE = 21 ! handle image + integer, parameter :: PLESC_IMAGEOPS = 22 ! plimage related operations + integer, parameter :: DRAW_LINEX = z'01' ! draw lines parallel to the X axis + integer, parameter :: DRAW_LINEY = z'02' ! draw lines parallel to the Y axis + integer, parameter :: DRAW_LINEXY = z'03' ! draw lines parallel to both the X and Y axes + integer, parameter :: MAG_COLOR = z'04' ! draw the mesh with a color dependent of the magnitude + integer, parameter :: BASE_CONT = z'08' ! draw contour plot at bottom xy plane + integer, parameter :: TOP_CONT = z'10' ! draw contour plot at top xy plane + integer, parameter :: SURF_CONT = z'20' ! draw contour plot at surface + integer, parameter :: DRAW_SIDES = z'40' ! draw sides + integer, parameter :: FACETED = z'80' ! draw outline for each square that makes up the surface + integer, parameter :: MESH = z'100' ! draw mesh + integer, parameter :: PL_BIN_DEFAULT = 0 + integer, parameter :: PL_BIN_CENTRED = 1 + integer, parameter :: PL_BIN_NOEXPAND = 2 + integer, parameter :: PL_BIN_NOEMPTY = 4 + integer, parameter :: PL_HIST_DEFAULT = 0 + integer, parameter :: PL_HIST_NOSCALING = 1 + integer, parameter :: PL_HIST_IGNORE_OUTLIERS = 2 + integer, parameter :: PL_HIST_NOEXPAND = 8 + integer, parameter :: PL_HIST_NOEMPTY = 16 + integer, parameter :: PL_POSITION_LEFT = 1 + integer, parameter :: PL_POSITION_RIGHT = 2 + integer, parameter :: PL_POSITION_UPPER = 4 + integer, parameter :: PL_POSITION_LOWER = 8 + integer, parameter :: PL_POSITION_INSIDE = 16 + integer, parameter :: PL_POSITION_OUTSIDE = 32 + integer, parameter :: PL_POSITION_VIEWPORT = 64 + integer, parameter :: PL_POSITION_SUBPAGE = 128 + integer, parameter :: PL_LEGEND_NONE = 1 + integer, parameter :: PL_LEGEND_COLOR_BOX = 2 + integer, parameter :: PL_LEGEND_LINE = 4 + integer, parameter :: PL_LEGEND_SYMBOL = 8 + integer, parameter :: PL_LEGEND_TEXT_LEFT = 16 + integer, parameter :: PL_LEGEND_BACKGROUND = 32 + integer, parameter :: PL_LEGEND_BOUNDING_BOX = 64 + integer, parameter :: PL_LEGEND_ROW_MAJOR = 128 + integer, parameter :: PL_COLORBAR_LEFT = 1 + integer, parameter :: PL_COLORBAR_RIGHT = 2 + integer, parameter :: PL_COLORBAR_UPPER = 4 + integer, parameter :: PL_COLORBAR_LOWER = 8 + integer, parameter :: PL_COLORBAR_LABEL_LEFT = 16 + integer, parameter :: PL_COLORBAR_LABEL_RIGHT = 32 + integer, parameter :: PL_COLORBAR_LABEL_UPPER = 64 + integer, parameter :: PL_COLORBAR_LABEL_LOWER = 128 + integer, parameter :: PL_COLORBAR_IMAGE = 256 + integer, parameter :: PL_COLORBAR_SHADE = 512 + integer, parameter :: PL_COLORBAR_GRADIENT = 1024 + integer, parameter :: PL_COLORBAR_CAP_LOW = 2048 + integer, parameter :: PL_COLORBAR_CAP_HIGH = 4096 + integer, parameter :: PL_COLORBAR_SHADE_LABEL = 8192 + integer, parameter :: PLSWIN_DEVICE = 1 ! device coordinates + integer, parameter :: PLSWIN_WORLD = 2 ! world coordinates + integer, parameter :: PL_X_AXIS = 1 ! The x-axis + integer, parameter :: PL_Y_AXIS = 2 ! The y-axis + integer, parameter :: PL_Z_AXIS = 3 ! The z-axis + integer, parameter :: PL_OPT_ENABLED = z'0001' ! Obsolete + integer, parameter :: PL_OPT_ARG = z'0002' ! Option has an argment + integer, parameter :: PL_OPT_NODELETE = z'0004' ! Don't delete after processing + integer, parameter :: PL_OPT_INVISIBLE = z'0008' ! Make invisible + integer, parameter :: PL_OPT_DISABLED = z'0010' ! Processing is disabled + integer, parameter :: PL_OPT_FUNC = z'0100' ! Call handler function + integer, parameter :: PL_OPT_BOOL = z'0200' ! Set *var = 1 + integer, parameter :: PL_OPT_INT = z'0400' ! Set *var = atoi(optarg) + integer, parameter :: PL_OPT_FLOAT = z'0800' ! Set *var = atof(optarg) + integer, parameter :: PL_OPT_STRING = z'1000' ! Set var = optarg + integer, parameter :: PL_PARSE_PARTIAL = z'0000' ! For backward compatibility + integer, parameter :: PL_PARSE_FULL = z'0001' ! Process fully & exit if error + integer, parameter :: PL_PARSE_QUIET = z'0002' ! Don't issue messages + integer, parameter :: PL_PARSE_NODELETE = z'0004' ! Don't delete options after + integer, parameter :: PL_PARSE_SHOWALL = z'0008' ! Show invisible options + integer, parameter :: PL_PARSE_OVERRIDE = z'0010' ! Obsolete + integer, parameter :: PL_PARSE_NOPROGRAM = z'0020' ! Program name NOT in *argv[0].. + integer, parameter :: PL_PARSE_NODASH = z'0040' ! Set if leading dash NOT required + integer, parameter :: PL_PARSE_SKIP = z'0080' ! Skip over unrecognized args + integer, parameter :: PL_FCI_IMPOSSIBLE = z'00000000' + integer, parameter :: PL_FCI_HEXDIGIT_MASK = z'f' + integer, parameter :: PL_FCI_HEXPOWER_MASK = z'7' + integer, parameter :: PL_FCI_HEXPOWER_IMPOSSIBLE = z'f' + integer, parameter :: PL_FCI_FAMILY = z'0' + integer, parameter :: PL_FCI_STYLE = z'1' + integer, parameter :: PL_FCI_WEIGHT = z'2' + integer, parameter :: PL_FCI_SANS = z'0' + integer, parameter :: PL_FCI_SERIF = z'1' + integer, parameter :: PL_FCI_MONO = z'2' + integer, parameter :: PL_FCI_SCRIPT = z'3' + integer, parameter :: PL_FCI_SYMBOL = z'4' + integer, parameter :: PL_FCI_UPRIGHT = z'0' + integer, parameter :: PL_FCI_ITALIC = z'1' + integer, parameter :: PL_FCI_OBLIQUE = z'2' + integer, parameter :: PL_FCI_MEDIUM = z'0' + integer, parameter :: PL_FCI_BOLD = z'1' + integer, parameter :: PL_MAXKEY = 16 + integer, parameter :: PL_MAXWINDOWS = 64 ! Max number of windows/page tracked real(kind=plflt), parameter :: PL_NOTSET = -42.0_plflt - - ! - ! TODO: - ! Parameters for fill patterns and symbols - ! - real(kind=plflt), parameter :: PL_PI = 3.1415926535897932384_plflt - + real(kind=plflt), parameter :: PL_TWOPI = 2.0_plflt*PL_PI + integer, parameter :: PLESPLFLTBUFFERING_ENABLE = 1 + integer, parameter :: PLESPLFLTBUFFERING_DISABLE = 2 + integer, parameter :: PLESPLFLTBUFFERING_QUERY = 3 + integer, parameter :: GRID_CSA = 1 ! Bivariate Cubic Spline approximation + integer, parameter :: GRID_DTLI = 2 ! Delaunay Triangulation Linear Interpolation + integer, parameter :: GRID_NNI = 3 ! Natural Neighbors Interpolation + integer, parameter :: GRID_NNIDW = 4 ! Nearest Neighbors Inverse Distance Weighted + integer, parameter :: GRID_NNLI = 5 ! Nearest Neighbors Linear Interpolation + integer, parameter :: GRID_NNAIDW = 6 ! Nearest Neighbors Around Inverse Distance Weighted Modified: trunk/doc/docbook/src/api.xml =================================================================== --- trunk/doc/docbook/src/api.xml 2011-01-27 06:54:28 UTC (rev 11510) +++ trunk/doc/docbook/src/api.xml 2011-01-27 09:59:42 UTC (rev 11511) @@ -6301,7 +6301,7 @@ <sect1 id="pllegend" renderas="sect3"> <title> <function>pllegend</function>: Create a discrete annotated legend using - boxes, lines, and/or lines of symbols + colored boxes, lines, and/or lines of symbols </title> <para> @@ -6310,11 +6310,17 @@ <funcdef> <function>pllegend</function> </funcdef> + <paramdef><parameter>p_legend_width</parameter></paramdef> + <paramdef><parameter>p_legend_height</parameter></paramdef> <paramdef><parameter>opt</parameter></paramdef> <paramdef><parameter>x</parameter></paramdef> <paramdef><parameter>y</parameter></paramdef> <paramdef><parameter>plot_width</parameter></paramdef> <paramdef><parameter>bg_color</parameter></paramdef> + <paramdef><parameter>bb_color</parameter></paramdef> + <paramdef><parameter>bb_style</parameter></paramdef> + <paramdef><parameter>nrow</parameter></paramdef> + <paramdef><parameter>ncolumn</parameter></paramdef> <paramdef><parameter>nlegend</parameter></paramdef> <paramdef><parameter>opt_array</parameter></paramdef> <paramdef><parameter>text_offset</parameter></paramdef> @@ -6326,6 +6332,7 @@ <paramdef><parameter>box_colors</parameter></paramdef> <paramdef><parameter>box_patterns</parameter></paramdef> <paramdef><parameter>box_scales</parameter></paramdef> + <paramdef><parameter>box_line_widths</parameter></paramdef> <paramdef><parameter>line_colors</parameter></paramdef> <paramdef><parameter>line_styles</parameter></paramdef> <paramdef><parameter>line_widths</parameter></paramdef> @@ -6338,42 +6345,99 @@ </para> <para> - (N.B. This is an experimental API that may be subject to further - change as we gain more experience with it.) Routine for creating a - discrete plot legend with a plotted box, line, and/or line of symbols - for each annotated legend entry. The arguments of pllegend provide - control over the location and size of the legend within the current - subpage as well as the location and characteristics of the elements - (most of which are optional) within that legend. The resulting legend - is clipped at the boundaries of the current subpage + Routine for creating a discrete plot legend with a plotted + filled box, line, and/or line of symbols for each annotated legend + entry. The arguments of pllegend provide control over the location + and size of the legend as well as the location and characteristics of + the elements (most of which are optional) within that legend. The + resulting legend is clipped at the boundaries of the current subpage. </para> <variablelist> <varlistentry> <term> + <parameter>p_legend_width</parameter> + (<literal>PLFLT *</literal>, output) + </term> + <listitem> + <para> + Pointer to a location which contains (after the call) the + legend width in normalized viewport coordinates. This quantity is + calculated from <literal><parameter>plot_width</parameter></literal>. + <literal><parameter>text_offset</parameter></literal>, + <literal><parameter>ncolumn</parameter></literal> (possibly modified + inside the routine depending on + <literal><parameter>nlegend</parameter></literal> and + <literal><parameter>nrow</parameter></literal>), and the length + (calculated internally) of the longest text string. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>p_legend_height</parameter> + (<literal>PLFLT *</literal>, output) + </term> + <listitem> + <para> + Pointer to a location which contains (after the call) the + legend height in normalized viewport coordinates. This quantity is + calculated from <literal><parameter>text_scale</parameter></literal>, + <literal><parameter>text_spacing</parameter></literal>, and + <literal><parameter>nrow</parameter></literal> (possibly modified + inside the routine depending on + <literal><parameter>nlegend</parameter></literal> and + <literal><parameter>nrow</parameter></literal>). + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> <parameter>opt</parameter> (<literal>PLINT</literal>, input) </term> <listitem> <para> - <parameter>opt</parameter> contains bits controlling the - overall legend. If the <parameter>PL_LEGEND_BACKGROUND</parameter> - bit is set, plot a (semi-transparent) background for the legend. If - the <parameter>PL_LEGEND_TEXT_LEFT</parameter> bit is set, put the - text area on the left of the legend and the plotted area on the right. - Otherwise, put the text area on the right of the legend and the - plotted area on the left. + <literal><parameter>opt</parameter></literal> contains + bits controlling the overall legend. If the + <literal>PL_LEGEND_TEXT_LEFT</literal> bit is set, put the text area + on the left of the legend and the plotted area on the + right. Otherwise, put the text area on the right of the legend and the + plotted area on the left. If the + <literal>PL_LEGEND_BACKGROUND</literal> bit is set, plot a + (semi-transparent) background for the legend. If the + <literal>PL_LEGEND_BOUNDING_BOX</literal> bit is set, plot a bounding + box for the legend. If the <literal>PL_LEGEND_ROW_MAJOR</literal> bit + is set and both of (possibly internally transformed) + <literal><parameter>nrow</parameter></literal> > 1 and + <literal><parameter>ncolumn</parameter></literal> > 1, then plot + the resulting array of legend entries in row-major order. Finally, the + combination of the <literal>PL_LEGEND_LEFT</literal>, + <literal>PL_LEGEND_RIGHT</literal>, + <literal>PL_LEGEND_UPPER</literal>, + <literal>PL_LEGEND_LOWER</literal>, + <literal>PL_LEGEND_INSIDE</literal>, and + <literal>PL_LEGEND_OUTSIDE</literal> position bits specifies one of + the 16 possible standard positions (the 4 corners and 4 side centers + for both the inside and outside cases) of the legend relative to the + viewport. </para> </listitem> </varlistentry> <varlistentry> <term> <parameter>x</parameter> - (<literal>PLFLT</literal>, input) + (<literal> PLFLT</literal>, input) </term> <listitem> <para> - Normalized sub-page X position of the upper-left corner of - the legend. + X offset of the legend position in normalized viewport + coordinates from the specified standard position of the legend. For + positive x, the direction of motion away from the standard position is + inward/outward from the standard corner positions or standard + center-left or center-right positions if the + <literal>PL_LEGEND_INSIDE</literal>/<literal>PL_LEGEND_OUTSIDE</literal> + bit is set in opt. For the center-upper or center-lower cases, the + direction of motion is toward positive X. </para> </listitem> </varlistentry> @@ -6384,8 +6448,14 @@ </term> <listitem> <para> - Normalized sub-page Y position of the upper-left corner of - the legend. + Y offset of the legend position in normalized viewport + coordinates from the specified standard position of the legend. For + positive y, the direction of motion away from the standard position is + inward/outward from the standard corner positions or standard + center-upper or center-lower positions if the + <literal>PL_LEGEND_INSIDE</literal>/<literal>PL_LEGEND_OUTSIDE</literal> + bit is set in opt. For the center-left or center-right cases, the + direction of motion is toward positive Y. </para> </listitem> </varlistentry> @@ -6396,13 +6466,9 @@ </term> <listitem> <para> - Horizontal width in normalized subpage units of the plot - area (where the rectangular boxes, lines, and/or lines of symbols are - drawn) of the legend. N.B. The total horizontal width of the legend - in normalized subpage coordinates is calculated internally - from <parameter>plot_width</parameter>, - <parameter>text_offset</parameter> (see below), and length (calculated - internally) of the longest text string. + Horizontal width in normalized viewport units of the plot + area (where the colored boxes, lines, and/or lines of symbols are + drawn) of the legend. </para> </listitem> </varlistentry> @@ -6414,22 +6480,70 @@ <listitem> <para> The cmap0 index of the background color for the legend - (<parameter>PL_LEGEND_BACKGROUND</parameter>). + (<literal>PL_LEGEND_BACKGROUND</literal>). </para> </listitem> </varlistentry> <varlistentry> <term> + <parameter>bb_color</parameter> + (<literal>PLINT</literal>, input) + </term> + <listitem> + <para> + cmap0 index of the color of the bounding-box line for the legend + (<literal>PL_LEGEND_BOUNDING_BOX</literal>). + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>bb_style</parameter> + (<literal>PLINT</literal>, input) + </term> + <listitem> + <para> + The cmap0 index of the background color for the legend + (<literal>PL_LEGEND_BACKGROUND</literal>). + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>nrow</parameter> + (<literal>PLINT</literal>, input) + </term> + <listitem> + <para> + The cmap0 index of the background color for the legend + (<literal>PL_LEGEND_BACKGROUND</literal>). + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>ncolumn</parameter> + (<literal>PLINT</literal>, input) + </term> + <listitem> + <para> + The cmap0 index of the background color for the legend + (<literal>PL_LEGEND_BACKGROUND</literal>). + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> <parameter>nlegend</parameter> (<literal>PLINT</literal>, input) </term> <listitem> <para> - Number of legend entries. N.B. The total vertical height - of the legend in normalized subpage coordinates is - calculated internally from <parameter>nlegend</parameter>, - <parameter>text_scale</parameter> (see below), and - <parameter>text_spacing</parameter> (see below). + Number of legend entries.N.B. The total vertical height + of the legend in normalized subpage coordinates is calculated + internally from <literal><parameter>nlegend</parameter></literal>, + <literal><parameter>text_scale</parameter></literal> (see below), and + <literal><parameter>text_spacing</parameter></literal> (see below). </para> </listitem> </varlistentry> @@ -6574,6 +6688,19 @@ </varlistentry> <varlistentry> <term> + <parameter>box_line_widths</parameter> + (<literal>const PLINT *</literal>, input) + </term> + <listitem> + <para> + Array of nlegend scales (units of fraction of character height) for + the height of the discrete colored boxes + (<parameter>PL_LEGEND_COLOR_BOX</parameter>). + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> <parameter>line_colors</parameter> (<literal>const PLINT *</literal>, input) </term> @@ -6647,7 +6774,7 @@ <varlistentry> <term> <parameter>symbols</parameter> - (<literal>const PLINT *</literal>, input) + (<literal>const char **</literal>, input) </term> <listitem> <para> @@ -8539,7 +8666,7 @@ <sect1 id="plpoin" renderas="sect3"> <title> - <function>plpoin</function>: Plots a character at the specified points + <function>plpoin</function>: Plot a glyph at the specified points </title> <para> @@ -8557,18 +8684,22 @@ </para> <para> - Marks a set of <literal><parameter>n</parameter></literal> - points in - <literal><parameter>x</parameter></literal> and - <literal><parameter>y</parameter></literal> using - the symbol defined by - <literal><parameter>code</parameter></literal>. - If - <literal><parameter>code</parameter></literal> is between 32 and 127, - the symbol is simply the corresponding printable ASCII character - in the default font. + Plot a glyph at a set of + <literal><parameter>n</parameter></literal> points at positions + <literal>(<parameter>x</parameter>[i], + <parameter>y</parameter>[i])</literal> using the glyph defined by + <literal><parameter>code</parameter></literal>. This function is + superseded by &plstring; which gives access to many(!) more glyphs. + code=-1 means try to just draw a point. Right now it's just a move + and a draw at the same place. Not ideal, since a sufficiently + intelligent output device may optimize it away, or there may be faster + ways of doing it. This is OK for now, though, and offers a 4X speedup + over drawing a Hershey font "point" (which is actually diamond shaped + and therefore takes 4 strokes to draw). If 0 < code < 32, then + a useful (but small subset) of Hershey symbols is plotted. If 32 + <= code <= 127 the corresponding printable ASCII character is + plotted. </para> - <!-- TODO: Hershey symbols outside the range --> <variablelist> <varlistentry> @@ -8578,7 +8709,9 @@ </term> <listitem> <para> - Number of points to be marked. + Number of points in the + <literal><parameter>x</parameter></literal> and + <literal><parameter>y</parameter></literal> arrays. </para> </listitem> </varlistentry> @@ -8589,7 +8722,7 @@ </term> <listitem> <para> - Pointer to array with x coordinates of the points. + Pointer to an array with X coordinates of points. </para> </listitem> </varlistentry> @@ -8600,7 +8733,7 @@ </term> <listitem> <para> - Pointer to array with y coordinates of the points. + Pointer to an array with Y coordinates of points. </para> </listitem> </varlistentry> @@ -8611,7 +8744,8 @@ </term> <listitem> <para> - Code number for the symbol to be plotted. + Hershey symbol code corresponding to a glyph to be plotted + at each of the <literal><parameter>n</parameter></literal> points. </para> </listitem> </varlistentry> @@ -8629,8 +8763,7 @@ <sect1 id="plpoin3" renderas="sect3"> <title> - <function>plpoin3</function>: Plots a character at the specified - points in 3 space + <function>plpoin3</function>: Plot a glyph at the specified 3D points </title> <para> @@ -8649,18 +8782,19 @@ </para> <para> - Marks a set of <literal><parameter>n</parameter></literal> - points in - <literal><parameter>x</parameter></literal>, - <literal><parameter>y</parameter></literal>, and - <literal><parameter>z</parameter></literal> using - the symbol defined by - <literal><parameter>code</parameter></literal>. - If - <literal><parameter>code</parameter></literal> is between 32 and 127, - the symbol is simply the corresponding printable ASCII character - in the default font. - Setup similar to &plline3;. + Plot a glyph at a set of + <literal><parameter>n</parameter></literal> points at positions + <literal>(<parameter>x</parameter>[i], <parameter>y</parameter>[i], + <parameter>z</parameter>[i])</literal> using the glyph defined by + <literal><parameter>code</parameter></literal>. code=-1 means try to + just draw a point. Right now it's just a move and a draw at the same + place. Not ideal, since a sufficiently intelligent output device may + optimize it away, or there may be faster ways of doing it. This is OK + for now, though, and offers a 4X speedup over drawing a Hershey font + "point" (which is actually diamond shaped and therefore takes 4 + strokes to draw). If 0 < code < 32, then a useful (but small + subset) of Hershey symbols is plotted. If 32 <= code <= 127 the + corresponding printable ASCII character is plotted. </para> <variablelist> @@ -8671,7 +8805,9 @@ </term> <listitem> <para> - Number of points to be marked. + Number of points in the + <literal><parameter>x</parameter></literal> and + <literal><parameter>y</parameter></literal> arrays. </para> </listitem> </varlistentry> @@ -8682,7 +8818,7 @@ </term> <listitem> <para> - Pointer to array with x coordinates of the points. + Pointer to an array with X coordinates of points. </para> </listitem> </varlistentry> @@ -8693,7 +8829,7 @@ </term> <listitem> <para> - Pointer to array with y coordinates of the points. + Pointer to an array with Y coordinates of points. </para> </listitem> </varlistentry> @@ -8704,7 +8840,7 @@ </term> <listitem> <para> - Pointer to array with z coordinates of the points. + Pointer to an array with Z coordinates of points. </para> </listitem> </varlistentry> @@ -8715,7 +8851,9 @@ </term> <listitem> <para> - Code number for the symbol to be plotted. + Hershey symbol code (in "ascii-indexed" form with -1 <= code <= + 127) corresponding to a glyph to be plotted at each of the + <literal><parameter>n</parameter></literal> points. </para> </listitem> </varlistentry> @@ -13745,6 +13883,99 @@ </sect1> + <sect1 id="plstring" renderas="sect3"> + <title> + <function>plstring</function>: Plot a glyph at the specified points + </title> + + <para> + <funcsynopsis> + <funcprototype> + <funcdef> + <function>plstring</function> + </funcdef> + <paramdef><parameter>n</parameter></paramdef> + <paramdef><parameter>x</parameter></paramdef> + <paramdef><parameter>y</parameter></paramdef> + <paramdef><parameter>string</parameter></paramdef> + </funcprototype> + </funcsynopsis> + </para> + + <para> + Plot glyphs (normally just one of them) at a set of + <literal><parameter>n</parameter></literal> points at positions + <literal>(<parameter>x</parameter>[i], + <parameter>y</parameter>[i])</literal> using the glyph defined by + <literal><parameter>string</parameter></literal>. Supersedes &plpoin; + and &plsym; because many(!) more glyphs are accessible with + &plstring;. The glyph is specified with a PLplot user string. As + with &plmtex; and &plptex;, the user string can contain FCI escapes to + determine the font, UTF-8 code to determine the glyph or else PLplot + escapes for Hershey or unicode text to determine the glyph. + </para> + + <variablelist> + <varlistentry> + <term> + <parameter>n</parameter> + (<literal>PLINT</literal>, input) + </term> + <listitem> + <para> + Number of points in the + <literal><parameter>x</parameter></literal> and + <literal><parameter>y</parameter></literal> arrays. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>x</parameter> + (<literal>PLFLT *</literal>, input) + </term> + <listitem> + <para> + Pointer to an array with X coordinates of points. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>y</parameter> + (<literal>PLFLT *</literal>, input) + </term> + <listitem> + <para> + Pointer to an array with Y coordinates of points. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <parameter>string</parameter> + (<literal>const char *</literal>, input) + </term> + <listitem> + <para> + PLplot user string corresponding to the glyph to be + plotted at each of the <literal><parameter>n</parameter></literal> + points. + </para> + </listitem> + </varlistentry> + </variablelist> + + <para> + Redacted form: <function>plsym(x, y, code)</function> + </para> + + <para> + This function is used in example 7. + </para> + + </sect1> + <sect1 id="plstripa" renderas="sect3"> <title> <function>plstripa</function>: Add a point to a stripchart @@ -14941,7 +15172,7 @@ <sect1 id="plsym" renderas="sect3"> <title> - <function>plsym</function>: Plots a symbol at the specified points + <function>plsym</function>: Plot a glyph at the specified points </title> <para> @@ -14959,11 +15190,13 @@ </para> <para> - Marks out a set of <literal><parameter>n</parameter></literal> points - at positions <literal>(<parameter>x</parameter>[i], - <parameter>y</parameter>[i])</literal>, using the symbol defined by + Plot a glyph at a set of + <literal><parameter>n</parameter></literal> points at positions + <literal>(<parameter>x</parameter>[i], + <parameter>y</parameter>[i])</literal> using the glyph defined by <literal><parameter>code</parameter></literal>. The code is - interpreted as an index in the Hershey font tables. + interpreted as an index in the Hershey font tables. This function is + superseded by &plstring; which gives access to many(!) more glyphs. </para> <variablelist> @@ -14974,7 +15207,9 @@ </term> <listitem> <para> - Number of points to be marked. + Number of points in the + <literal><parameter>x</parameter></literal> and + <literal><parameter>y</parameter></literal> arrays. </para> </listitem> </varlistentry> @@ -14985,8 +15220,7 @@ </term> <listitem> <para> - Pointer to array with set of x coordinate values for the - points. + Pointer to an array with X coordinates of points. </para> </listitem> </varlistentry> @@ -14997,8 +15231,7 @@ </term> <listitem> <para> - Pointer to array with set of y coordinate values for the - points. + Pointer to an array with Y coordinates of points. </para> </listitem> </varlistentry> @@ -15009,7 +15242,8 @@ </term> <listitem> <para> - Code number for the symbol to be plotted. + Hershey symbol code corresponding to a glyph to be plotted + at each of the <literal><parameter>n</parameter></literal> points. </para> </listitem> </varlistentry> Modified: trunk/doc/docbook/src/plplotdoc.xml.in =================================================================== --- trunk/doc/docbook/src/plplotdoc.xml.in 2011-01-27 06:54:28 UTC (rev 11510) +++ trunk/doc/docbook/src/plplotdoc.xml.in 2011-01-27 09:59:42 UTC (rev 11511) @@ -224,6 +224,7 @@ <!ENTITY plssym '<link linkend="plssym"><function>plssym</function></link>'> <!ENTITY plstar '<link linkend="plstar"><function>plstar</function></link>'> <!ENTITY plstripa '<link linkend="plstripa"><function>plstripa</function></link>'> +<!ENTITY plstring '<link linkend="plstring"><function>plstring</function></link>'> <!ENTITY plstripc '<link linkend="plstripc"><function>plstripc</function></link>'> <!ENTITY plstripd '<link linkend="plstripd"><function>plstripd</function></link>'> <!ENTITY plstart '<link linkend="plstart"><function>plstart</function></link>'> Modified: trunk/examples/f95/x08f.f90 =================================================================== --- trunk/examples/f95/x08f.f90 2011-01-27 06:54:28 UTC (rev 11510) +++ trunk/examples/f95/x08f.f90 2011-01-27 09:59:42 UTC (rev 11511) @@ -37,20 +37,6 @@ integer nlevel parameter (nlevel = 10) real(kind=plflt) zmin, zmax, step, clevel(nlevel) -! Plotting options for 3d plots, see plplot.h for the C definitions -! of these options. - integer DRAW_LINEX, DRAW_LINEY, DRAW_LINEXY, MAG_COLOR, & - BASE_CONT, TOP_CONT, SURF_CONT, DRAW_SIDES, FACETED, MESH - parameter(DRAW_LINEX = 1) - parameter(DRAW_LINEY = 2) - parameter(DRAW_LINEXY = 3) - parameter(MAG_COLOR = 4) - parameter(BASE_CONT = 8) - parameter(TOP_CONT = 16) - parameter(SURF_CONT = 32) - parameter(DRAW_SIDES = 64) - parameter(FACETED = 128) - parameter(MESH = 256) ! Process command-line arguments call plparseopts(PL_PARSE_FULL) Modified: trunk/examples/f95/x09f.f90 =================================================================== --- trunk/examples/f95/x09f.f90 2011-01-27 06:54:28 UTC (rev 11510) +++ trunk/examples/f95/x09f.f90 2011-01-27 09:59:42 UTC (rev 11511) @@ -179,14 +179,14 @@ ! shielded potential contour plot example subroutine potential() - use plplot + use plplot, TWOPI => PL_TWOPI implicit none integer NCX, NCY, NPLT, i, j, nx, ny, kx, lx, ky, ly, & nlevel, ilevgt, ilevlt, nlevlt, nlevgt, & ncollin, ncolbox, ncollab, & nxsub, nysub, xdim, ydim - real(kind=plflt) TWOPI, r, theta, rmax, x0, & + real(kind=plflt) r, theta, rmax, x0, & y0, xmin, xmax, eps, q1, d1, & ymin, ymax, & q1i, d1i, q2, d2, q2i, d2i, div1, div1i, div2, div2i, & @@ -196,7 +196,6 @@ ! NCX and NCY are associated with the part of the ! 2D arrays that are defined. parameter (xdim=99, NCX=40, ydim=100, NCY=64, NPLT=100) - parameter (TWOPI=6.2831853071795864768_plflt) real(kind=plflt) z(xdim, ydim), ztmp(xdim, ydim+1) real(kind=plflt) xg(xdim, ydim+1), yg(xdim, ydim+1), xtm(NPLT), ytm(NPLT) Modified: trunk/examples/f95/x11f.f90 =================================================================== --- trunk/examples/f95/x11f.f90 2011-01-27 06:54:28 UTC (rev 11510) +++ trunk/examples/f95/x11f.f90 2011-01-27 09:59:42 UTC (rev 11511) @@ -38,20 +38,6 @@ integer nlevel parameter (nlevel = 10) real(kind=plflt) zmin, zmax, step, clevel(nlevel) -! Plotting options for 3d plots, see plplot.h for the C definitions -! of these options. - integer DRAW_LINEX, DRAW_LINEY, DRAW_LINEXY, MAG_COLOR, & - BASE_CONT, TOP_CONT, SURF_CONT, DRAW_SIDES, FACETED, MESH - parameter(DRAW_LINEX = 1) - parameter(DRAW_LINEY = 2) - parameter(DRAW_LINEXY = 3) - parameter(MAG_COLOR = 4) - parameter(BASE_CONT = 8) - parameter(TOP_CONT = 16) - parameter(SURF_CONT = 32) - parameter(DRAW_SIDES = 64) - parameter(FACETED = 128) - parameter(MESH = 256) ! Process command-line arguments call plparseopts(PL_PARSE_FULL) Modified: trunk/examples/f95/x16af.f90 =================================================================== --- trunk/examples/f95/x16af.f90 2011-01-27 06:54:28 UTC (rev 11510) +++ trunk/examples/f95/x16af.f90 2011-01-27 09:59:42 UTC (rev 11511) @@ -122,15 +122,13 @@ subroutine polar() - use plplot + use plplot, TWOPI => PL_TWOPI implicit none integer xdim, ydim, NX, NY, NCONTR, NBDRY - real(kind=plflt) TWOPI ! xdim and ydim are the static dimensions of the 2D arrays while ! NX and NY are the defined area. parameter (xdim = 99, NX = 40, ydim = 100, NY = 64) parameter (NCONTR = 14, NBDRY=200) - parameter (TWOPI=6.2831853071795864768_plflt) real(kind=plflt) z(xdim, ydim), ztmp(xdim, ydim+1) real(kind=plflt) xg(xdim, ydim+1), yg(xdim, ydim+1), & Modified: trunk/examples/f95/x18f.f90 =================================================================== --- trunk/examples/f95/x18f.f90 2011-01-27 06:54:28 UTC (rev 11510) +++ trunk/examples/f95/x18f.f90 2011-01-27 09:59:42 UTC (rev 11511) @@ -102,15 +102,13 @@ end subroutine test_poly(k, alt, az) - use plplot, PI => PL_PI + use plplot, PI => PL_PI, TWOPI => PL_TWOPI implicit none integer k real(kind=plflt) alt, az real(kind=plflt) x(5), y(5), z(5) integer i, j - real(kind=plflt) two_pi - parameter ( two_pi = 2.0_plflt*pi ) logical draw(4,4) DATA draw / & .true., .true., .true., .true., & @@ -119,8 +117,8 @@ .true., .true., .false., .false. / real(kind=plflt) theta, phi integer ia - THETA(ia) = (two_pi * (ia) /20._plflt) - PHI(ia) = (pi * (ia) / 20.1_plflt) + THETA(ia) = (TWOPI * (ia) /20._plflt) + PHI(ia) = (PI * (ia) / 20.1_plflt) call pladv(0) call plvpor(0.0_plflt, 1.0_plflt, 0.0_plflt, 0.9_plflt) Modified: trunk/examples/f95/x21f.f90 =================================================================== --- trunk/examples/f95/x21f.f90 2011-01-27 06:54:28 UTC (rev 11510) +++ trunk/examples/f95/x21f.f90 2011-01-27 09:59:42 UTC (rev 11511) @@ -24,23 +24,6 @@ implicit none -! integer PL_PARSE_FULL -! parameter(PL_PARSE_FULL = 1) - - integer GRID_CSA, GRID_DTLI, GRID_NNI, GRID_NNIDW, GRID_NNLI, & - GRID_NNAIDW - parameter (GRID_CSA = 1) - parameter (GRID_DTLI = 2) - parameter (GRID_NNI = 3) - parameter (GRID_NNIDW = 4) - parameter (GRID_NNLI = 5) - parameter (GRID_NNAIDW = 6) - - integer DRAW_LINEXY, MAG_COLOR, BASE_CONT - parameter(DRAW_LINEXY = 3) - parameter(MAG_COLOR = 4) - parameter(BASE_CONT = 8) - external myisnan logical myisnan Modified: trunk/examples/f95/x28f.f90 =================================================================== --- trunk/examples/f95/x28f.f90 2011-01-27 06:54:28 UTC (rev 11510) +++ trunk/examples/f95/x28f.f90 2011-01-27 09:59:42 UTC (rev 11511) @@ -61,22 +61,6 @@ character(len=80) :: pstring = & "The future of our civilization depends on software freedom." - ! Plotting options for 3d plots, see plplot.h for the C definitions - ! of these options. - integer DRAW_LINEX, DRAW_LINEY, DRAW_LINEXY, MAG_COLOR, & - BASE_CONT, TOP_CONT, SURF_CONT, DRAW_SIDES, FACETED, MESH - parameter(DRAW_LINEX = 1) - parameter(DRAW_LINEY = 2) - parameter(DRAW_LINEXY = 3) - parameter(MAG_COLOR = 4) - parameter(BASE_CONT = 8) - parameter(TOP_CONT = 16) - parameter(SURF_CONT = 32) - parameter(DRAW_SIDES = 64) - parameter(FACETED = 128) - parameter(MESH = 256) - - ! Allocate and define the minimal x, y, and z to insure 3D box allocate( x(XPTS) ) allocate( y(YPTS) ) Modified: trunk/scripts/MinGW_MSYS_comprehensive_test.sh =================================================================== --- trunk/scripts/MinGW_MSYS_comprehensive_test.sh 2011-01-27 06:54:28 UTC (rev 11510) +++ trunk/scripts/MinGW_MSYS_comprehensive_test.sh 2011-01-27 09:59:42 UTC (rev 11511) @@ -66,6 +66,37 @@ CMAKE_INCLUDE_PATH=$TCL_PREFIX/include:$CMAKE_INCLUDE_PATH CMAKE_LIBRARY_PATH=$TCL_PREFIX/lib:$CMAKE_LIBRARY_PATH +# Give access to the Windows version of Lua which was built under MinGW/MSYS +# using the ordinary Makefile Lua build system. + +PATH=$LUA_PREFIX/bin:$PATH +# Because of CMake misfeature that superpath does not have +# precedence, must set values explicitly rather than using +# CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH. +#CMAKE_INCLUDE_PATH=$LUA_PREFIX/include:$CMAKE_INCLUDE_PATH +#CMAKE_LIBRARY_PATH=$LUA_PREFIX/lib:$CMAKE_LIBRARY_PATH +# +# Where lua.h occurs. +cmake_extra_options="-DLUA_INCLUDE_DIR:PATH=$LUA_PREFIX/include" +# Full path to liblua.a +cmake_extra_options="-DLUA_LIBRARY:FILEPATH=$LUA_PREFIX/lib/liblua.a $cmake_extra_options" + +# Give access to the Windows version of Octave. N.B. the Windows Octave +# installer puts lots of dependent dll's in the PATH so might get into dll hell +# here if actually using extensive Octave facilities to test PLplot, but +# we are not. So to avoid interference with PLplot dll dependencies, put +# octave lowest on the PATH. + +#Location of octave.exe and liboctave.dll +PATH=$PATH:$OCTAVE_PREFIX/bin +#Location of octave.h (with PATH_SUFFIX of octave-3.2.4/octave) and hdf5.h +# (the external header apparently required by the octave headers). +CMAKE_INCLUDE_PATH=$OCTAVE_PREFIX/include:$CMAKE_INCLUDE_PATH +#Location of liboctave.dll.a (with PATH_SUFFIX of octave-3.2.4). +CMAKE_LIBRARY_PATH=$OCTAVE_PREFIX/lib:$CMAKE_LIBRARY_PATH +# swig-based build of octave bindings is required on Windows. +cmake_extra_options="-DENABLE_swig_octave=ON $cmake_extra_options" + # Set MinGW compiler flags for the PLplot build. export CFLAGS='-O3' export CXXFLAGS=$CFLAGS @@ -85,14 +116,16 @@ # this script if you want to set up all environment variables as # they are for a normal run of comprehensive_test.sh without # actually running that script. -# --cmake_added_options "-DENABLE_f95=OFF -DDEFAULT_NO_BINDINGS=ON -DENABLE_tcl=ON -DDEFAULT_NO_DEVICES=ON -DPLD_ps=ON" --do_shared yes --do_nondynamic no --do_static no \ +# --cmake_added_options "-DENABLE_f95=OFF -DDEFAULT_NO_BINDINGS=ON -DENABLE_tcl=ON -DDEFAULT_NO_DEVICES=ON -DPLD_ps=ON" \ +# --cmake_added_options "-DENABLE_f95=OFF"\ if [ -z "$DEBUG_COMPREHENSIVE_TEST_RESULT" ] ; then bash $PLPLOT_SOURCE_PREFIX/scripts/comprehensive_test.sh \ --prefix $TEST_RESULTS_PREFIX \ --generator_string "MSYS Makefiles" --build_command "make -j4" \ - --cmake_added_options "-DENABLE_f95=OFF" --do_shared yes --do_nondynamic no --do_static no \ - --do_ctest no --do_test_noninteractive yes --do_test_interactive no --do_test_build_tree yes --do_test_install_tree yes --do_test_traditional_install_tree yes + --cmake_added_options "-DENABLE_f95=OFF -DDEFAULT_NO_BINDINGS=ON -DENABLE_octave=ON -DDEFAULT_NO_DEVICES=ON -DPLD_ps=ON $cmake_extra_options" \ + --do_shared yes --do_nondynamic no --do_static no \ + --do_ctest no --do_test_noninteractive yes --do_test_interactive no --do_test_build_tree yes --do_test_install_tree no --do_test_traditional_install_tree no # This file is sourced so restore original directory location and PATH. cd $ORIGINAL_DIR This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-01-28 20:09:05
|
Revision: 11518 http://plplot.svn.sourceforge.net/plplot/?rev=11518&view=rev Author: airwin Date: 2011-01-28 20:08:59 +0000 (Fri, 28 Jan 2011) Log Message: ----------- Deal with single-precision library issues for plplot_parameters.h by turning that into a file generated in the build tree from plplot_parameters.fm4 (copied from the previous plplot_parameters.h) in the source tree. Modified Paths: -------------- trunk/bindings/f77/CMakeLists.txt trunk/examples/f77/CMakeLists.txt Added Paths: ----------- trunk/bindings/f77/plplot_parameters.fm4 Removed Paths: ------------- trunk/bindings/f77/plplot_parameters.h Modified: trunk/bindings/f77/CMakeLists.txt =================================================================== --- trunk/bindings/f77/CMakeLists.txt 2011-01-28 17:30:34 UTC (rev 11517) +++ trunk/bindings/f77/CMakeLists.txt 2011-01-28 20:08:59 UTC (rev 11518) @@ -21,8 +21,13 @@ if(ENABLE_f77) ## Generate source files depending on type of PLFLT - ## Note: Sed will possibly fail on windows. Would this be better + ## Note: sed will possibly fail on windows. Would this be better ## done using the cmake configure_file option eventually? + ## Answer: no. The configuration option requires @ placeholders + ## throughout the f77 source files which make them extremely hard + ## to understand/maintain. Instead, we ask those Windows users who + ## want the single-precision library to install sed (from MSYS or + ## wherever). if(PL_DOUBLE) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sfstubs.f @@ -30,6 +35,12 @@ -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/sfstubs.fm4 ${CMAKE_CURRENT_BINARY_DIR}/sfstubs.f DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/sfstubs.fm4 ) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/plplot_parameters.h + COMMAND ${CMAKE_COMMAND} + -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/plplot_parameters.fm4 ${CMAKE_CURRENT_BINARY_DIR}/plplot_parameters.h + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/plplot_parameters.fm4 + ) else(PL_DOUBLE) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sfstubs.f @@ -39,7 +50,44 @@ ${CMAKE_CURRENT_SOURCE_DIR}/double2single.sed ${CMAKE_CURRENT_SOURCE_DIR}/sfstubs.fm4 ) + + # For this case, use more extensive examples/f77 sed script since + # have double-precision floating-point constants to convert. + add_custom_command( + OUTPUT + ${CMAKE_CURRENT_BINARY_DIR}/plplot_parameters.h + COMMAND sed + -f ${CMAKE_SOURCE_DIR}/examples/f77/double2single.sed ${CMAKE_CURRENT_SOURCE_DIR}/plplot_parameters.fm4 > ${CMAKE_CURRENT_BINARY_DIR}/plplot_parameters.h + DEPENDS + ${CMAKE_SOURCE_DIR}/examples/f77/double2single.sed + ${CMAKE_CURRENT_SOURCE_DIR}/plplot_parameters.fm4 + ) endif(PL_DOUBLE) + + add_custom_target(build_plplot_parameters_h ALL + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/plplot_parameters.h + ) + +# I have found that there is no way to get the proper file dependency +# between the generated +# ${CMAKE_CURRENT_BINARY_DIR}/plplot_parameters.h and examples/f77/x??f +# builds. For example, if you change plplot_parameters.fm4, +# plplot_parameters.h gets rebuilt, BUT x??f does not! This possible +# CMake bug has been brought up on the cmake mailing list just now +# (2011-01-28) so a fix may be in the future. GENERATED makes no +# diffence to this issue so comment that out below. +# set_source_files_properties( +# ${CMAKE_CURRENT_BINARY_DIR}/plplot_parameters.h +# PROPERTIES GENERATED ON +# ) + + install( + FILES + ${CMAKE_CURRENT_BINARY_DIR}/plplot_parameters.h + DESTINATION ${F77_INCLUDE_DIR} + ) + set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/sfstubs.f PROPERTIES GENERATED ON) @@ -78,20 +126,20 @@ ## Build C part of F77 bindings # Add (Unix) custom target to check that f77 version of - # plplot_parameters.h is up to date. + # plplot_parameters.fm4 is up to date. add_custom_target( check_f77_parameters COMMAND ${CMAKE_COMMAND} -E remove -f - ${CMAKE_CURRENT_BINARY_DIR}/plplot_parameters.h_compare + ${CMAKE_CURRENT_BINARY_DIR}/plplot_parameters.fm4_compare COMMAND sed -f ${CMAKE_CURRENT_SOURCE_DIR}/global_defines.sed < ${CMAKE_SOURCE_DIR}/bindings/swig-support/plplotcapi.i > - ${CMAKE_CURRENT_BINARY_DIR}/plplot_parameters.h_compare + ${CMAKE_CURRENT_BINARY_DIR}/plplot_parameters.fm4_compare COMMAND - ${CMAKE_COMMAND} -E echo Check that f77 version of plplot_parameters.h is up to date. + ${CMAKE_COMMAND} -E echo Check that f77 version of plplot_parameters.fm4 is up to date. COMMAND - cmp ${CMAKE_CURRENT_SOURCE_DIR}/plplot_parameters.h - ${CMAKE_CURRENT_BINARY_DIR}/plplot_parameters.h_compare + cmp ${CMAKE_CURRENT_SOURCE_DIR}/plplot_parameters.fm4 + ${CMAKE_CURRENT_BINARY_DIR}/plplot_parameters.fm4_compare ) set(plplotf77c${LIB_TAG}_LIB_SRCS @@ -256,10 +304,4 @@ install(FILES ${PC_CONFIGURED_FILE} DESTINATION ${PKG_CONFIG_DIR}) endif(PKG_CONFIG_EXECUTABLE) - install( - FILES - ${CMAKE_CURRENT_SOURCE_DIR}/plplot_parameters.h - DESTINATION ${F77_INCLUDE_DIR} - ) - endif(ENABLE_f77) Copied: trunk/bindings/f77/plplot_parameters.fm4 (from rev 11515, trunk/bindings/f77/plplot_parameters.h) =================================================================== --- trunk/bindings/f77/plplot_parameters.fm4 (rev 0) +++ trunk/bindings/f77/plplot_parameters.fm4 2011-01-28 20:08:59 UTC (rev 11518) @@ -0,0 +1,254 @@ + integer*4 PLESC_SET_RGB ! obsolete + parameter (PLESC_SET_RGB = 1) + integer*4 PLESC_ALLOC_NCOL ! obsolete + parameter (PLESC_ALLOC_NCOL = 2) + integer*4 PLESC_SET_LPB ! obsolete + parameter (PLESC_SET_LPB = 3) + integer*4 PLESC_EXPOSE ! handle window expose + parameter (PLESC_EXPOSE = 4) + integer*4 PLESC_RESIZE ! handle window resize + parameter (PLESC_RESIZE = 5) + integer*4 PLESC_REDRAW ! handle window redraw + parameter (PLESC_REDRAW = 6) + integer*4 PLESC_TEXT ! switch to text screen + parameter (PLESC_TEXT = 7) + integer*4 PLESC_GRAPH ! switch to graphics screen + parameter (PLESC_GRAPH = 8) + integer*4 PLESC_FILL ! fill polygon + parameter (PLESC_FILL = 9) + integer*4 PLESC_DI ! handle DI command + parameter (PLESC_DI = 10) + integer*4 PLESC_FLUSH ! flush output + parameter (PLESC_FLUSH = 11) + integer*4 PLESC_EH ! handle Window events + parameter (PLESC_EH = 12) + integer*4 PLESC_GETC ! get cursor position + parameter (PLESC_GETC = 13) + integer*4 PLESC_SWIN ! set window parameters + parameter (PLESC_SWIN = 14) + integer*4 PLESC_PLFLTBUFFERING ! configure PLFLT buffering + parameter (PLESC_PLFLTBUFFERING = 15) + integer*4 PLESC_XORMOD ! set xor mode + parameter (PLESC_XORMOD = 16) + integer*4 PLESC_SET_COMPRESSION ! AFR: set compression + parameter (PLESC_SET_COMPRESSION = 17) + integer*4 PLESC_CLEAR ! RL: clear graphics region + parameter (PLESC_CLEAR = 18) + integer*4 PLESC_DASH ! RL: draw dashed line + parameter (PLESC_DASH = 19) + integer*4 PLESC_HAS_TEXT ! driver draws text + parameter (PLESC_HAS_TEXT = 20) + integer*4 PLESC_IMAGE ! handle image + parameter (PLESC_IMAGE = 21) + integer*4 PLESC_IMAGEOPS ! plimage related operations + parameter (PLESC_IMAGEOPS = 22) + integer*4 DRAW_LINEX ! draw lines parallel to the X axis + parameter (DRAW_LINEX = z'01') + integer*4 DRAW_LINEY ! draw lines parallel to the Y axis + parameter (DRAW_LINEY = z'02') + integer*4 DRAW_LINEXY ! draw lines parallel to both the X and Y axes + parameter (DRAW_LINEXY = z'03') + integer*4 MAG_COLOR ! draw the mesh with a color dependent of the magnitude + parameter (MAG_COLOR = z'04') + integer*4 BASE_CONT ! draw contour plot at bottom xy plane + parameter (BASE_CONT = z'08') + integer*4 TOP_CONT ! draw contour plot at top xy plane + parameter (TOP_CONT = z'10') + integer*4 SURF_CONT ! draw contour plot at surface + parameter (SURF_CONT = z'20') + integer*4 DRAW_SIDES ! draw sides + parameter (DRAW_SIDES = z'40') + integer*4 FACETED ! draw outline for each square that makes up the surface + parameter (FACETED = z'80') + integer*4 MESH ! draw mesh + parameter (MESH = z'100') + integer*4 PL_BIN_DEFAULT + parameter (PL_BIN_DEFAULT = 0) + integer*4 PL_BIN_CENTRED + parameter (PL_BIN_CENTRED = 1) + integer*4 PL_BIN_NOEXPAND + parameter (PL_BIN_NOEXPAND = 2) + integer*4 PL_BIN_NOEMPTY + parameter (PL_BIN_NOEMPTY = 4) + integer*4 PL_HIST_DEFAULT + parameter (PL_HIST_DEFAULT = 0) + integer*4 PL_HIST_NOSCALING + parameter (PL_HIST_NOSCALING = 1) + integer*4 PL_HIST_IGNORE_OUTLIERS + parameter (PL_HIST_IGNORE_OUTLIERS = 2) + integer*4 PL_HIST_NOEXPAND + parameter (PL_HIST_NOEXPAND = 8) + integer*4 PL_HIST_NOEMPTY + parameter (PL_HIST_NOEMPTY = 16) + integer*4 PL_POSITION_LEFT + parameter (PL_POSITION_LEFT = 1) + integer*4 PL_POSITION_RIGHT + parameter (PL_POSITION_RIGHT = 2) + integer*4 PL_POSITION_UPPER + parameter (PL_POSITION_UPPER = 4) + integer*4 PL_POSITION_LOWER + parameter (PL_POSITION_LOWER = 8) + integer*4 PL_POSITION_INSIDE + parameter (PL_POSITION_INSIDE = 16) + integer*4 PL_POSITION_OUTSIDE + parameter (PL_POSITION_OUTSIDE = 32) + integer*4 PL_POSITION_VIEWPORT + parameter (PL_POSITION_VIEWPORT = 64) + integer*4 PL_POSITION_SUBPAGE + parameter (PL_POSITION_SUBPAGE = 128) + integer*4 PL_LEGEND_NONE + parameter (PL_LEGEND_NONE = 1) + integer*4 PL_LEGEND_COLOR_BOX + parameter (PL_LEGEND_COLOR_BOX = 2) + integer*4 PL_LEGEND_LINE + parameter (PL_LEGEND_LINE = 4) + integer*4 PL_LEGEND_SYMBOL + parameter (PL_LEGEND_SYMBOL = 8) + integer*4 PL_LEGEND_TEXT_LEFT + parameter (PL_LEGEND_TEXT_LEFT = 16) + integer*4 PL_LEGEND_BACKGROUND + parameter (PL_LEGEND_BACKGROUND = 32) + integer*4 PL_LEGEND_BOUNDING_BOX + parameter (PL_LEGEND_BOUNDING_BOX = 64) + integer*4 PL_LEGEND_ROW_MAJOR + parameter (PL_LEGEND_ROW_MAJOR = 128) + integer*4 PL_COLORBAR_LEFT + parameter (PL_COLORBAR_LEFT = 1) + integer*4 PL_COLORBAR_RIGHT + parameter (PL_COLORBAR_RIGHT = 2) + integer*4 PL_COLORBAR_UPPER + parameter (PL_COLORBAR_UPPER = 4) + integer*4 PL_COLORBAR_LOWER + parameter (PL_COLORBAR_LOWER = 8) + integer*4 PL_COLORBAR_LABEL_LEFT + parameter (PL_COLORBAR_LABEL_LEFT = 16) + integer*4 PL_COLORBAR_LABEL_RIGHT + parameter (PL_COLORBAR_LABEL_RIGHT = 32) + integer*4 PL_COLORBAR_LABEL_UPPER + parameter (PL_COLORBAR_LABEL_UPPER = 64) + integer*4 PL_COLORBAR_LABEL_LOWER + parameter (PL_COLORBAR_LABEL_LOWER = 128) + integer*4 PL_COLORBAR_IMAGE + parameter (PL_COLORBAR_IMAGE = 256) + integer*4 PL_COLORBAR_SHADE + parameter (PL_COLORBAR_SHADE = 512) + integer*4 PL_COLORBAR_GRADIENT + parameter (PL_COLORBAR_GRADIENT = 1024) + integer*4 PL_COLORBAR_CAP_LOW + parameter (PL_COLORBAR_CAP_LOW = 2048) + integer*4 PL_COLORBAR_CAP_HIGH + parameter (PL_COLORBAR_CAP_HIGH = 4096) + integer*4 PL_COLORBAR_SHADE_LABEL + parameter (PL_COLORBAR_SHADE_LABEL = 8192) + integer*4 PLSWIN_DEVICE ! device coordinates + parameter (PLSWIN_DEVICE = 1) + integer*4 PLSWIN_WORLD ! world coordinates + parameter (PLSWIN_WORLD = 2) + integer*4 PL_X_AXIS ! The x-axis + parameter (PL_X_AXIS = 1) + integer*4 PL_Y_AXIS ! The y-axis + parameter (PL_Y_AXIS = 2) + integer*4 PL_Z_AXIS ! The z-axis + parameter (PL_Z_AXIS = 3) + integer*4 PL_OPT_ENABLED ! Obsolete + parameter (PL_OPT_ENABLED = z'0001') + integer*4 PL_OPT_ARG ! Option has an argment + parameter (PL_OPT_ARG = z'0002') + integer*4 PL_OPT_NODELETE ! Don't delete after processing + parameter (PL_OPT_NODELETE = z'0004') + integer*4 PL_OPT_INVISIBLE ! Make invisible + parameter (PL_OPT_INVISIBLE = z'0008') + integer*4 PL_OPT_DISABLED ! Processing is disabled + parameter (PL_OPT_DISABLED = z'0010') + integer*4 PL_OPT_FUNC ! Call handler function + parameter (PL_OPT_FUNC = z'0100') + integer*4 PL_OPT_BOOL ! Set *var = 1 + parameter (PL_OPT_BOOL = z'0200') + integer*4 PL_OPT_INT ! Set *var = atoi(optarg) + parameter (PL_OPT_INT = z'0400') + integer*4 PL_OPT_FLOAT ! Set *var = atof(optarg) + parameter (PL_OPT_FLOAT = z'0800') + integer*4 PL_OPT_STRING ! Set var = optarg + parameter (PL_OPT_STRING = z'1000') + integer*4 PL_PARSE_PARTIAL ! For backward compatibility + parameter (PL_PARSE_PARTIAL = z'0000') + integer*4 PL_PARSE_FULL ! Process fully & exit if error + parameter (PL_PARSE_FULL = z'0001') + integer*4 PL_PARSE_QUIET ! Don't issue messages + parameter (PL_PARSE_QUIET = z'0002') + integer*4 PL_PARSE_NODELETE ! Don't delete options after + parameter (PL_PARSE_NODELETE = z'0004') + integer*4 PL_PARSE_SHOWALL ! Show invisible options + parameter (PL_PARSE_SHOWALL = z'0008') + integer*4 PL_PARSE_OVERRIDE ! Obsolete + parameter (PL_PARSE_OVERRIDE = z'0010') + integer*4 PL_PARSE_NOPROGRAM ! Program name NOT in *argv[0].. + parameter (PL_PARSE_NOPROGRAM = z'0020') + integer*4 PL_PARSE_NODASH ! Set if leading dash NOT required + parameter (PL_PARSE_NODASH = z'0040') + integer*4 PL_PARSE_SKIP ! Skip over unrecognized args + parameter (PL_PARSE_SKIP = z'0080') + integer*4 PL_FCI_MARK + parameter (PL_FCI_MARK = ishft(1,31)) + integer*4 PL_FCI_IMPOSSIBLE + parameter (PL_FCI_IMPOSSIBLE = z'00000000') + integer*4 PL_FCI_HEXDIGIT_MASK + parameter (PL_FCI_HEXDIGIT_MASK = z'f') + integer*4 PL_FCI_HEXPOWER_MASK + parameter (PL_FCI_HEXPOWER_MASK = z'7') + integer*4 PL_FCI_HEXPOWER_IMPOSSIBLE + parameter (PL_FCI_HEXPOWER_IMPOSSIBLE = z'f') + integer*4 PL_FCI_FAMILY + parameter (PL_FCI_FAMILY = z'0') + integer*4 PL_FCI_STYLE + parameter (PL_FCI_STYLE = z'1') + integer*4 PL_FCI_WEIGHT + parameter (PL_FCI_WEIGHT = z'2') + integer*4 PL_FCI_SANS + parameter (PL_FCI_SANS = z'0') + integer*4 PL_FCI_SERIF + parameter (PL_FCI_SERIF = z'1') + integer*4 PL_FCI_MONO + parameter (PL_FCI_MONO = z'2') + integer*4 PL_FCI_SCRIPT + parameter (PL_FCI_SCRIPT = z'3') + integer*4 PL_FCI_SYMBOL + parameter (PL_FCI_SYMBOL = z'4') + integer*4 PL_FCI_UPRIGHT + parameter (PL_FCI_UPRIGHT = z'0') + integer*4 PL_FCI_ITALIC + parameter (PL_FCI_ITALIC = z'1') + integer*4 PL_FCI_OBLIQUE + parameter (PL_FCI_OBLIQUE = z'2') + integer*4 PL_FCI_MEDIUM + parameter (PL_FCI_MEDIUM = z'0') + integer*4 PL_FCI_BOLD + parameter (PL_FCI_BOLD = z'1') + integer*4 PL_MAXKEY + parameter (PL_MAXKEY = 16) + integer*4 PL_MAXWINDOWS ! Max number of windows/page tracked + parameter (PL_MAXWINDOWS = 64) + real*8 PL_NOTSET + parameter (PL_NOTSET = -42.0d0) + real*8 PI + parameter (PI = 3.1415926535897932384d0) + real*8 TWOPI + parameter (TWOPI = 2.0d0*PI) + integer*4 PLESPLFLTBUFFERING_ENABLE + parameter (PLESPLFLTBUFFERING_ENABLE = 1) + integer*4 PLESPLFLTBUFFERING_DISABLE + parameter (PLESPLFLTBUFFERING_DISABLE = 2) + integer*4 PLESPLFLTBUFFERING_QUERY + parameter (PLESPLFLTBUFFERING_QUERY = 3) + integer*4 GRID_CSA ! Bivariate Cubic Spline approximation + parameter (GRID_CSA = 1) + integer*4 GRID_DTLI ! Delaunay Triangulation Linear Interpolation + parameter (GRID_DTLI = 2) + integer*4 GRID_NNI ! Natural Neighbors Interpolation + parameter (GRID_NNI = 3) + integer*4 GRID_NNIDW ! Nearest Neighbors Inverse Distance Weighted + parameter (GRID_NNIDW = 4) + integer*4 GRID_NNLI ! Nearest Neighbors Linear Interpolation + parameter (GRID_NNLI = 5) + integer*4 GRID_NNAIDW ! Nearest Neighbors Around Inverse Distance Weighted + parameter (GRID_NNAIDW = 6) Deleted: trunk/bindings/f77/plplot_parameters.h =================================================================== --- trunk/bindings/f77/plplot_parameters.h 2011-01-28 17:30:34 UTC (rev 11517) +++ trunk/bindings/f77/plplot_parameters.h 2011-01-28 20:08:59 UTC (rev 11518) @@ -1,254 +0,0 @@ - integer*4 PLESC_SET_RGB ! obsolete - parameter (PLESC_SET_RGB = 1) - integer*4 PLESC_ALLOC_NCOL ! obsolete - parameter (PLESC_ALLOC_NCOL = 2) - integer*4 PLESC_SET_LPB ! obsolete - parameter (PLESC_SET_LPB = 3) - integer*4 PLESC_EXPOSE ! handle window expose - parameter (PLESC_EXPOSE = 4) - integer*4 PLESC_RESIZE ! handle window resize - parameter (PLESC_RESIZE = 5) - integer*4 PLESC_REDRAW ! handle window redraw - parameter (PLESC_REDRAW = 6) - integer*4 PLESC_TEXT ! switch to text screen - parameter (PLESC_TEXT = 7) - integer*4 PLESC_GRAPH ! switch to graphics screen - parameter (PLESC_GRAPH = 8) - integer*4 PLESC_FILL ! fill polygon - parameter (PLESC_FILL = 9) - integer*4 PLESC_DI ! handle DI command - parameter (PLESC_DI = 10) - integer*4 PLESC_FLUSH ! flush output - parameter (PLESC_FLUSH = 11) - integer*4 PLESC_EH ! handle Window events - parameter (PLESC_EH = 12) - integer*4 PLESC_GETC ! get cursor position - parameter (PLESC_GETC = 13) - integer*4 PLESC_SWIN ! set window parameters - parameter (PLESC_SWIN = 14) - integer*4 PLESC_PLFLTBUFFERING ! configure PLFLT buffering - parameter (PLESC_PLFLTBUFFERING = 15) - integer*4 PLESC_XORMOD ! set xor mode - parameter (PLESC_XORMOD = 16) - integer*4 PLESC_SET_COMPRESSION ! AFR: set compression - parameter (PLESC_SET_COMPRESSION = 17) - integer*4 PLESC_CLEAR ! RL: clear graphics region - parameter (PLESC_CLEAR = 18) - integer*4 PLESC_DASH ! RL: draw dashed line - parameter (PLESC_DASH = 19) - integer*4 PLESC_HAS_TEXT ! driver draws text - parameter (PLESC_HAS_TEXT = 20) - integer*4 PLESC_IMAGE ! handle image - parameter (PLESC_IMAGE = 21) - integer*4 PLESC_IMAGEOPS ! plimage related operations - parameter (PLESC_IMAGEOPS = 22) - integer*4 DRAW_LINEX ! draw lines parallel to the X axis - parameter (DRAW_LINEX = z'01') - integer*4 DRAW_LINEY ! draw lines parallel to the Y axis - parameter (DRAW_LINEY = z'02') - integer*4 DRAW_LINEXY ! draw lines parallel to both the X and Y axes - parameter (DRAW_LINEXY = z'03') - integer*4 MAG_COLOR ! draw the mesh with a color dependent of the magnitude - parameter (MAG_COLOR = z'04') - integer*4 BASE_CONT ! draw contour plot at bottom xy plane - parameter (BASE_CONT = z'08') - integer*4 TOP_CONT ! draw contour plot at top xy plane - parameter (TOP_CONT = z'10') - integer*4 SURF_CONT ! draw contour plot at surface - parameter (SURF_CONT = z'20') - integer*4 DRAW_SIDES ! draw sides - parameter (DRAW_SIDES = z'40') - integer*4 FACETED ! draw outline for each square that makes up the surface - parameter (FACETED = z'80') - integer*4 MESH ! draw mesh - parameter (MESH = z'100') - integer*4 PL_BIN_DEFAULT - parameter (PL_BIN_DEFAULT = 0) - integer*4 PL_BIN_CENTRED - parameter (PL_BIN_CENTRED = 1) - integer*4 PL_BIN_NOEXPAND - parameter (PL_BIN_NOEXPAND = 2) - integer*4 PL_BIN_NOEMPTY - parameter (PL_BIN_NOEMPTY = 4) - integer*4 PL_HIST_DEFAULT - parameter (PL_HIST_DEFAULT = 0) - integer*4 PL_HIST_NOSCALING - parameter (PL_HIST_NOSCALING = 1) - integer*4 PL_HIST_IGNORE_OUTLIERS - parameter (PL_HIST_IGNORE_OUTLIERS = 2) - integer*4 PL_HIST_NOEXPAND - parameter (PL_HIST_NOEXPAND = 8) - integer*4 PL_HIST_NOEMPTY - parameter (PL_HIST_NOEMPTY = 16) - integer*4 PL_POSITION_LEFT - parameter (PL_POSITION_LEFT = 1) - integer*4 PL_POSITION_RIGHT - parameter (PL_POSITION_RIGHT = 2) - integer*4 PL_POSITION_UPPER - parameter (PL_POSITION_UPPER = 4) - integer*4 PL_POSITION_LOWER - parameter (PL_POSITION_LOWER = 8) - integer*4 PL_POSITION_INSIDE - parameter (PL_POSITION_INSIDE = 16) - integer*4 PL_POSITION_OUTSIDE - parameter (PL_POSITION_OUTSIDE = 32) - integer*4 PL_POSITION_VIEWPORT - parameter (PL_POSITION_VIEWPORT = 64) - integer*4 PL_POSITION_SUBPAGE - parameter (PL_POSITION_SUBPAGE = 128) - integer*4 PL_LEGEND_NONE - parameter (PL_LEGEND_NONE = 1) - integer*4 PL_LEGEND_COLOR_BOX - parameter (PL_LEGEND_COLOR_BOX = 2) - integer*4 PL_LEGEND_LINE - parameter (PL_LEGEND_LINE = 4) - integer*4 PL_LEGEND_SYMBOL - parameter (PL_LEGEND_SYMBOL = 8) - integer*4 PL_LEGEND_TEXT_LEFT - parameter (PL_LEGEND_TEXT_LEFT = 16) - integer*4 PL_LEGEND_BACKGROUND - parameter (PL_LEGEND_BACKGROUND = 32) - integer*4 PL_LEGEND_BOUNDING_BOX - parameter (PL_LEGEND_BOUNDING_BOX = 64) - integer*4 PL_LEGEND_ROW_MAJOR - parameter (PL_LEGEND_ROW_MAJOR = 128) - integer*4 PL_COLORBAR_LEFT - parameter (PL_COLORBAR_LEFT = 1) - integer*4 PL_COLORBAR_RIGHT - parameter (PL_COLORBAR_RIGHT = 2) - integer*4 PL_COLORBAR_UPPER - parameter (PL_COLORBAR_UPPER = 4) - integer*4 PL_COLORBAR_LOWER - parameter (PL_COLORBAR_LOWER = 8) - integer*4 PL_COLORBAR_LABEL_LEFT - parameter (PL_COLORBAR_LABEL_LEFT = 16) - integer*4 PL_COLORBAR_LABEL_RIGHT - parameter (PL_COLORBAR_LABEL_RIGHT = 32) - integer*4 PL_COLORBAR_LABEL_UPPER - parameter (PL_COLORBAR_LABEL_UPPER = 64) - integer*4 PL_COLORBAR_LABEL_LOWER - parameter (PL_COLORBAR_LABEL_LOWER = 128) - integer*4 PL_COLORBAR_IMAGE - parameter (PL_COLORBAR_IMAGE = 256) - integer*4 PL_COLORBAR_SHADE - parameter (PL_COLORBAR_SHADE = 512) - integer*4 PL_COLORBAR_GRADIENT - parameter (PL_COLORBAR_GRADIENT = 1024) - integer*4 PL_COLORBAR_CAP_LOW - parameter (PL_COLORBAR_CAP_LOW = 2048) - integer*4 PL_COLORBAR_CAP_HIGH - parameter (PL_COLORBAR_CAP_HIGH = 4096) - integer*4 PL_COLORBAR_SHADE_LABEL - parameter (PL_COLORBAR_SHADE_LABEL = 8192) - integer*4 PLSWIN_DEVICE ! device coordinates - parameter (PLSWIN_DEVICE = 1) - integer*4 PLSWIN_WORLD ! world coordinates - parameter (PLSWIN_WORLD = 2) - integer*4 PL_X_AXIS ! The x-axis - parameter (PL_X_AXIS = 1) - integer*4 PL_Y_AXIS ! The y-axis - parameter (PL_Y_AXIS = 2) - integer*4 PL_Z_AXIS ! The z-axis - parameter (PL_Z_AXIS = 3) - integer*4 PL_OPT_ENABLED ! Obsolete - parameter (PL_OPT_ENABLED = z'0001') - integer*4 PL_OPT_ARG ! Option has an argment - parameter (PL_OPT_ARG = z'0002') - integer*4 PL_OPT_NODELETE ! Don't delete after processing - parameter (PL_OPT_NODELETE = z'0004') - integer*4 PL_OPT_INVISIBLE ! Make invisible - parameter (PL_OPT_INVISIBLE = z'0008') - integer*4 PL_OPT_DISABLED ! Processing is disabled - parameter (PL_OPT_DISABLED = z'0010') - integer*4 PL_OPT_FUNC ! Call handler function - parameter (PL_OPT_FUNC = z'0100') - integer*4 PL_OPT_BOOL ! Set *var = 1 - parameter (PL_OPT_BOOL = z'0200') - integer*4 PL_OPT_INT ! Set *var = atoi(optarg) - parameter (PL_OPT_INT = z'0400') - integer*4 PL_OPT_FLOAT ! Set *var = atof(optarg) - parameter (PL_OPT_FLOAT = z'0800') - integer*4 PL_OPT_STRING ! Set var = optarg - parameter (PL_OPT_STRING = z'1000') - integer*4 PL_PARSE_PARTIAL ! For backward compatibility - parameter (PL_PARSE_PARTIAL = z'0000') - integer*4 PL_PARSE_FULL ! Process fully & exit if error - parameter (PL_PARSE_FULL = z'0001') - integer*4 PL_PARSE_QUIET ! Don't issue messages - parameter (PL_PARSE_QUIET = z'0002') - integer*4 PL_PARSE_NODELETE ! Don't delete options after - parameter (PL_PARSE_NODELETE = z'0004') - integer*4 PL_PARSE_SHOWALL ! Show invisible options - parameter (PL_PARSE_SHOWALL = z'0008') - integer*4 PL_PARSE_OVERRIDE ! Obsolete - parameter (PL_PARSE_OVERRIDE = z'0010') - integer*4 PL_PARSE_NOPROGRAM ! Program name NOT in *argv[0].. - parameter (PL_PARSE_NOPROGRAM = z'0020') - integer*4 PL_PARSE_NODASH ! Set if leading dash NOT required - parameter (PL_PARSE_NODASH = z'0040') - integer*4 PL_PARSE_SKIP ! Skip over unrecognized args - parameter (PL_PARSE_SKIP = z'0080') - integer*4 PL_FCI_MARK - parameter (PL_FCI_MARK = ishft(1,31)) - integer*4 PL_FCI_IMPOSSIBLE - parameter (PL_FCI_IMPOSSIBLE = z'00000000') - integer*4 PL_FCI_HEXDIGIT_MASK - parameter (PL_FCI_HEXDIGIT_MASK = z'f') - integer*4 PL_FCI_HEXPOWER_MASK - parameter (PL_FCI_HEXPOWER_MASK = z'7') - integer*4 PL_FCI_HEXPOWER_IMPOSSIBLE - parameter (PL_FCI_HEXPOWER_IMPOSSIBLE = z'f') - integer*4 PL_FCI_FAMILY - parameter (PL_FCI_FAMILY = z'0') - integer*4 PL_FCI_STYLE - parameter (PL_FCI_STYLE = z'1') - integer*4 PL_FCI_WEIGHT - parameter (PL_FCI_WEIGHT = z'2') - integer*4 PL_FCI_SANS - parameter (PL_FCI_SANS = z'0') - integer*4 PL_FCI_SERIF - parameter (PL_FCI_SERIF = z'1') - integer*4 PL_FCI_MONO - parameter (PL_FCI_MONO = z'2') - integer*4 PL_FCI_SCRIPT - parameter (PL_FCI_SCRIPT = z'3') - integer*4 PL_FCI_SYMBOL - parameter (PL_FCI_SYMBOL = z'4') - integer*4 PL_FCI_UPRIGHT - parameter (PL_FCI_UPRIGHT = z'0') - integer*4 PL_FCI_ITALIC - parameter (PL_FCI_ITALIC = z'1') - integer*4 PL_FCI_OBLIQUE - parameter (PL_FCI_OBLIQUE = z'2') - integer*4 PL_FCI_MEDIUM - parameter (PL_FCI_MEDIUM = z'0') - integer*4 PL_FCI_BOLD - parameter (PL_FCI_BOLD = z'1') - integer*4 PL_MAXKEY - parameter (PL_MAXKEY = 16) - integer*4 PL_MAXWINDOWS ! Max number of windows/page tracked - parameter (PL_MAXWINDOWS = 64) - real*8 PL_NOTSET - parameter (PL_NOTSET = -42.0d0) - real*8 PI - parameter (PI = 3.1415926535897932384d0) - real*8 TWOPI - parameter (TWOPI = 2.0d0*PI) - integer*4 PLESPLFLTBUFFERING_ENABLE - parameter (PLESPLFLTBUFFERING_ENABLE = 1) - integer*4 PLESPLFLTBUFFERING_DISABLE - parameter (PLESPLFLTBUFFERING_DISABLE = 2) - integer*4 PLESPLFLTBUFFERING_QUERY - parameter (PLESPLFLTBUFFERING_QUERY = 3) - integer*4 GRID_CSA ! Bivariate Cubic Spline approximation - parameter (GRID_CSA = 1) - integer*4 GRID_DTLI ! Delaunay Triangulation Linear Interpolation - parameter (GRID_DTLI = 2) - integer*4 GRID_NNI ! Natural Neighbors Interpolation - parameter (GRID_NNI = 3) - integer*4 GRID_NNIDW ! Nearest Neighbors Inverse Distance Weighted - parameter (GRID_NNIDW = 4) - integer*4 GRID_NNLI ! Nearest Neighbors Linear Interpolation - parameter (GRID_NNLI = 5) - integer*4 GRID_NNAIDW ! Nearest Neighbors Around Inverse Distance Weighted - parameter (GRID_NNAIDW = 6) Modified: trunk/examples/f77/CMakeLists.txt =================================================================== --- trunk/examples/f77/CMakeLists.txt 2011-01-28 17:30:34 UTC (rev 11517) +++ trunk/examples/f77/CMakeLists.txt 2011-01-28 20:08:59 UTC (rev 11518) @@ -128,7 +128,7 @@ if(CORE_BUILD) include_directories( ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/bindings/f77 + ${CMAKE_BINARY_DIR}/bindings/f77 ${CMAKE_BINARY_DIR}/include ) set(f77_directory ${CMAKE_CURRENT_BINARY_DIR}) @@ -149,6 +149,7 @@ else(STATIC_OPTS) target_link_libraries(x${STRING_INDEX}f plplotf77${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) endforeach(STRING_INDEX ${f77_STRING_INDICES}) endif(BUILD_TEST) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-01-28 20:20:21
|
Revision: 11519 http://plplot.svn.sourceforge.net/plplot/?rev=11519&view=rev Author: airwin Date: 2011-01-28 20:20:13 +0000 (Fri, 28 Jan 2011) Log Message: ----------- Style previous changes. Modified Paths: -------------- trunk/bindings/f77/scstubs.c trunk/bindings/java/PLStream.java trunk/examples/c/x33c.c trunk/examples/c++/x33.cc trunk/examples/java/x04.java trunk/examples/java/x18.java trunk/examples/java/x26.java trunk/examples/java/x27.java trunk/examples/java/x33.java trunk/include/plplot.h Modified: trunk/bindings/f77/scstubs.c =================================================================== --- trunk/bindings/f77/scstubs.c 2011-01-28 20:08:59 UTC (rev 11518) +++ trunk/bindings/f77/scstubs.c 2011-01-28 20:20:13 UTC (rev 11519) @@ -517,20 +517,20 @@ void PLLEGEND_CNV_TEXT( PLINT *id, PLINT *number, char *string, PLINT length ) { - int j; - int i; + int j; + int i; char **p_string; - char *data; + char *data; // Ensure the strings are null terminated - p_string = (char **) malloc( sizeof(char *) * (*number) ); - data = (char *) malloc( sizeof(char *) * (*number) * (length+1) ); + p_string = (char **) malloc( sizeof ( char * ) * ( *number ) ); + data = (char *) malloc( sizeof ( char * ) * ( *number ) * ( length + 1 ) ); - for ( j = 0; j < (*number); j ++ ) + for ( j = 0; j < ( *number ); j++ ) { - p_string[j] = data + j*(length+1); - memcpy( p_string[j], &string[j*length], length ); + p_string[j] = data + j * ( length + 1 ); + memcpy( p_string[j], &string[j * length], length ); i = length - 1; while ( ( i >= 0 ) && ( p_string[j][i] == ' ' ) ) i--; @@ -548,40 +548,40 @@ } void PLLEGEND( - PLFLT *p_legend_width, PLFLT *p_legend_height, - PLINT *position, PLINT *opt, PLFLT *x, PLFLT *y, PLFLT *plot_width, - PLINT *bg_color, PLINT *bb_color, PLINT *bb_style, - PLINT *nrow, PLINT *ncolumn, - PLINT *nlegend, const PLINT *opt_array, - PLFLT *text_offset, PLFLT *text_scale, PLFLT *text_spacing, - PLFLT *text_justification, - const PLINT *text_colors, - const PLINT *box_colors, const PLINT *box_patterns, - const PLFLT *box_scales, const PLINT *box_line_widths, - const PLINT *line_colors, const PLINT *line_styles, - const PLINT *line_widths, - const PLINT *symbol_colors, const PLFLT *symbol_scales, - const PLINT *symbol_numbers ) + PLFLT *p_legend_width, PLFLT *p_legend_height, + PLINT *position, PLINT *opt, PLFLT *x, PLFLT *y, PLFLT *plot_width, + PLINT *bg_color, PLINT *bb_color, PLINT *bb_style, + PLINT *nrow, PLINT *ncolumn, + PLINT *nlegend, const PLINT *opt_array, + PLFLT *text_offset, PLFLT *text_scale, PLFLT *text_spacing, + PLFLT *text_justification, + const PLINT *text_colors, + const PLINT *box_colors, const PLINT *box_patterns, + const PLFLT *box_scales, const PLINT *box_line_widths, + const PLINT *line_colors, const PLINT *line_styles, + const PLINT *line_widths, + const PLINT *symbol_colors, const PLFLT *symbol_scales, + const PLINT *symbol_numbers ) { - c_pllegend( p_legend_width, p_legend_height, - *position, *opt, *x, *y, *plot_width, - *bg_color, *bb_color, *bb_style, - *nrow, *ncolumn, - *nlegend, opt_array, - *text_offset, *text_scale, *text_spacing, - *text_justification, - text_colors, pllegend_text, - box_colors, box_patterns, - box_scales, box_line_widths, - line_colors, line_styles, - line_widths, - symbol_colors, symbol_scales, - symbol_numbers, pllegend_symbols ) ; + c_pllegend( p_legend_width, p_legend_height, + *position, *opt, *x, *y, *plot_width, + *bg_color, *bb_color, *bb_style, + *nrow, *ncolumn, + *nlegend, opt_array, + *text_offset, *text_scale, *text_spacing, + *text_justification, + text_colors, pllegend_text, + box_colors, box_patterns, + box_scales, box_line_widths, + line_colors, line_styles, + line_widths, + symbol_colors, symbol_scales, + symbol_numbers, pllegend_symbols ); - free( *pllegend_text ); - free( pllegend_text ); - free( *pllegend_symbols ); - free( pllegend_symbols ); + free( *pllegend_text ); + free( pllegend_text ); + free( *pllegend_symbols ); + free( pllegend_symbols ); } void Modified: trunk/bindings/java/PLStream.java =================================================================== --- trunk/bindings/java/PLStream.java 2011-01-28 20:08:59 UTC (rev 11518) +++ trunk/bindings/java/PLStream.java 2011-01-28 20:20:13 UTC (rev 11519) @@ -528,40 +528,40 @@ plplotjavac.pllab( xlabel, ylabel, tlabel ); } - public void legend( double[] p_legend_width, double[] p_legend_height, - int position, int opt, double x, double y, double plot_width, - int bg_color, int bb_color, int bb_style, - int nrow, int ncolumn, int[] opt_array, - double text_offset, double text_scale, - double text_spacing, double text_justification, - int[] text_colors, String[] text, - int[] box_colors, int[] box_patterns, - double[] box_scales, int[] box_line_widths, - int[] line_colors, int[] line_styles, - int[] line_widths, - int[] symbol_colors, double[]symbol_scales, - int[] symbol_numbers, String[] symbols ) + public void legend( double[] p_legend_width, double[] p_legend_height, + int position, int opt, double x, double y, double plot_width, + int bg_color, int bb_color, int bb_style, + int nrow, int ncolumn, int[] opt_array, + double text_offset, double text_scale, + double text_spacing, double text_justification, + int[] text_colors, String[] text, + int[] box_colors, int[] box_patterns, + double[] box_scales, int[] box_line_widths, + int[] line_colors, int[] line_styles, + int[] line_widths, + int[] symbol_colors, double[] symbol_scales, + int[] symbol_numbers, String[] symbols ) { if ( set_stream() == -1 ) return; - plplotjavac.pllegend( p_legend_width, p_legend_height, - position, opt, x, y, plot_width, bg_color, bb_color, - bb_style, nrow, ncolumn, opt_array, - text_offset, text_scale, text_spacing, - text_justification, text_colors, text, - box_colors, box_patterns, box_scales, - box_line_widths, line_colors, line_styles, - line_widths, symbol_colors, symbol_scales, - symbol_numbers, symbols ); + plplotjavac.pllegend( p_legend_width, p_legend_height, + position, opt, x, y, plot_width, bg_color, bb_color, + bb_style, nrow, ncolumn, opt_array, + text_offset, text_scale, text_spacing, + text_justification, text_colors, text, + box_colors, box_patterns, box_scales, + box_line_widths, line_colors, line_styles, + line_widths, symbol_colors, symbol_scales, + symbol_numbers, symbols ); } public void colorbar( int opt, double x, double y, double length, - double width, double ticks, double subticks, - String axis_opts, String label, - double[] colors, double[] values ) + double width, double ticks, double subticks, + String axis_opts, String label, + double[] colors, double[] values ) { if ( set_stream() == -1 ) return; plplotjavac.plcolorbar( opt, x, y, length, width, ticks, subticks, - axis_opts, label, colors, values ); + axis_opts, label, colors, values ); } public void lightsource( double x, double y, double z ) Modified: trunk/examples/c/x33c.c =================================================================== --- trunk/examples/c/x33c.c 2011-01-28 20:08:59 UTC (rev 11518) +++ trunk/examples/c/x33c.c 2011-01-28 20:20:13 UTC (rev 11519) @@ -275,7 +275,7 @@ for ( k = 0; k < 16; k++ ) { position = position_options[k]; - opt = opt_base; + opt = opt_base; sprintf( text[0], "%2.2d", k ); text_colors[0] = 1 + ( k % 8 ); line_colors[0] = 1 + ( k % 8 ); @@ -324,11 +324,11 @@ plscol0a( 15, 32, 32, 32, 0.70 ); position = PL_POSITION_UPPER | PL_POSITION_OUTSIDE; - opt = opt_base; - x = 0.; - y = 0.1; - nrow = 1; - ncolumn = nlegend; + opt = opt_base; + x = 0.; + y = 0.1; + nrow = 1; + ncolumn = nlegend; pllegend( &legend_width, &legend_height, position, opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 2.0, @@ -338,11 +338,11 @@ symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); position = PL_POSITION_LOWER | PL_POSITION_OUTSIDE; - opt = opt_base; - x = 0.; - y = 0.1; - nrow = 1; - ncolumn = nlegend; + opt = opt_base; + x = 0.; + y = 0.1; + nrow = 1; + ncolumn = nlegend; pllegend( &legend_width, &legend_height, position, opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 2.0, @@ -352,11 +352,11 @@ symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); position = PL_POSITION_LEFT | PL_POSITION_OUTSIDE; - opt = opt_base; - x = 0.1; - y = 0.; - nrow = nlegend; - ncolumn = 1; + opt = opt_base; + x = 0.1; + y = 0.; + nrow = nlegend; + ncolumn = 1; pllegend( &legend_width, &legend_height, position, opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 2.0, @@ -366,11 +366,11 @@ symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); position = PL_POSITION_RIGHT | PL_POSITION_OUTSIDE; - opt = opt_base; - x = 0.1; - y = 0.; - nrow = nlegend; - ncolumn = 1; + opt = opt_base; + x = 0.1; + y = 0.; + nrow = nlegend; + ncolumn = 1; pllegend( &legend_width, &legend_height, position, opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 2.0, @@ -380,11 +380,11 @@ symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); position = PL_POSITION_LEFT | PL_POSITION_UPPER | PL_POSITION_INSIDE; - opt = opt_base; - x = 0.; - y = 0.; - nrow = 6; - ncolumn = 2; + opt = opt_base; + x = 0.; + y = 0.; + nrow = 6; + ncolumn = 2; pllegend( &legend_width, &legend_height, position, opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 2.0, @@ -394,11 +394,11 @@ symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); position = PL_POSITION_RIGHT | PL_POSITION_UPPER | PL_POSITION_INSIDE; - opt = opt_base | PL_LEGEND_ROW_MAJOR; - x = 0.; - y = 0.; - nrow = 6; - ncolumn = 2; + opt = opt_base | PL_LEGEND_ROW_MAJOR; + x = 0.; + y = 0.; + nrow = 6; + ncolumn = 2; pllegend( &legend_width, &legend_height, position, opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 2.0, @@ -408,11 +408,11 @@ symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); position = PL_POSITION_LOWER | PL_POSITION_INSIDE; - opt = opt_base | PL_LEGEND_ROW_MAJOR; - x = 0.; - y = 0.; - nrow = 3; - ncolumn = 3; + opt = opt_base | PL_LEGEND_ROW_MAJOR; + x = 0.; + y = 0.; + nrow = 3; + ncolumn = 3; pllegend( &legend_width, &legend_height, position, opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 2.0, @@ -475,10 +475,10 @@ if ( i == nturn ) { - position = PL_POSITION_UPPER | PL_POSITION_RIGHT; - opt = opt_base; - x = 1. - x; - y += legend_height; + position = PL_POSITION_UPPER | PL_POSITION_RIGHT; + opt = opt_base; + x = 1. - x; + y += legend_height; } else { Modified: trunk/examples/c++/x33.cc =================================================================== --- trunk/examples/c++/x33.cc 2011-01-28 20:08:59 UTC (rev 11518) +++ trunk/examples/c++/x33.cc 2011-01-28 20:20:13 UTC (rev 11519) @@ -299,11 +299,11 @@ for ( k = 0; k < 16; k++ ) { - position = position_options[k]; - opt = opt_base; + position = position_options[k]; + opt = opt_base; sprintf( text[0], "%2.2d", k ); - text_colors[0] = 1 + ( k % 8 ); - line_colors[0] = 1 + ( k % 8 );position, opt, symbol_colors[0] = 1 + ( k % 8 ); + text_colors[0] = 1 + ( k % 8 ); + line_colors[0] = 1 + ( k % 8 );position, opt, symbol_colors[0] = 1 + ( k % 8 ); pls->legend( &legend_width, &legend_height, position, opt, 0.05, 0.05, 0.1, 15, 1, 1, 0, 0, @@ -348,11 +348,11 @@ pls->scol0a( 15, 32, 32, 32, 0.70 ); position = PL_POSITION_UPPER | PL_POSITION_OUTSIDE; - opt = opt_base; - x = 0.; - y = 0.1; - nrow = 1; - ncolumn = nlegend; + opt = opt_base; + x = 0.; + y = 0.1; + nrow = 1; + ncolumn = nlegend; pls->legend( &legend_width, &legend_height, position, opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 2.0, @@ -362,11 +362,11 @@ symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); position = PL_POSITION_LOWER | PL_POSITION_OUTSIDE; - opt = opt_base; - x = 0.; - y = 0.1; - nrow = 1; - ncolumn = nlegend; + opt = opt_base; + x = 0.; + y = 0.1; + nrow = 1; + ncolumn = nlegend; pls->legend( &legend_width, &legend_height, position, opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 2.0, @@ -376,11 +376,11 @@ symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); position = PL_POSITION_LEFT | PL_POSITION_OUTSIDE; - opt = opt_base; - x = 0.1; - y = 0.; - nrow = nlegend; - ncolumn = 1; + opt = opt_base; + x = 0.1; + y = 0.; + nrow = nlegend; + ncolumn = 1; pls->legend( &legend_width, &legend_height, position, opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 2.0, @@ -390,11 +390,11 @@ symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); position = PL_POSITION_RIGHT | PL_POSITION_OUTSIDE; - opt = opt_base; - x = 0.1; - y = 0.; - nrow = nlegend; - ncolumn = 1; + opt = opt_base; + x = 0.1; + y = 0.; + nrow = nlegend; + ncolumn = 1; pls->legend( &legend_width, &legend_height, position, opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 2.0, @@ -404,11 +404,11 @@ symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); position = PL_POSITION_LEFT | PL_POSITION_UPPER | PL_POSITION_INSIDE; - opt = opt_base; - x = 0.; - y = 0.; - nrow = 6; - ncolumn = 2; + opt = opt_base; + x = 0.; + y = 0.; + nrow = 6; + ncolumn = 2; pls->legend( &legend_width, &legend_height, position, opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 2.0, @@ -418,11 +418,11 @@ symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); position = PL_POSITION_RIGHT | PL_POSITION_UPPER | PL_POSITION_INSIDE; - opt = opt_base | PL_LEGEND_ROW_MAJOR; - x = 0.; - y = 0.; - nrow = 6; - ncolumn = 2; + opt = opt_base | PL_LEGEND_ROW_MAJOR; + x = 0.; + y = 0.; + nrow = 6; + ncolumn = 2; pls->legend( &legend_width, &legend_height, position, opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 2.0, @@ -432,11 +432,11 @@ symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); position = PL_POSITION_LOWER | PL_POSITION_INSIDE; - opt = opt_base | PL_LEGEND_ROW_MAJOR; - x = 0.; - y = 0.; - nrow = 3; - ncolumn = 3; + opt = opt_base | PL_LEGEND_ROW_MAJOR; + x = 0.; + y = 0.; + nrow = 3; + ncolumn = 3; pls->legend( &legend_width, &legend_height, position, opt, x, y, 0.05, 15, 1, 1, nrow, ncolumn, nlegend, opt_array, 1.0, 1.0, 2.0, @@ -500,9 +500,9 @@ if ( i == nturn ) { position = PL_POSITION_UPPER | PL_POSITION_RIGHT; - opt = opt_base; - x = 1. - x; - y += legend_height; + opt = opt_base; + x = 1. - x; + y += legend_height; } else { Modified: trunk/examples/java/x04.java =================================================================== --- trunk/examples/java/x04.java 2011-01-28 20:08:59 UTC (rev 11518) +++ trunk/examples/java/x04.java 2011-01-28 20:20:13 UTC (rev 11519) @@ -69,19 +69,19 @@ double[] ampl = new double[101]; double[] phase = new double[101]; double f0, freq; - int nlegend; - String[] text; - String[] symbols; - int[] opt_array; - int[] text_colors; - int[] line_colors; - int[] line_styles; - int[] line_widths; - int[] symbol_numbers; - int[] symbol_colors; - double[] symbol_scales; - double[] legend_width = new double[1]; - double[] legend_height = new double[1]; + int nlegend; + String[] text; + String[] symbols; + int[] opt_array; + int[] text_colors; + int[] line_colors; + int[] line_styles; + int[] line_widths; + int[] symbol_numbers; + int[] symbol_colors; + double[] symbol_scales; + double[] legend_width = new double[1]; + double[] legend_height = new double[1]; pls.adv( 0 ); @@ -127,7 +127,7 @@ pls.mtex( "t", 2.0, 0.5, 0.5, "Single Pole Low-Pass Filter" ); pls.col0( 2 ); pls.mtex( "l", 5.0, 0.5, 0.5, "Amplitude (dB)" ); - nlegend = 1; + nlegend = 1; // For the gridless case, put phase vs freq on same plot. @@ -141,61 +141,61 @@ pls.string( freql, phase, "*" ); pls.col0( 3 ); pls.mtex( "r", 5.0, 0.5, 0.5, "Phase shift (degrees)" ); - nlegend = 2; + nlegend = 2; } - text = new String[nlegend]; - symbols = new String[nlegend]; - opt_array = new int[nlegend]; - text_colors = new int[nlegend]; - line_colors = new int[nlegend]; - line_styles = new int[nlegend]; - line_widths = new int[nlegend]; - symbol_numbers = new int[nlegend]; - symbol_colors = new int[nlegend]; - symbol_scales = new double[nlegend]; + text = new String[nlegend]; + symbols = new String[nlegend]; + opt_array = new int[nlegend]; + text_colors = new int[nlegend]; + line_colors = new int[nlegend]; + line_styles = new int[nlegend]; + line_widths = new int[nlegend]; + symbol_numbers = new int[nlegend]; + symbol_colors = new int[nlegend]; + symbol_scales = new double[nlegend]; - // Draw a legend - // First legend entry. - opt_array[0] = PLStream.PL_LEGEND_LINE; - text_colors[0] = 2; - text[0] = "Amplitude"; - line_colors[0] = 2; - line_styles[0] = 1; - line_widths[0] = 1; - // note from the above opt_array the first symbol (and box) indices - // do not have to be specified EXCEPT for symbols. - // Although this is unused, it can't be undefined as the String - // array is copied as part of the java bindings. - symbols[0] = " "; - - // Second legend entry. - if (nlegend == 2) { - opt_array[1] = PLStream.PL_LEGEND_LINE | PLStream.PL_LEGEND_SYMBOL; - text_colors[1] = 3; - text[1] = "Phase shift"; - line_colors[1] = 3; - line_styles[1] = 1; - line_widths[1] = 1; - symbol_colors[1] = 3; - symbol_scales[1] = 1.; - symbol_numbers[1] = 4; - symbols[1] = "*"; - } + // Draw a legend + // First legend entry. + opt_array[0] = PLStream.PL_LEGEND_LINE; + text_colors[0] = 2; + text[0] = "Amplitude"; + line_colors[0] = 2; + line_styles[0] = 1; + line_widths[0] = 1; + // note from the above opt_array the first symbol (and box) indices + // do not have to be specified EXCEPT for symbols. + // Although this is unused, it can't be undefined as the String + // array is copied as part of the java bindings. + symbols[0] = " "; - // from the above opt_arrays we can completely ignore everything - // to do with boxes. + // Second legend entry. + if ( nlegend == 2 ) + { + opt_array[1] = PLStream.PL_LEGEND_LINE | PLStream.PL_LEGEND_SYMBOL; + text_colors[1] = 3; + text[1] = "Phase shift"; + line_colors[1] = 3; + line_styles[1] = 1; + line_widths[1] = 1; + symbol_colors[1] = 3; + symbol_scales[1] = 1.; + symbol_numbers[1] = 4; + symbols[1] = "*"; + } - pls.scol0a( 15, 32, 32, 32, 0.70 ); - pls.legend( legend_width, legend_height, - 0, PLStream.PL_LEGEND_BACKGROUND | PLStream.PL_LEGEND_BOUNDING_BOX, - 0.0, 0.0, 0.1, 15, - 1, 1, 0, 0, opt_array, - 1.0, 1.0, 2.0, - 1., text_colors, text, - null, null, null, null, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + // from the above opt_arrays we can completely ignore everything + // to do with boxes. + pls.scol0a( 15, 32, 32, 32, 0.70 ); + pls.legend( legend_width, legend_height, + 0, PLStream.PL_LEGEND_BACKGROUND | PLStream.PL_LEGEND_BOUNDING_BOX, + 0.0, 0.0, 0.1, 15, + 1, 1, 0, 0, opt_array, + 1.0, 1.0, 2.0, + 1., text_colors, text, + null, null, null, null, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); } } Modified: trunk/examples/java/x18.java =================================================================== --- trunk/examples/java/x18.java 2011-01-28 20:08:59 UTC (rev 11518) +++ trunk/examples/java/x18.java 2011-01-28 20:20:13 UTC (rev 11519) @@ -167,8 +167,8 @@ if ( opt[k] > 0 ) pls.line3( x, y, z ); else - // U+22C5 DOT OPERATOR. - pls.string3( x, y, z, "⋅" ); + // U+22C5 DOT OPERATOR. + pls.string3( x, y, z, "⋅" ); pls.col0( 3 ); String title = "#frPLplot Example 18 - Alt=" + Modified: trunk/examples/java/x26.java =================================================================== --- trunk/examples/java/x26.java 2011-01-28 20:08:59 UTC (rev 11518) +++ trunk/examples/java/x26.java 2011-01-28 20:20:13 UTC (rev 11519) @@ -87,16 +87,16 @@ // Short rearranged versions of y_label and alty_label. static String[][] legend_text = { - { "Amplitude", "Phase shift"}, - { "Амплитуда", "Фазовый сдвиг" } + { "Amplitude", "Phase shift" }, + { "Амплитуда", "Фазовый сдвиг" } }; - static String[] title_label = { + static String[] title_label = { "Single Pole Low-Pass Filter", "Однополюсный Низко-Частотный Фильтр" }; - static String[] line_label = { + static String[] line_label = { "-20 dB/decade", "-20 dB/десяток" }; @@ -132,8 +132,8 @@ for ( i = 0; i < nlang; i++ ) { - plot1( 0, x_label[i], y_label[i], alty_label[i], - legend_text[i], title_label[i], line_label[i] ); + plot1( 0, x_label[i], y_label[i], alty_label[i], + legend_text[i], title_label[i], line_label[i] ); } pls.end(); @@ -149,18 +149,18 @@ double[] ampl = new double[101]; double[] phase = new double[101]; double f0, freq; - int nlegend = 2; - int[] opt_array = new int[2]; - int[] text_colors = new int[2]; - int[] line_colors = new int[2]; - int[] line_styles = new int[2]; - int[] line_widths = new int[2]; - int[] symbol_numbers = new int[2]; - int[] symbol_colors = new int[2]; - double[] symbol_scales = new double[2]; - String[] symbols = new String[2]; - double[] legend_width = new double[1]; - double[] legend_height = new double[1]; + int nlegend = 2; + int[] opt_array = new int[2]; + int[] text_colors = new int[2]; + int[] line_colors = new int[2]; + int[] line_styles = new int[2]; + int[] line_widths = new int[2]; + int[] symbol_numbers = new int[2]; + int[] symbol_colors = new int[2]; + double[] symbol_scales = new double[2]; + String[] symbols = new String[2]; + double[] legend_width = new double[1]; + double[] legend_height = new double[1]; pls.adv( 0 ); @@ -220,43 +220,42 @@ pls.col0( 3 ); pls.mtex( "r", 5.0, 0.5, 0.5, alty_label ); } - // Draw a legend - // First legend entry. - opt_array[0] = PLStream.PL_LEGEND_LINE; - text_colors[0] = 2; - line_colors[0] = 2; - line_styles[0] = 1; - line_widths[0] = 1; - // note from the above opt_array the first symbol (and box) indices - // do not have to be specified EXCEPT for symbols. - // Although this is unused, it can't be undefined as the String - // array is copied as part of the java bindings. - symbols[0] = ""; - - // Second legend entry. - opt_array[1] = PLStream.PL_LEGEND_LINE | PLStream.PL_LEGEND_SYMBOL; - text_colors[1] = 3; - line_colors[1] = 3; - line_styles[1] = 1; - line_widths[1] = 1; - symbol_colors[1] = 3; - symbol_scales[1] = 1.; - symbol_numbers[1] = 4; - symbols[1] = "*"; - // from the above opt_arrays we can completely ignore everything - // to do with boxes. + // Draw a legend + // First legend entry. + opt_array[0] = PLStream.PL_LEGEND_LINE; + text_colors[0] = 2; + line_colors[0] = 2; + line_styles[0] = 1; + line_widths[0] = 1; + // note from the above opt_array the first symbol (and box) indices + // do not have to be specified EXCEPT for symbols. + // Although this is unused, it can't be undefined as the String + // array is copied as part of the java bindings. + symbols[0] = ""; - pls.scol0a( 15, 32, 32, 32, 0.70 ); - pls.legend( legend_width, legend_height, - 0, PLStream.PL_LEGEND_BACKGROUND | PLStream.PL_LEGEND_BOUNDING_BOX, - 0.0, 0.0, 0.10, 15, - 1, 1, 0, 0, opt_array, - 1.0, 1.0, 2.0, - 1., text_colors, legend_text, - null, null, null, null, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + // Second legend entry. + opt_array[1] = PLStream.PL_LEGEND_LINE | PLStream.PL_LEGEND_SYMBOL; + text_colors[1] = 3; + line_colors[1] = 3; + line_styles[1] = 1; + line_widths[1] = 1; + symbol_colors[1] = 3; + symbol_scales[1] = 1.; + symbol_numbers[1] = 4; + symbols[1] = "*"; + // from the above opt_arrays we can completely ignore everything + // to do with boxes. + pls.scol0a( 15, 32, 32, 32, 0.70 ); + pls.legend( legend_width, legend_height, + 0, PLStream.PL_LEGEND_BACKGROUND | PLStream.PL_LEGEND_BOUNDING_BOX, + 0.0, 0.0, 0.10, 15, + 1, 1, 0, 0, opt_array, + 1.0, 1.0, 2.0, + 1., text_colors, legend_text, + null, null, null, null, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); } } Modified: trunk/examples/java/x27.java =================================================================== --- trunk/examples/java/x27.java 2011-01-28 20:08:59 UTC (rev 11518) +++ trunk/examples/java/x27.java 2011-01-28 20:20:13 UTC (rev 11519) @@ -49,7 +49,7 @@ public x27( String[] args ) { // R, r, p, N - double params[][] = { + double params[][] = { { 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 }, @@ -60,8 +60,8 @@ { 20.0, 13.0, 20.0, 20.0 }, { 20.0, -13.0, 20.0, 20.0 } }; - int i; - boolean fill; + int i; + boolean fill; // plplot initialization @@ -78,7 +78,7 @@ // First an overview, then all curves one by one pls.ssub( 3, 3 ); // Three by three window - fill = false; + fill = false; for ( i = 0; i < 9; i++ ) { pls.adv( 0 ); @@ -96,18 +96,18 @@ spiro( params[i], fill ); } - // Fill the curves - fill = true; - - pls.adv( 0 ); - pls.ssub( 1, 1 ); // One window per curve - - for ( i = 0; i < 9; i++ ) + // Fill the curves + fill = true; + + pls.adv( 0 ); + pls.ssub( 1, 1 ); // One window per curve + + for ( i = 0; i < 9; i++ ) { - pls.adv( 0 ); - pls.vpor( 0.0, 1.0, 0.0, 1.0 ); - spiro( params[i], fill ); - } + pls.adv( 0 ); + pls.vpor( 0.0, 1.0, 0.0, 1.0 ); + spiro( params[i], fill ); + } pls.end(); } @@ -183,10 +183,10 @@ pls.col0( 1 ); - if ( fill ) - pls.fill( xcoord, ycoord ); - else - pls.line( xcoord, ycoord ); + if ( fill ) + pls.fill( xcoord, ycoord ); + else + pls.line( xcoord, ycoord ); } } Modified: trunk/examples/java/x33.java =================================================================== --- trunk/examples/java/x33.java 2011-01-28 20:08:59 UTC (rev 11518) +++ trunk/examples/java/x33.java 2011-01-28 20:20:13 UTC (rev 11519) @@ -39,7 +39,6 @@ import java.text.*; class x33 { - PLStream pls = new PLStream(); public static void main( String[] args ) @@ -49,158 +48,158 @@ static String[] special_symbols = { - "✰", - "✴", - "✱", - "✽", - "✦" + "✰", + "✴", + "✱", + "✽", + "✦" }; void plcolorbar_example_1( int bar_type, double ticks, int sub_ticks, int n, double[] values, String title ) -{ - pls.adv( 0 ); - // Setup color palette 1 - pls.spal1( "cmap1_blue_red.pal", true ); - - double[] colors = new double[n]; - int i; - double color_step; - color_step = 1.0 / (double) ( n - 1 ); - for ( i = 0; i < n; i++ ) { - colors[i] = 0.0 + color_step * (double) ( i ); - } + pls.adv( 0 ); + // Setup color palette 1 + pls.spal1( "cmap1_blue_red.pal", true ); - int opt; - opt = PLStream.PL_COLORBAR_LEFT | bar_type | PLStream.PL_COLORBAR_LABEL_LEFT | - PLStream.PL_COLORBAR_CAP_HIGH; + double[] colors = new double[n]; + int i; + double color_step; + color_step = 1.0 / (double) ( n - 1 ); + for ( i = 0; i < n; i++ ) + { + colors[i] = 0.0 + color_step * (double) ( i ); + } - String axis_opts_1, axis_opts_2; - if ( (bar_type & PLStream.PL_COLORBAR_SHADE_LABEL ) > 0 ) - { - axis_opts_1 = "iv"; - axis_opts_2 = "i"; - } - else - { - if ( sub_ticks != 0 ) + int opt; + opt = PLStream.PL_COLORBAR_LEFT | bar_type | PLStream.PL_COLORBAR_LABEL_LEFT | + PLStream.PL_COLORBAR_CAP_HIGH; + + String axis_opts_1, axis_opts_2; + if ( ( bar_type & PLStream.PL_COLORBAR_SHADE_LABEL ) > 0 ) { - axis_opts_1 = "stv"; - axis_opts_2 = "st"; + axis_opts_1 = "iv"; + axis_opts_2 = "i"; } else { - axis_opts_1 = "tv"; - axis_opts_2 = "t"; + if ( sub_ticks != 0 ) + { + axis_opts_1 = "stv"; + axis_opts_2 = "st"; + } + else + { + axis_opts_1 = "tv"; + axis_opts_2 = "t"; + } } - } - pls.colorbar( opt, 0.1, 0.1, 0.5, 0.1, - ticks, sub_ticks, - axis_opts_1, "Test label - Left, High Cap", - colors, values ); + pls.colorbar( opt, 0.1, 0.1, 0.5, 0.1, + ticks, sub_ticks, + axis_opts_1, "Test label - Left, High Cap", + colors, values ); - opt = PLStream.PL_COLORBAR_RIGHT | bar_type | PLStream.PL_COLORBAR_LABEL_RIGHT | - PLStream.PL_COLORBAR_CAP_LOW; + opt = PLStream.PL_COLORBAR_RIGHT | bar_type | PLStream.PL_COLORBAR_LABEL_RIGHT | + PLStream.PL_COLORBAR_CAP_LOW; - pls.colorbar( opt, 0.1, 0.4, 0.5, 0.1, - ticks, sub_ticks, - axis_opts_1, "Test label - Right, Low Cap", - colors, values ); + pls.colorbar( opt, 0.1, 0.4, 0.5, 0.1, + ticks, sub_ticks, + axis_opts_1, "Test label - Right, Low Cap", + colors, values ); - opt = PLStream.PL_COLORBAR_UPPER | bar_type | PLStream.PL_COLORBAR_LABEL_UPPER | - PLStream.PL_COLORBAR_CAP_HIGH; + opt = PLStream.PL_COLORBAR_UPPER | bar_type | PLStream.PL_COLORBAR_LABEL_UPPER | + PLStream.PL_COLORBAR_CAP_HIGH; - pls.colorbar( opt, 0.1, 0.1, 0.5, 0.1, - ticks, sub_ticks, - axis_opts_2, "Test label - Upper, High Cap", - colors, values ); + pls.colorbar( opt, 0.1, 0.1, 0.5, 0.1, + ticks, sub_ticks, + axis_opts_2, "Test label - Upper, High Cap", + colors, values ); - opt = PLStream.PL_COLORBAR_LOWER | bar_type | PLStream.PL_COLORBAR_LABEL_LOWER | - PLStream.PL_COLORBAR_CAP_LOW; + opt = PLStream.PL_COLORBAR_LOWER | bar_type | PLStream.PL_COLORBAR_LABEL_LOWER | + PLStream.PL_COLORBAR_CAP_LOW; - pls.colorbar( opt, 0.4, 0.1, 0.5, 0.1, - ticks, sub_ticks, - axis_opts_2, "Test label - Lower, Low Cap", - colors, values ); + pls.colorbar( opt, 0.4, 0.1, 0.5, 0.1, + ticks, sub_ticks, + axis_opts_2, "Test label - Lower, Low Cap", + colors, values ); - pls.vpor( 0.0, 1.0, 0.0, 1.0 ); - pls.wind( 0.0, 1.0, 0.0, 1.0 ); - pls.ptex( 0.5, 0.5, 0.0, 0.0, 0.5, title ); -} + pls.vpor( 0.0, 1.0, 0.0, 1.0 ); + pls.wind( 0.0, 1.0, 0.0, 1.0 ); + pls.ptex( 0.5, 0.5, 0.0, 0.0, 0.5, title ); + } -void plcolorbar_example_2( int bar_type, double ticks, double sub_ticks, int n, double[] values, String title ) -{ - pls.adv( 0 ); - // Setup color palette 1 - pls.spal1( "cmap1_blue_yellow.pal", true ); - - double[] colors = new double[n]; - int i; - double color_step; - color_step = 1.0 / (double) ( n - 1 ); - for ( i = 0; i < n; i++ ) + void plcolorbar_example_2( int bar_type, double ticks, double sub_ticks, int n, double[] values, String title ) { - colors[i] = 0.0 + color_step * (double) ( i ); - } + pls.adv( 0 ); + // Setup color palette 1 + pls.spal1( "cmap1_blue_yellow.pal", true ); - int opt; - opt = PLStream.PL_COLORBAR_LEFT | bar_type | PLStream.PL_COLORBAR_LABEL_LEFT | - PLStream.PL_COLORBAR_CAP_LOW; + double[] colors = new double[n]; + int i; + double color_step; + color_step = 1.0 / (double) ( n - 1 ); + for ( i = 0; i < n; i++ ) + { + colors[i] = 0.0 + color_step * (double) ( i ); + } - String axis_opts_1, axis_opts_2; - if ( bar_type == PLStream.PL_COLORBAR_SHADE_LABEL ) - { - axis_opts_1 = ""; - axis_opts_2 = ""; - } - else - { - if ( sub_ticks != 0 ) + int opt; + opt = PLStream.PL_COLORBAR_LEFT | bar_type | PLStream.PL_COLORBAR_LABEL_LEFT | + PLStream.PL_COLORBAR_CAP_LOW; + + String axis_opts_1, axis_opts_2; + if ( bar_type == PLStream.PL_COLORBAR_SHADE_LABEL ) { - axis_opts_1 = "stv"; - axis_opts_2 = "st"; + axis_opts_1 = ""; + axis_opts_2 = ""; } else { - axis_opts_1 = "tv"; - axis_opts_2 = "t"; + if ( sub_ticks != 0 ) + { + axis_opts_1 = "stv"; + axis_opts_2 = "st"; + } + else + { + axis_opts_1 = "tv"; + axis_opts_2 = "t"; + } } - } - pls.colorbar( opt, 0.1, 0.1, 0.5, 0.1, - ticks, sub_ticks, - axis_opts_1, "Test label - Left, Low Cap", - colors, values ); + pls.colorbar( opt, 0.1, 0.1, 0.5, 0.1, + ticks, sub_ticks, + axis_opts_1, "Test label - Left, Low Cap", + colors, values ); - opt = PLStream.PL_COLORBAR_RIGHT | bar_type | PLStream.PL_COLORBAR_LABEL_RIGHT | - PLStream.PL_COLORBAR_CAP_HIGH; + opt = PLStream.PL_COLORBAR_RIGHT | bar_type | PLStream.PL_COLORBAR_LABEL_RIGHT | + PLStream.PL_COLORBAR_CAP_HIGH; - pls.colorbar( opt, 0.1, 0.4, 0.5, 0.1, - ticks, sub_ticks, - axis_opts_1, "Test label - Right, High Cap", - colors, values ); + pls.colorbar( opt, 0.1, 0.4, 0.5, 0.1, + ticks, sub_ticks, + axis_opts_1, "Test label - Right, High Cap", + colors, values ); - opt = PLStream.PL_COLORBAR_UPPER | bar_type | PLStream.PL_COLORBAR_LABEL_UPPER | - PLStream.PL_COLORBAR_CAP_LOW; + opt = PLStream.PL_COLORBAR_UPPER | bar_type | PLStream.PL_COLORBAR_LABEL_UPPER | + PLStream.PL_COLORBAR_CAP_LOW; - pls.colorbar( opt, 0.1, 0.1, 0.5, 0.1, - ticks, sub_ticks, - axis_opts_2, "Test label - Upper, Low Cap", - colors, values ); + pls.colorbar( opt, 0.1, 0.1, 0.5, 0.1, + ticks, sub_ticks, + axis_opts_2, "Test label - Upper, Low Cap", + colors, values ); - opt = PLStream.PL_COLORBAR_LOWER | bar_type | PLStream.PL_COLORBAR_LABEL_LOWER | - PLStream.PL_COLORBAR_CAP_HIGH; + opt = PLStream.PL_COLORBAR_LOWER | bar_type | PLStream.PL_COLORBAR_LABEL_LOWER | + PLStream.PL_COLORBAR_CAP_HIGH; - pls.colorbar( opt, 0.4, 0.1, 0.5, 0.1, - ticks, sub_ticks, - axis_opts_2, "Test label - Lower, High Cap", - colors, values ); + pls.colorbar( opt, 0.4, 0.1, 0.5, 0.1, + ticks, sub_ticks, + axis_opts_2, "Test label - Lower, High Cap", + colors, values ); - pls.vpor( 0.0, 1.0, 0.0, 1.0 ); - pls.wind( 0.0, 1.0, 0.0, 1.0 ); - pls.ptex( 0.5, 0.5, 0.0, 0.0, 0.5, title ); -} + pls.vpor( 0.0, 1.0, 0.0, 1.0 ); + pls.wind( 0.0, 1.0, 0.0, 1.0 ); + pls.ptex( 0.5, 0.5, 0.0, 0.0, 0.5, title ); + } //-------------------------------------------------------------------------- // x33 @@ -208,293 +207,138 @@ // Demonstrate most pllegend capability including unicode symbols. //-------------------------------------------------------------------------- -public x33( String[] args ) -{ - int i, k; - int opt; - int nlegend, nturn; - int[] opt_array; - int[] text_colors; - int[] box_colors; - int[] box_patterns; - double[] box_scales; - int[] box_line_widths; - int[] line_colors; - int[] line_styles; - int[] line_widths; - int[] symbol_numbers; - int[] symbol_colors; - double[] symbol_scales; - String[] text; - String[] symbols; - double[] legend_width = new double[1], legend_height = new double[1]; - double x, y, xstart, ystart; - double max_height, text_scale; - int position, opt_base, nrow, ncolumn; - int[] position_options = { - PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_UPPER | PLStream.PL_POSITION_OUTSIDE, - PLStream.PL_POSITION_UPPER | PLStream.PL_POSITION_OUTSIDE, - PLStream.PL_POSITION_RIGHT | PLStream.PL_POSITION_UPPER | PLStream.PL_POSITION_OUTSIDE, - PLStream.PL_POSITION_RIGHT | PLStream.PL_POSITION_OUTSIDE, - PLStream.PL_POSITION_RIGHT | PLStream.PL_POSITION_LOWER | PLStream.PL_POSITION_OUTSIDE, - PLStream.PL_POSITION_LOWER | PLStream.PL_POSITION_OUTSIDE, - PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_LOWER | PLStream.PL_POSITION_OUTSIDE, - PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_OUTSIDE, - PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_UPPER | PLStream.PL_POSITION_INSIDE, - PLStream.PL_POSITION_UPPER | PLStream.PL_POSITION_INSIDE, - PLStream.PL_POSITION_RIGHT | PLStream.PL_POSITION_UPPER | PLStream.PL_POSITION_INSIDE, - PLStream.PL_POSITION_RIGHT | PLStream.PL_POSITION_INSIDE, - PLStream.PL_POSITION_RIGHT | PLStream.PL_POSITION_LOWER | PLStream.PL_POSITION_INSIDE, - PLStream.PL_POSITION_LOWER | PLStream.PL_POSITION_INSIDE, - PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_LOWER | PLStream.PL_POSITION_INSIDE, - PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_INSIDE - }; - - NumberFormat nf = NumberFormat.getNumberInstance(); - nf.setMinimumIntegerDigits(2); - - // Parse and process command line arguments - pls.parseopts( args, PLStream.PL_PARSE_FULL | PLStream.PL_PARSE_NOPROGRAM ); - - // Initialize plplot - pls.init(); - - // First page illustrating the 16 standard positions. - pls.adv( 0 ); - pls.vpor( 0.25, 0.75, 0.25, 0.75 ); - pls.wind( 0.0, 1.0, 0.0, 1.0 ); - pls.box( "bc", 0.0, 0, "bc", 0.0, 0 ); - pls.sfont( PLStream.PL_FCI_SANS, -1, -1 ); - pls.mtex( "t", 8.0, 0.5, 0.5, "The 16 standard legend positions with" ); - pls.mtex( "t", 6.0, 0.5, 0.5, "the same (0.05) offset in x and y" ); - - nlegend = 1; - opt_array = new int[nlegend]; - text_colors = new int[nlegend]; - line_colors = new int[nlegend]; - line_styles = new int[nlegend]; - line_widths = new int[nlegend]; - symbol_numbers = new int[nlegend]; - symbol_colors = new int[nlegend]; - symbol_scales = new double[nlegend]; - text = new String[nlegend]; - symbols = new String[nlegend]; - // Only specify legend data that are required according to the - // value of opt_array for that entry. - opt_base = PLStream.PL_LEGEND_BACKGROUND | PLStream.PL_LEGEND_BOUNDING_BOX; - opt_array[0] = PLStream.PL_LEGEND_LINE | PLStream.PL_LEGEND_SYMBOL; - line_styles[0] = 1; - line_widths[0] = 1; - symbol_scales[0] = 1.; - symbol_numbers[0] = 4; - symbols[0] = "*"; - - // Use monotype fonts so that all legends are the same size. - pls.sfont( PLStream.PL_FCI_MONO, -1, -1 ); - pls.scol0a( 15, 32, 32, 32, 0.70 ); - - for ( k = 0; k < 16; k++ ) + public x33( String[] args ) { - position = position_options[k]; - opt = opt_base; - text[0] = nf.format( k ); - text_colors[0] = 1 + ( k % 8 ); - line_colors[0] = 1 + ( k % 8 ); - symbol_colors[0] = 1 + ( k % 8 ); + int i, k; + int opt; + int nlegend, nturn; + int[] opt_array; + int[] text_colors; + int[] box_colors; + int[] box_patterns; + double[] box_scales; + int[] box_line_widths; + int[] line_colors; + int[] line_styles; + int[] line_widths; + int[] symbol_numbers; + int[] symbol_colors; + double[] symbol_scales; + String[] text; + String[] symbols; + double[] legend_width = new double[1], legend_height = new double[1]; + double x, y, xstart, ystart; + double max_height, text_scale; + int position, opt_base, nrow, ncolumn; + int[] position_options = { + PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_UPPER | PLStream.PL_POSITION_OUTSIDE, + PLStream.PL_POSITION_UPPER | PLStream.PL_POSITION_OUTSIDE, + PLStream.PL_POSITION_RIGHT | PLStream.PL_POSITION_UPPER | PLStream.PL_POSITION_OUTSIDE, + PLStream.PL_POSITION_RIGHT | PLStream.PL_POSITION_OUTSIDE, + PLStream.PL_POSITION_RIGHT | PLStream.PL_POSITION_LOWER | PLStream.PL_POSITION_OUTSIDE, + PLStream.PL_POSITION_LOWER | PLStream.PL_POSITION_OUTSIDE, + PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_LOWER | PLStream.PL_POSITION_OUTSIDE, + PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_OUTSIDE, + PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_UPPER | PLStream.PL_POSITION_INSIDE, + PLStream.PL_POSITION_UPPER | PLStream.PL_POSITION_INSIDE, + PLStream.PL_POSITION_RIGHT | PLStream.PL_POSITION_UPPER | PLStream.PL_POSITION_INSIDE, + PLStream.PL_POSITION_RIGHT | PLStream.PL_POSITION_INSIDE, + PLStream.PL_POSITION_RIGHT | PLStream.PL_POSITION_LOWER | PLStream.PL_POSITION_INSIDE, + PLStream.PL_POSITION_LOWER | PLStream.PL_POSITION_INSIDE, + PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_LOWER | PLStream.PL_POSITION_INSIDE, + PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_INSIDE + }; - pls.legend( legend_width, legend_height, position, opt, 0.05, 0.05, - 0.1, 15, 1, 1, 0, 0, - opt_array, 1.0, 1.0, 2.0, - 1., text_colors, text, - null, null, null, null, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); - } + NumberFormat nf = NumberFormat.getNumberInstance(); + nf.setMinimumIntegerDigits( 2 ); - // Second page illustrating effect of nrow, ncolumn for the same legend - // data.; - pls.adv( 0 ); - pls.vpor( 0.25, 0.75, 0.25, 0.75 ); - pls.wind( 0.0, 1.0, 0.0, 1.0 ); - pls.box( "bc", 0.0, 0, "bc", 0.0, 0 ); - pls.sfont( PLStream.PL_FCI_SANS, -1, -1 ); - pls.mtex( "t", 8.0, 0.5, 0.5, "The effect of nrow, ncolumn, PL_LEGEND_ROW_MAJOR," ); - pls.mtex( "t", 6.0, 0.5, 0.5, "and position for the same legend data" ); + // Parse and process command line arguments + pls.parseopts( args, PLStream.PL_PARSE_FULL | PLStream.PL_PARSE_NOPROGRAM ); - nlegend = 7; - opt_array = new int[nlegend]; - text_colors = new int[nlegend]; - line_colors = new int[nlegend]; - line_styles = new int[nlegend]; - line_widths = new int[nlegend]; - box_colors = new int[nlegend]; - box_patterns = new int[nlegend]; - box_scales = new double[nlegend]; - box_line_widths = new int[nlegend]; - symbol_numbers = new int[nlegend]; - symbol_colors = new int[nlegend]; - symbol_scales = new double[nlegend]; - text = new String[nlegend]; - symbols = new String[nlegend]; + // Initialize plplot + pls.init(); - // Only specify legend data that are required according to the - // value of opt_array for that entry. - opt_base = PLStream.PL_LEGEND_BACKGROUND | PLStream.PL_LEGEND_BOUNDING_BOX; - for ( k = 0; k < nlegend; k++ ) - { - opt_array[k] = PLStream.PL_LEGEND_LINE | PLStream.PL_LEGEND_SYMBOL; - line_styles[k] = 1; - line_widths[k] = 1; - symbol_scales[k] = 1.; - symbol_numbers[k] = 2; - symbols[k] = "*"; - text[k] = nf.format( k ); - text_colors[k] = 1 + ( k % 8 ); - line_colors[k] = 1 + ( k % 8 ); - symbol_colors[k] = 1 + ( k % 8 ); - } + // First page illustrating the 16 standard positions. + pls.adv( 0 ); + pls.vpor( 0.25, 0.75, 0.25, 0.75 ); + pls.wind( 0.0, 1.0, 0.0, 1.0 ); + pls.box( "bc", 0.0, 0, "bc", 0.0, 0 ); + pls.sfont( PLStream.PL_FCI_SANS, -1, -1 ); + pls.mtex( "t", 8.0, 0.5, 0.5, "The 16 standard legend positions with" ); + pls.mtex( "t", 6.0, 0.5, 0.5, "the same (0.05) offset in x and y" ); - // Use monotype fonts so that all legends are the same size. - pls.sfont( PLStream.PL_FCI_MONO, -1, -1 ); - pls.scol0a( 15, 32, 32, 32, 0.70 ); + nlegend = 1; + opt_array = new int[nlegend]; + text_colors = new int[nlegend]; + line_colors = new int[nlegend]; + line_styles = new int[nlegend]; + line_widths = new int[nlegend]; + symbol_numbers = new int[nlegend]; + symbol_colors = new int[nlegend]; + symbol_scales = new double[nlegend]; + text = new String[nlegend]; + symbols = new String[nlegend]; + // Only specify legend data that are required according to the + // value of opt_array for that entry. + opt_base = PLStream.PL_LEGEND_BACKGROUND | PLStream.PL_LEGEND_BOUNDING_BOX; + opt_array[0] = PLStream.PL_LEGEND_LINE | PLStream.PL_LEGEND_SYMBOL; + line_styles[0] = 1; + line_widths[0] = 1; + symbol_scales[0] = 1.; + symbol_numbers[0] = 4; + symbols[0] = "*"; - position = PLStream.PL_POSITION_UPPER | PLStream.PL_POSITION_OUTSIDE; - opt = opt_base; - x = 0.; - y = 0.1; - nrow = 1; - ncolumn = nlegend; - pls.legend( legend_width, legend_height, position, opt, x, y, - 0.05, 15, 1, 1, nrow, ncolumn, - opt_array, 1.0, 1.0, 2.0, - 1., text_colors, text, - null, null, null, null, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + // Use monotype fonts so that all legends are the same size. + pls.sfont( PLStream.PL_FCI_MONO, -1, -1 ); + pls.scol0a( 15, 32, 32, 32, 0.70 ); - position = PLStream.PL_POSITION_LOWER | PLStream.PL_POSITION_OUTSIDE; - opt = opt_base; - x = 0.; - y = 0.1; - nrow = 1; - ncolumn = nlegend; - pls.legend( legend_width, legend_height, position, opt, x, y, - 0.05, 15, 1, 1, nrow, ncolumn, - opt_array, 1.0, 1.0, 2.0, - 1., text_colors, text, - null, null, null, null, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + for ( k = 0; k < 16; k++ ) + { + position = position_options[k]; + opt = opt_base; + text[0] = nf.format( k ); + text_colors[0] = 1 + ( k % 8 ); + line_colors[0] = 1 + ( k % 8 ); + symbol_colors[0] = 1 + ( k % 8 ); - position = PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_OUTSIDE; - opt = opt_base; - x = 0.1; - y = 0.; - nrow = nlegend; - ncolumn = 1; - pls.legend( legend_width, legend_height, position, opt, x, y, - 0.05, 15, 1, 1, nrow, ncolumn, - opt_array, 1.0, 1.0, 2.0, - 1., text_colors, text, - null, null, null, null, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + pls.legend( legend_width, legend_height, position, opt, 0.05, 0.05, + 0.1, 15, 1, 1, 0, 0, + opt_array, 1.0, 1.0, 2.0, + 1., text_colors, text, + null, null, null, null, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + } - position = PLStream.PL_POSITION_RIGHT | PLStream.PL_POSITION_OUTSIDE; - opt = opt_base; - x = 0.1; - y = 0.; - nrow = nlegend; - ncolumn = 1; - pls.legend( legend_width, legend_height, position, opt, x, y, - 0.05, 15, 1, 1, nrow, ncolumn, - opt_array, 1.0, 1.0, 2.0, - 1., text_colors, text, - null, null, null, null, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + // Second page illustrating effect of nrow, ncolumn for the same legend + // data.; + pls.adv( 0 ); + pls.vpor( 0.25, 0.75, 0.25, 0.75 ); + pls.wind( 0.0, 1.0, 0.0, 1.0 ); + pls.box( "bc", 0.0, 0, "bc", 0.0, 0 ); + pls.sfont( PLStream.PL_FCI_SANS, -1, -1 ); + pls.mtex( "t", 8.0, 0.5, 0.5, "The effect of nrow, ncolumn, PL_LEGEND_ROW_MAJOR," ); + pls.mtex( "t", 6.0, 0.5, 0.5, "and position for the same legend data" ); - position = PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_UPPER | PLStream.PL_POSITION_INSIDE; - opt = opt_base; - x = 0.; - y = 0.; - nrow = 6; - ncolumn = 2; - pls.legend( legend_width, legend_height, position, opt, x, y, - 0.05, 15, 1, 1, nrow, ncolumn, - opt_array, 1.0, 1.0, 2.0, - 1., text_colors, text, - null, null, null, null, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); + nlegend = 7; + opt_array = new int[nlegend]; + text_colors = new int[nlegend]; + line_colors = new int[nlegend]; + line_styles = new int[nlegend]; + line_widths = new int[nlegend]; + box_colors = new int[nlegend]; + box_patterns = new int[nlegend]; + box_scales = new double[nlegend]; + box_line_widths = new int[nlegend]; + symbol_numbers = new int[nlegend]; + symbol_colors = new int[nlegend]; + symbol_scales = new double[nlegend]; + text = new String[nlegend]; + symbols = new String[nlegend]; - position = PLStream.PL_POSITION_RIGHT | PLStream.PL_POSITION_UPPER | PLStream.PL_POSITION_INSIDE; - opt = opt_base | PLStream.PL_LEGEND_ROW_MAJOR; - x = 0.; - y = 0.; - nrow = 6; - ncolumn = 2; - pls.legend( legend_width, legend_height, position, opt, x, y, - 0.05, 15, 1, 1, nrow, ncolumn, - opt_array, 1.0, 1.0, 2.0, - 1., text_colors, text, - null, null, null, null, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); - - position = PLStream.PL_POSITION_LOWER | PLStream.PL_POSITION_INSIDE; - opt = opt_base | PLStream.PL_LEGEND_ROW_MAJOR; - x = 0.; - y = 0.; - nrow = 3; - ncolumn = 3; - pls.legend( legend_width, legend_height, position, opt, x, y, - 0.05, 15, 1, 1, nrow, ncolumn, - opt_array, 1.0, 1.0, 2.0, - 1., text_colors, text, - null, null, null, null, - line_colors, line_styles, line_widths, - symbol_colors, symbol_scales, symbol_numbers, symbols ); - - // Third page demonstrating legend alignment - pls.adv( 0 ); - pls.vpor( 0., 1., 0., 1. ); - pls.wind( 0.0, 1.0, 0.0, 1.0 ); - pls.sfont( PLStream.PL_FCI_SANS, -1, -1 ); - pls.mtex( "t", -2.0, 0.5, 0.5, "Demonstrate legend alignment" ); - - x = 0.1; - y = 0.1; - nturn = 4; - nlegend = 0; - opt_base = PLStream.PL_LEGEND_BACKGROUND | PLStream.PL_LEGEND_BOUNDING_BOX; - position = PLStream.PL_POSITION_UPPER | PLStream.PL_POSITION_LEFT; - opt = opt_base; - for ( i = 0; i < 9; i++ ) - { - // Set up legend arrays with the correct size, type. - if ( i <= nturn ) - nlegend = nlegend + 1; - else - nlegend = nlegend - 1; - nlegend = Math.max( 1, nlegend ); - opt_array = new int[nlegend]; - text_colors = new int[nlegend]; - line_colors = new int[nlegend]; - line_styles = new int[nlegend]; - line_widths = new int[nlegend]; - box_colors = new int[nlegend]; - box_patterns = new int[nlegend]; - box_scales = new double[nlegend]; - box_line_widths = new int[nlegend]; - symbol_numbers = new int[nlegend]; - symbol_colors = new int[nlegend]; - symbol_scales = new double[nlegend]; - text = new String[nlegend]; - symbols = new String[nlegend]; - // Only specify legend data that are required according to the - // value of opt_array for that entry. + // value of opt_array for that entry. + opt_base = PLStream.PL_LEGEND_BACKGROUND | PLStream.PL_LEGEND_BOUNDING_BOX; for ( k = 0; k < nlegend; k++ ) { opt_array[k] = PLStream.PL_LEGEND_LINE | PLStream.PL_LEGEND_SYMBOL; @@ -503,350 +347,503 @@ symbol_scales[k] = 1.; symbol_numbers[k] = 2; symbols[k] = "*"; - text[k] = nf.format( k ); - text_colors[k] = 1 + ( k % 8 ); - line_colors[k] = 1 + ( k % 8 ); - symbol_colors[k] = 1 + ( k % 8 ); + text[k] = nf.format( k ); + text_colors[k] = 1 + ( k % 8 ); + line_colors[k] = 1 + ( k % 8 ); + symbol_colors[k] = 1 + ( k % 8 ); } + // Use monotype fonts so that all legends are the same size. pls.sfont( PLStream.PL_FCI_MONO, -1, -1 ); pls.scol0a( 15, 32, 32, 32, 0.70 ); - nrow = Math.min( 3, nlegend ); - ncolumn = 0; + position = PLStream.PL_POSITION_UPPER | PLStream.PL_POSITION_OUTSIDE; + opt = opt_base; + x = 0.; + y = 0.1; + nrow = 1; + ncolumn = nlegend; + pls.legend( legend_width, legend_height, position, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + opt_array, 1.0, 1.0, 2.0, + 1., text_colors, text, + null, null, null, null, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + position = PLStream.PL_POSITION_LOWER | PLStream.PL_POSITION_OUTSIDE; + opt = opt_base; + x = 0.; + y = 0.1; + nrow = 1; + ncolumn = nlegend; pls.legend( legend_width, legend_height, position, opt, x, y, - 0.025, 15, 1, 1, nrow, ncolumn, - opt_array, 1.0, 1.0, 1.5, + 0.05, 15, 1, 1, nrow, ncolumn, + opt_array, 1.0, 1.0, 2.0, 1., text_colors, text, null, null, null, null, line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ); - if ( i == nturn ) + position = PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_OUTSIDE; + opt = opt_base; + x = 0.1; + y = 0.; + nrow = nlegend; + ncolumn = 1; + pls.legend( legend_width, legend_height, position, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + opt_array, 1.0, 1.0, 2.0, + 1., text_colors, text, + null, null, null, null, + line_colors, line_styles, line_widths, + symbol_colors, symbol_scales, symbol_numbers, symbols ); + + position = PLStream.PL_POSITION_RIGHT | PLStream.PL_POSITION_OUTSIDE; + opt = opt_base; + x = 0.1; + y = 0.; + nrow = nlegend; + ncolumn = 1; + pls.legend( legend_width, legend_height, position, opt, x, y, + 0.05, 15, 1, 1, nrow, ncolumn, + opt_array, 1.0, 1.0, ... [truncated message content] |
From: <hez...@us...> - 2011-01-29 17:09:05
|
Revision: 11520 http://plplot.svn.sourceforge.net/plplot/?rev=11520&view=rev Author: hezekiahcarty Date: 2011-01-29 17:08:58 +0000 (Sat, 29 Jan 2011) Log Message: ----------- Add support for contours in plcolorbar for shaded colorbars Includes a small update to C example 33. Modified Paths: -------------- trunk/examples/c/x33c.c trunk/include/plplot.h trunk/src/pllegend.c Modified: trunk/examples/c/x33c.c =================================================================== --- trunk/examples/c/x33c.c 2011-01-28 20:20:13 UTC (rev 11519) +++ trunk/examples/c/x33c.c 2011-01-29 17:08:58 UTC (rev 11520) @@ -61,7 +61,7 @@ }; void -plcolorbar_example_1( PLINT bar_type, PLFLT ticks, PLINT sub_ticks, PLINT n, PLFLT *values, const char *title ) +plcolorbar_example_1( PLINT bar_type, PLINT cont_color, PLINT cont_width, PLFLT ticks, PLINT sub_ticks, PLINT n, PLFLT *values, const char *title ) { pladv( 0 ); // Setup color palette 1 @@ -101,6 +101,7 @@ } plcolorbar( opt, 0.1, 0.1, 0.5, 0.1, + cont_color, cont_width, ticks, sub_ticks, axis_opts_1, "Test label - Left, High Cap", n, colors, values ); @@ -109,6 +110,7 @@ PL_COLORBAR_CAP_LOW; plcolorbar( opt, 0.1, 0.4, 0.5, 0.1, + cont_color, cont_width, ticks, sub_ticks, axis_opts_1, "Test label - Right, Low Cap", n, colors, values ); @@ -117,6 +119,7 @@ PL_COLORBAR_CAP_HIGH; plcolorbar( opt, 0.1, 0.1, 0.5, 0.1, + cont_color, cont_width, ticks, sub_ticks, axis_opts_2, "Test label - Upper, High Cap", n, colors, values ); @@ -125,6 +128,7 @@ PL_COLORBAR_CAP_LOW; plcolorbar( opt, 0.4, 0.1, 0.5, 0.1, + cont_color, cont_width, ticks, sub_ticks, axis_opts_2, "Test label - Lower, Low Cap", n, colors, values ); @@ -135,7 +139,7 @@ } void -plcolorbar_example_2( PLINT bar_type, PLFLT ticks, PLFLT sub_ticks, PLINT n, PLFLT *values, const char *title ) +plcolorbar_example_2( PLINT bar_type, PLINT cont_color, PLINT cont_width, PLFLT ticks, PLFLT sub_ticks, PLINT n, PLFLT *values, const char *title ) { pladv( 0 ); // Setup color palette 1 @@ -175,6 +179,7 @@ } plcolorbar( opt, 0.1, 0.1, 0.5, 0.1, + cont_color, cont_width, ticks, sub_ticks, axis_opts_1, "Test label - Left, Low Cap", n, colors, values ); @@ -183,6 +188,7 @@ PL_COLORBAR_CAP_HIGH; plcolorbar( opt, 0.1, 0.4, 0.5, 0.1, + cont_color, cont_width, ticks, sub_ticks, axis_opts_1, "Test label - Right, High Cap", n, colors, values ); @@ -191,6 +197,7 @@ PL_COLORBAR_CAP_LOW; plcolorbar( opt, 0.1, 0.1, 0.5, 0.1, + cont_color, cont_width, ticks, sub_ticks, axis_opts_2, "Test label - Upper, Low Cap", n, colors, values ); @@ -199,6 +206,7 @@ PL_COLORBAR_CAP_HIGH; plcolorbar( opt, 0.4, 0.1, 0.5, 0.1, + cont_color, cont_width, ticks, sub_ticks, axis_opts_2, "Test label - Lower, High Cap", n, colors, values ); @@ -765,15 +773,19 @@ PLFLT values_small[2] = { 0.0, 1.0 }; PLFLT values_uneven[9] = { 0.0, 2.0, 2.6, 3.4, 6.0, 7.0, 8.0, 9.0, 10.0 }; PLFLT values_even[9] = { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 }; - plcolorbar_example_1( PL_COLORBAR_IMAGE, 0.0, 0, 2, values_small, "Image Color Bars" ); - plcolorbar_example_2( PL_COLORBAR_IMAGE, 0.0, 0, 2, values_small, "Image Color Bars" ); - plcolorbar_example_1( PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0.0, 0, 9, values_uneven, + plcolorbar_example_1( PL_COLORBAR_IMAGE, 0, 0, 0.0, 0, 2, values_small, "Image Color Bars" ); + plcolorbar_example_2( PL_COLORBAR_IMAGE, 0, 0, 0.0, 0, 2, values_small, "Image Color Bars" ); + plcolorbar_example_1( PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, 0, 0.0, 0, 9, values_uneven, "Shade Color Bars - Uneven Steps" ); - plcolorbar_example_2( PL_COLORBAR_SHADE, 3.0, 3, 9, values_even, + plcolorbar_example_2( PL_COLORBAR_SHADE, 0, 0, 3.0, 3, 9, values_even, "Shade Color Bars - Even Steps" ); - plcolorbar_example_1( PL_COLORBAR_GRADIENT, 0.5, 5, 2, values_small, + plcolorbar_example_1( PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 2, 1, 0.0, 0, 9, values_uneven, + "Shade Color Bars - Uneven Steps, Contours" ); + plcolorbar_example_2( PL_COLORBAR_SHADE, 2, 3, 3.0, 3, 9, values_even, + "Shade Color Bars - Even Steps, Contours" ); + plcolorbar_example_1( PL_COLORBAR_GRADIENT, 0, 0, 0.5, 5, 2, values_small, "Gradient Color Bars" ); - plcolorbar_example_2( PL_COLORBAR_GRADIENT, 0.5, 5, 2, values_small, + plcolorbar_example_2( PL_COLORBAR_GRADIENT, 0, 0, 0.5, 5, 2, values_small, "Gradient Color Bars" ); // Free space that contained legend text. Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2011-01-28 20:20:13 UTC (rev 11519) +++ trunk/include/plplot.h 2011-01-29 17:08:58 UTC (rev 11520) @@ -1265,6 +1265,7 @@ // Routine for drawing continous colour legends PLDLLIMPEXP void c_plcolorbar( PLINT opt, PLFLT x, PLFLT y, PLFLT length, PLFLT width, + PLINT cont_color, PLINT cont_width, PLFLT ticks, PLINT sub_ticks, const char *axis_opts, const char *label, PLINT n_colors, PLFLT *colors, PLFLT *values ); Modified: trunk/src/pllegend.c =================================================================== --- trunk/src/pllegend.c 2011-01-28 20:20:13 UTC (rev 11519) +++ trunk/src/pllegend.c 2011-01-29 17:08:58 UTC (rev 11520) @@ -908,6 +908,7 @@ void c_plcolorbar( PLINT opt, PLFLT x, PLFLT y, PLFLT length, PLFLT width, + PLINT cont_color, PLINT cont_width, PLFLT ticks, PLINT sub_ticks, const char *axis_opts, const char *label, PLINT n_colors, PLFLT *colors, PLFLT *values ) @@ -1130,7 +1131,7 @@ // Draw the color bar plshades( color_data, ni, nj, NULL, wx_min, wx_max, wy_min, wy_max, - values, n_colors, 0, 0, 0, plfill, TRUE, + values, n_colors, 0, cont_color, cont_width, plfill, TRUE, pltr1, (void *) ( &grid ) ); plFree2dGrid( color_data, ni, nj ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hez...@us...> - 2011-01-29 17:10:38
|
Revision: 11522 http://plplot.svn.sourceforge.net/plplot/?rev=11522&view=rev Author: hezekiahcarty Date: 2011-01-29 17:10:32 +0000 (Sat, 29 Jan 2011) Log Message: ----------- Add support for specific color ranges in plcolorbar for shade bars Caps can now be a distinct color from the colors in the colorbar itself. C example 33 is also updated to demonstrate this feature. Modified Paths: -------------- trunk/examples/c/x33c.c trunk/src/pllegend.c Modified: trunk/examples/c/x33c.c =================================================================== --- trunk/examples/c/x33c.c 2011-01-29 17:09:51 UTC (rev 11521) +++ trunk/examples/c/x33c.c 2011-01-29 17:10:32 UTC (rev 11522) @@ -69,11 +69,11 @@ PLFLT colors[n]; int i; - PLFLT color_step; + PLFLT color_step, color_offset; color_step = 1.0 / (PLFLT) ( n - 1 ); for ( i = 0; i < n; i++ ) { - colors[i] = 0.0 + color_step * (PLFLT) ( i ); + colors[i] = color_offset + color_step * (PLFLT) ( i ); } PLINT opt; @@ -147,11 +147,23 @@ PLFLT colors[n]; int i; - PLFLT color_step; + PLFLT color_step, color_offset; color_step = 1.0 / (PLFLT) ( n - 1 ); for ( i = 0; i < n; i++ ) { - colors[i] = 0.0 + color_step * (PLFLT) ( i ); + if ( i == 0 ) + { + color_offset = 0.01; + } + else if ( i == n - 1 ) + { + color_offset = -0.01; + } + else + { + color_offset = 0.0; + } + colors[i] = color_offset + color_step * (PLFLT) ( i ); } PLINT opt; Modified: trunk/src/pllegend.c =================================================================== --- trunk/src/pllegend.c 2011-01-29 17:09:51 UTC (rev 11521) +++ trunk/src/pllegend.c 2011-01-29 17:10:32 UTC (rev 11522) @@ -920,6 +920,13 @@ min_value = values[0]; max_value = values[ n_colors - 1 ]; + // Min and max colors + // Assumes that the colors array is sorted from smallest to largest + // OR from largest to smallest. + PLFLT min_color, max_color; + min_color = colors[0]; + max_color = colors[ n_colors - 1 ]; + // Saved normalized coordinates of viewport. PLFLT xdmin_save, xdmax_save, ydmin_save, ydmax_save; // Saved world coordinates of viewport. @@ -1088,12 +1095,28 @@ // Transform grid PLcGrid grid; PLFLT grid_axis[2] = { 0.0, 1.0 }; - n_steps = n_colors; + n_steps = n_colors + 2; + PLFLT values_ext[n_steps]; + for ( i = 0; i < n_steps; i++ ) + { + if ( i == 0 ) + { + values_ext[i] = min_value - (values[i + 1] - min_value) * 0.1; + } + else if ( i == n_steps - 1 ) + { + values_ext[i] = max_value + (max_value - values[i - 1]) * 0.1; + } + else + { + values_ext[i] = values[i - 1]; + } + } // Use the provided values. if ( opt & PL_COLORBAR_LEFT || opt & PL_COLORBAR_RIGHT ) { grid.xg = grid_axis; - grid.yg = values; + grid.yg = values_ext; grid.nx = 2; grid.ny = n_steps; ni = 2; @@ -1103,13 +1126,13 @@ { for ( j = 0; j < nj; j++ ) { - color_data[i][j] = values[j]; + color_data[i][j] = values_ext[j]; } } } else if ( opt & PL_COLORBAR_UPPER || opt & PL_COLORBAR_LOWER ) { - grid.xg = values; + grid.xg = values_ext; grid.yg = grid_axis; grid.nx = n_steps; grid.ny = 2; @@ -1120,7 +1143,7 @@ { for ( j = 0; j < nj; j++ ) { - color_data[i][j] = values[i]; + color_data[i][j] = values_ext[i]; } } } @@ -1131,7 +1154,7 @@ // Draw the color bar plshades( color_data, ni, nj, NULL, wx_min, wx_max, wy_min, wy_max, - values, n_colors, 0, cont_color, cont_width, plfill, TRUE, + values_ext, n_steps, 0, cont_color, cont_width, plfill, TRUE, pltr1, (void *) ( &grid ) ); plFree2dGrid( color_data, ni, nj ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hez...@us...> - 2011-01-29 17:11:00
|
Revision: 11523 http://plplot.svn.sourceforge.net/plplot/?rev=11523&view=rev Author: hezekiahcarty Date: 2011-01-29 17:10:54 +0000 (Sat, 29 Jan 2011) Log Message: ----------- Split plcolorbar opt argument in to opt and opt_position This is in preparation for the same change in pllegend, to make it easier to share positioning logic and options between plcolorbar and pllegend. Modified Paths: -------------- trunk/examples/c/x33c.c trunk/include/plplot.h trunk/src/pllegend.c Modified: trunk/examples/c/x33c.c =================================================================== --- trunk/examples/c/x33c.c 2011-01-29 17:10:32 UTC (rev 11522) +++ trunk/examples/c/x33c.c 2011-01-29 17:10:54 UTC (rev 11523) @@ -76,9 +76,9 @@ colors[i] = color_offset + color_step * (PLFLT) ( i ); } - PLINT opt; - opt = PL_COLORBAR_LEFT | bar_type | PL_COLORBAR_LABEL_LEFT | - PL_COLORBAR_CAP_HIGH; + PLINT opt, opt_position; + opt = bar_type | PL_COLORBAR_LABEL_LEFT | PL_COLORBAR_CAP_HIGH; + opt_position = PL_COLORBAR_LEFT; const char *axis_opts_1, *axis_opts_2; if ( bar_type & PL_COLORBAR_SHADE_LABEL ) @@ -100,34 +100,34 @@ } } - plcolorbar( opt, 0.1, 0.1, 0.5, 0.1, + plcolorbar( opt, opt_position, 0.1, 0.1, 0.5, 0.1, cont_color, cont_width, ticks, sub_ticks, axis_opts_1, "Test label - Left, High Cap", n, colors, values ); - opt = PL_COLORBAR_RIGHT | bar_type | PL_COLORBAR_LABEL_RIGHT | - PL_COLORBAR_CAP_LOW; + opt = bar_type | PL_COLORBAR_LABEL_RIGHT | PL_COLORBAR_CAP_LOW; + opt_position = PL_COLORBAR_RIGHT; - plcolorbar( opt, 0.1, 0.4, 0.5, 0.1, + plcolorbar( opt, opt_position, 0.1, 0.4, 0.5, 0.1, cont_color, cont_width, ticks, sub_ticks, axis_opts_1, "Test label - Right, Low Cap", n, colors, values ); - opt = PL_COLORBAR_UPPER | bar_type | PL_COLORBAR_LABEL_UPPER | - PL_COLORBAR_CAP_HIGH; + opt = bar_type | PL_COLORBAR_LABEL_UPPER | PL_COLORBAR_CAP_HIGH; + opt_position = PL_COLORBAR_UPPER; - plcolorbar( opt, 0.1, 0.1, 0.5, 0.1, + plcolorbar( opt, opt_position, 0.1, 0.1, 0.5, 0.1, cont_color, cont_width, ticks, sub_ticks, axis_opts_2, "Test label - Upper, High Cap", n, colors, values ); - opt = PL_COLORBAR_LOWER | bar_type | PL_COLORBAR_LABEL_LOWER | - PL_COLORBAR_CAP_LOW; + opt = bar_type | PL_COLORBAR_LABEL_LOWER | PL_COLORBAR_CAP_LOW; + opt_position = PL_COLORBAR_LOWER; - plcolorbar( opt, 0.4, 0.1, 0.5, 0.1, + plcolorbar( opt, opt_position, 0.4, 0.1, 0.5, 0.1, cont_color, cont_width, ticks, sub_ticks, axis_opts_2, "Test label - Lower, Low Cap", @@ -166,9 +166,9 @@ colors[i] = color_offset + color_step * (PLFLT) ( i ); } - PLINT opt; - opt = PL_COLORBAR_LEFT | bar_type | PL_COLORBAR_LABEL_LEFT | - PL_COLORBAR_CAP_LOW; + PLINT opt, opt_position; + opt = bar_type | PL_COLORBAR_LABEL_LEFT | PL_COLORBAR_CAP_LOW; + opt_position = PL_COLORBAR_LEFT; const char *axis_opts_1, *axis_opts_2; if ( bar_type == PL_COLORBAR_SHADE_LABEL ) @@ -190,34 +190,34 @@ } } - plcolorbar( opt, 0.1, 0.1, 0.5, 0.1, + plcolorbar( opt, opt_position, 0.1, 0.1, 0.5, 0.1, cont_color, cont_width, ticks, sub_ticks, axis_opts_1, "Test label - Left, Low Cap", n, colors, values ); - opt = PL_COLORBAR_RIGHT | bar_type | PL_COLORBAR_LABEL_RIGHT | - PL_COLORBAR_CAP_HIGH; + opt = bar_type | PL_COLORBAR_LABEL_RIGHT | PL_COLORBAR_CAP_HIGH; + opt_position = PL_COLORBAR_RIGHT; - plcolorbar( opt, 0.1, 0.4, 0.5, 0.1, + plcolorbar( opt, opt_position, 0.1, 0.4, 0.5, 0.1, cont_color, cont_width, ticks, sub_ticks, axis_opts_1, "Test label - Right, High Cap", n, colors, values ); - opt = PL_COLORBAR_UPPER | bar_type | PL_COLORBAR_LABEL_UPPER | - PL_COLORBAR_CAP_LOW; + opt = bar_type | PL_COLORBAR_LABEL_UPPER | PL_COLORBAR_CAP_LOW; + opt_position = PL_COLORBAR_UPPER; - plcolorbar( opt, 0.1, 0.1, 0.5, 0.1, + plcolorbar( opt, opt_position, 0.1, 0.1, 0.5, 0.1, cont_color, cont_width, ticks, sub_ticks, axis_opts_2, "Test label - Upper, Low Cap", n, colors, values ); - opt = PL_COLORBAR_LOWER | bar_type | PL_COLORBAR_LABEL_LOWER | - PL_COLORBAR_CAP_HIGH; + opt = bar_type | PL_COLORBAR_LABEL_LOWER | PL_COLORBAR_CAP_HIGH; + opt_position = PL_COLORBAR_LOWER; - plcolorbar( opt, 0.4, 0.1, 0.5, 0.1, + plcolorbar( opt, opt_position, 0.4, 0.1, 0.5, 0.1, cont_color, cont_width, ticks, sub_ticks, axis_opts_2, "Test label - Lower, High Cap", Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2011-01-29 17:10:32 UTC (rev 11522) +++ trunk/include/plplot.h 2011-01-29 17:10:54 UTC (rev 11523) @@ -1264,7 +1264,8 @@ // Routine for drawing continous colour legends PLDLLIMPEXP void -c_plcolorbar( PLINT opt, PLFLT x, PLFLT y, PLFLT length, PLFLT width, +c_plcolorbar( PLINT opt, PLINT opt_position, + PLFLT x, PLFLT y, PLFLT length, PLFLT width, PLINT cont_color, PLINT cont_width, PLFLT ticks, PLINT sub_ticks, const char *axis_opts, const char *label, Modified: trunk/src/pllegend.c =================================================================== --- trunk/src/pllegend.c 2011-01-29 17:10:32 UTC (rev 11522) +++ trunk/src/pllegend.c 2011-01-29 17:10:54 UTC (rev 11523) @@ -802,8 +802,20 @@ return; } +//-------------------------------------------------------------------------- +//! Draw end-caps for color bars. +//! +//! @param opt TODO +//! @param opt_position TODO +//! @param x TODO +//! @param y TODO +//! @param length TODO +//! @param width TODO +//! @param color TODO +//! + void -draw_cap( PLINT opt, PLFLT x, PLFLT y, PLFLT length, PLFLT width, PLFLT color ) +draw_cap( PLINT opt, PLINT opt_position, PLFLT x, PLFLT y, PLFLT length, PLFLT width, PLFLT color ) { // Save drawing color PLINT col0_save = plsc->icol0; @@ -830,12 +842,12 @@ if ( opt & PL_COLORBAR_CAP_LOW ) { - if ( opt & PL_COLORBAR_LEFT || opt & PL_COLORBAR_RIGHT ) + if ( opt_position & PL_COLORBAR_LEFT || opt_position & PL_COLORBAR_RIGHT ) { // Draw the cap on the bottom - if ( opt & PL_COLORBAR_LEFT ) + if ( opt_position & PL_COLORBAR_LEFT ) xs[0] = x; - else if ( opt & PL_COLORBAR_RIGHT ) + else if ( opt_position & PL_COLORBAR_RIGHT ) xs[0] = 1.0 - x - width; ys[0] = y; xs[2] = xs[0] + width; @@ -845,13 +857,13 @@ plfill( 3, xs, ys ); } - else if ( opt & PL_COLORBAR_UPPER || opt & PL_COLORBAR_LOWER ) + else if ( opt_position & PL_COLORBAR_UPPER || opt_position & PL_COLORBAR_LOWER ) { // Draw the cap on the left xs[0] = x; - if ( opt & PL_COLORBAR_UPPER ) + if ( opt_position & PL_COLORBAR_UPPER ) ys[0] = 1.0 - y - width; - else if ( opt & PL_COLORBAR_LOWER ) + else if ( opt_position & PL_COLORBAR_LOWER ) ys[0] = y; xs[2] = xs[0]; ys[2] = ys[0] + width; @@ -863,12 +875,12 @@ } else if ( opt & PL_COLORBAR_CAP_HIGH ) { - if ( opt & PL_COLORBAR_LEFT || opt & PL_COLORBAR_RIGHT ) + if ( opt_position & PL_COLORBAR_LEFT || opt_position & PL_COLORBAR_RIGHT ) { // Draw the cap on the top - if ( opt & PL_COLORBAR_LEFT ) + if ( opt_position & PL_COLORBAR_LEFT ) xs[0] = x; - else if ( opt & PL_COLORBAR_RIGHT ) + else if ( opt_position & PL_COLORBAR_RIGHT ) xs[0] = 1.0 - x - width; ys[0] = y + length; xs[2] = xs[0] + width; @@ -878,13 +890,13 @@ plfill( 3, xs, ys ); } - else if ( opt & PL_COLORBAR_UPPER || opt & PL_COLORBAR_LOWER ) + else if ( opt_position & PL_COLORBAR_UPPER || opt_position & PL_COLORBAR_LOWER ) { // Draw the cap on the right xs[0] = x + length; - if ( opt & PL_COLORBAR_UPPER ) + if ( opt_position & PL_COLORBAR_UPPER ) ys[0] = 1.0 - y - width; - else if ( opt & PL_COLORBAR_LOWER ) + else if ( opt_position & PL_COLORBAR_LOWER ) ys[0] = y; xs[2] = xs[0]; ys[2] = ys[0] + width; @@ -906,8 +918,29 @@ plwind( xwmin_save, xwmax_save, ywmin_save, ywmax_save ); } +//-------------------------------------------------------------------------- +//! Plot color bar for image, shade or gradient plots. +//! +//! @param opt TODO +//! @param opt_position TODO +//! @param x TODO +//! @param y TODO +//! @param length TODO +//! @param width TODO +//! @param cont_color TODO +//! @param cont_width TODO +//! @param ticks TODO +//! @param sub_ticks TODO +//! @param axis_opts TODO +//! @param label TODO +//! @param n_colors TODO +//! @param colors TODO +//! @param values TODO +//! + void -c_plcolorbar( PLINT opt, PLFLT x, PLFLT y, PLFLT length, PLFLT width, +c_plcolorbar( PLINT opt, PLINT opt_position, + PLFLT x, PLFLT y, PLFLT length, PLFLT width, PLINT cont_color, PLINT cont_width, PLFLT ticks, PLINT sub_ticks, const char *axis_opts, const char *label, @@ -946,7 +979,7 @@ PLFLT vx_min, vx_max, vy_min, vy_max; PLFLT wx_min, wx_max, wy_min, wy_max; // Build the proper viewport and window dimensions - if ( opt & PL_COLORBAR_LEFT ) + if ( opt_position & PL_COLORBAR_LEFT ) { vx_min = x; vy_min = y; @@ -957,7 +990,7 @@ wx_max = 1.0; wy_max = max_value; } - else if ( opt & PL_COLORBAR_RIGHT ) + else if ( opt_position & PL_COLORBAR_RIGHT ) { vx_min = 1.0 - x - width; vy_min = y; @@ -968,7 +1001,7 @@ wx_max = 1.0; wy_max = max_value; } - else if ( opt & PL_COLORBAR_UPPER ) + else if ( opt_position & PL_COLORBAR_UPPER ) { vx_min = x; vy_min = 1.0 - y - width; @@ -979,7 +1012,7 @@ wx_max = max_value; wy_max = 1.0; } - else if ( opt & PL_COLORBAR_LOWER ) + else if ( opt_position & PL_COLORBAR_LOWER ) { vx_min = x; vy_min = y; @@ -1018,7 +1051,7 @@ // TODO: Determine a better way to specify the steps here? n_steps = plsc->ncol1; step_size = ( max_value - min_value ) / (PLFLT) n_steps; - if ( opt & PL_COLORBAR_LEFT || opt & PL_COLORBAR_RIGHT ) + if ( opt_position & PL_COLORBAR_LEFT || opt_position & PL_COLORBAR_RIGHT ) { ni = 2; nj = n_steps; @@ -1031,7 +1064,7 @@ } } } - else if ( opt & PL_COLORBAR_UPPER || opt & PL_COLORBAR_LOWER ) + else if ( opt_position & PL_COLORBAR_UPPER || opt_position & PL_COLORBAR_LOWER ) { ni = n_steps; nj = 2; @@ -1054,7 +1087,7 @@ { n_steps = n_colors; // Use the provided values in this case. - if ( opt & PL_COLORBAR_LEFT || opt & PL_COLORBAR_RIGHT ) + if ( opt_position & PL_COLORBAR_LEFT || opt_position & PL_COLORBAR_RIGHT ) { ni = 2; nj = n_steps; @@ -1067,7 +1100,7 @@ } } } - else if ( opt & PL_COLORBAR_UPPER || opt & PL_COLORBAR_LOWER ) + else if ( opt_position & PL_COLORBAR_UPPER || opt_position & PL_COLORBAR_LOWER ) { ni = n_steps; nj = 2; @@ -1113,7 +1146,7 @@ } } // Use the provided values. - if ( opt & PL_COLORBAR_LEFT || opt & PL_COLORBAR_RIGHT ) + if ( opt_position & PL_COLORBAR_LEFT || opt_position & PL_COLORBAR_RIGHT ) { grid.xg = grid_axis; grid.yg = values_ext; @@ -1130,7 +1163,7 @@ } } } - else if ( opt & PL_COLORBAR_UPPER || opt & PL_COLORBAR_LOWER ) + else if ( opt_position & PL_COLORBAR_UPPER || opt_position & PL_COLORBAR_LOWER ) { grid.xg = values_ext; grid.yg = grid_axis; @@ -1170,11 +1203,11 @@ xs[3] = wx_min; ys[3] = wy_max; PLFLT angle; - if ( opt & PL_COLORBAR_LEFT || opt & PL_COLORBAR_RIGHT ) + if ( opt_position & PL_COLORBAR_LEFT || opt_position & PL_COLORBAR_RIGHT ) { angle = 90.0; } - else if ( opt & PL_COLORBAR_UPPER || opt & PL_COLORBAR_LOWER ) + else if ( opt_position & PL_COLORBAR_UPPER || opt_position & PL_COLORBAR_LOWER ) { angle = 0.0; } @@ -1197,29 +1230,29 @@ { // Add an extra offset for the label so it does not bump in to the // cap. - if ( ( ( opt & PL_COLORBAR_LEFT || opt & PL_COLORBAR_RIGHT ) && + if ( ( ( opt_position & PL_COLORBAR_LEFT || opt_position & PL_COLORBAR_RIGHT ) && opt & PL_COLORBAR_LABEL_LOWER ) || - ( ( opt & PL_COLORBAR_UPPER || opt & PL_COLORBAR_LOWER ) && + ( ( opt_position & PL_COLORBAR_UPPER || opt_position & PL_COLORBAR_LOWER ) && opt & PL_COLORBAR_LABEL_LEFT ) ) { label_offset += 2.5; } // Draw a filled triangle (cap/arrow) at the low end of the scale - draw_cap( opt, x, y, length, width, 0.0 ); + draw_cap( opt, opt_position, x, y, length, width, 0.0 ); } else if ( opt & PL_COLORBAR_CAP_HIGH ) { // Add an extra offset for the label so it does not bump in to the // cap. - if ( ( ( opt & PL_COLORBAR_LEFT || opt & PL_COLORBAR_RIGHT ) && + if ( ( ( opt_position & PL_COLORBAR_LEFT || opt_position & PL_COLORBAR_RIGHT ) && opt & PL_COLORBAR_LABEL_UPPER ) || - ( ( opt & PL_COLORBAR_UPPER || opt & PL_COLORBAR_LOWER ) && + ( ( opt_position & PL_COLORBAR_UPPER || opt_position & PL_COLORBAR_LOWER ) && opt & PL_COLORBAR_LABEL_RIGHT ) ) { label_offset += 2.5; } // Draw a filled triangle (cap/arrow) at the high end of the scale - draw_cap( opt, x, y, length, width, 1.0 ); + draw_cap( opt, opt_position, x, y, length, width, 1.0 ); } // Smaller text @@ -1239,7 +1272,7 @@ char perp; if ( opt & PL_COLORBAR_LABEL_LEFT ) { - if ( opt & PL_COLORBAR_RIGHT || opt & PL_COLORBAR_LEFT ) + if ( opt_position & PL_COLORBAR_RIGHT || opt_position & PL_COLORBAR_LEFT ) { label_offset += 4.0; perp = '\0'; @@ -1254,7 +1287,7 @@ } else if ( opt & PL_COLORBAR_LABEL_RIGHT ) { - if ( opt & PL_COLORBAR_RIGHT || opt & PL_COLORBAR_LEFT ) + if ( opt_position & PL_COLORBAR_RIGHT || opt_position & PL_COLORBAR_LEFT ) { label_offset += 4.0; perp = '\0'; @@ -1269,7 +1302,7 @@ } else if ( opt & PL_COLORBAR_LABEL_UPPER ) { - if ( opt & PL_COLORBAR_RIGHT || opt & PL_COLORBAR_LEFT ) + if ( opt_position & PL_COLORBAR_RIGHT || opt_position & PL_COLORBAR_LEFT ) { label_offset += 1.5; perp = 'v'; @@ -1284,7 +1317,7 @@ } else if ( opt & PL_COLORBAR_LABEL_LOWER ) { - if ( opt & PL_COLORBAR_RIGHT || opt & PL_COLORBAR_LEFT ) + if ( opt_position & PL_COLORBAR_RIGHT || opt_position & PL_COLORBAR_LEFT ) { label_offset += 1.5; perp = 'v'; @@ -1304,22 +1337,22 @@ // along an axis. if ( opt & PL_COLORBAR_SHADE && opt & PL_COLORBAR_SHADE_LABEL ) { - if ( opt & PL_COLORBAR_LEFT ) + if ( opt_position & PL_COLORBAR_LEFT ) { snprintf( opt_string, max_opts, "nt%s", axis_opts ); label_box_custom( "", 0, NULL, opt_string, n_colors, values ); } - else if ( opt & PL_COLORBAR_RIGHT ) + else if ( opt_position & PL_COLORBAR_RIGHT ) { snprintf( opt_string, max_opts, "mt%s", axis_opts ); label_box_custom( "", 0, NULL, opt_string, n_colors, values ); } - else if ( opt & PL_COLORBAR_UPPER ) + else if ( opt_position & PL_COLORBAR_UPPER ) { snprintf( opt_string, max_opts, "mt%s", axis_opts ); label_box_custom( opt_string, n_colors, values, "", 0, NULL ); } - else if ( opt & PL_COLORBAR_LOWER ) + else if ( opt_position & PL_COLORBAR_LOWER ) { snprintf( opt_string, max_opts, "nt%s", axis_opts ); label_box_custom( opt_string, n_colors, values, "", 0, NULL ); @@ -1327,33 +1360,33 @@ } else { - if ( opt & PL_COLORBAR_LEFT || opt & PL_COLORBAR_LOWER ) + if ( opt_position & PL_COLORBAR_LEFT || opt_position & PL_COLORBAR_LOWER ) { tick_string = "n"; } - else if ( opt & PL_COLORBAR_RIGHT || opt & PL_COLORBAR_UPPER ) + else if ( opt_position & PL_COLORBAR_RIGHT || opt_position & PL_COLORBAR_UPPER ) { tick_string = "m"; } } // Draw the boxes, etc. - if ( opt & PL_COLORBAR_LEFT ) + if ( opt_position & PL_COLORBAR_LEFT ) { snprintf( opt_string, max_opts, "bc%s%s", tick_string, axis_opts ); plbox( "bc", ticks, sub_ticks, opt_string, ticks, sub_ticks ); } - else if ( opt & PL_COLORBAR_RIGHT ) + else if ( opt_position & PL_COLORBAR_RIGHT ) { snprintf( opt_string, max_opts, "bc%s%s", tick_string, axis_opts ); plbox( "bc", 0.0, 0, opt_string, ticks, sub_ticks ); } - else if ( opt & PL_COLORBAR_UPPER ) + else if ( opt_position & PL_COLORBAR_UPPER ) { snprintf( opt_string, max_opts, "bc%s%s", tick_string, axis_opts ); plbox( opt_string, ticks, sub_ticks, "bc", 0.0, 0 ); } - else if ( opt & PL_COLORBAR_LOWER ) + else if ( opt_position & PL_COLORBAR_LOWER ) { snprintf( opt_string, max_opts, "bc%s%s", tick_string, axis_opts ); plbox( opt_string, ticks, sub_ticks, "bc", 0.0, 0 ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hez...@us...> - 2011-01-29 17:11:33
|
Revision: 11524 http://plplot.svn.sourceforge.net/plplot/?rev=11524&view=rev Author: hezekiahcarty Date: 2011-01-29 17:11:27 +0000 (Sat, 29 Jan 2011) Log Message: ----------- Finish propagation of pllegend API changes to OCaml bindings and examples Modified Paths: -------------- trunk/bindings/ocaml/plplot.mli trunk/bindings/ocaml/plplot_core.idl trunk/bindings/ocaml/plplot_impl.c trunk/examples/ocaml/x04.ml trunk/examples/ocaml/x26.ml Modified: trunk/bindings/ocaml/plplot.mli =================================================================== --- trunk/bindings/ocaml/plplot.mli 2011-01-29 17:10:54 UTC (rev 11523) +++ trunk/bindings/ocaml/plplot.mli 2011-01-29 17:11:27 UTC (rev 11524) @@ -558,7 +558,7 @@ | PL_POSITION_OUTSIDE | PL_POSITION_VIEWPORT | PL_POSITION_SUBPAGE -and plplot_legend_position = plplot_position_enum list +and plplot_position_opt = plplot_position_enum list and plplot_legend_enum = PL_LEGEND_NONE | PL_LEGEND_COLOR_BOX @@ -695,7 +695,7 @@ float -> int -> int -> float -> int -> string -> string -> float array -> float array -> unit = "camlidl_plplot_core_c_plcolorbar_bytecode" "camlidl_plplot_core_c_plcolorbar" -external pllegend : plplot_legend_position -> plplot_legend_opt -> +external pllegend : plplot_position_opt -> plplot_legend_opt -> float -> float -> float -> int -> int -> int -> int -> int -> plplot_legend_opt array -> float -> float -> float -> float -> int array -> string array -> int array -> int array -> Modified: trunk/bindings/ocaml/plplot_core.idl =================================================================== --- trunk/bindings/ocaml/plplot_core.idl 2011-01-29 17:10:54 UTC (rev 11523) +++ trunk/bindings/ocaml/plplot_core.idl 2011-01-29 17:11:27 UTC (rev 11524) @@ -68,7 +68,7 @@ PL_POSITION_VIEWPORT = 64, PL_POSITION_SUBPAGE = 128, }; -typedef [set] enum plplot_position_enum plplot_legend_position; +typedef [set] enum plplot_position_enum plplot_position_opt; enum plplot_legend_enum { PL_LEGEND_NONE = 1, @@ -83,20 +83,16 @@ typedef [set] enum plplot_legend_enum plplot_legend_opt; enum plplot_colorbar_enum { - PL_COLORBAR_LEFT = 1, - PL_COLORBAR_RIGHT = 2, - PL_COLORBAR_UPPER = 4, - PL_COLORBAR_LOWER = 8, - PL_COLORBAR_LABEL_LEFT = 16, - PL_COLORBAR_LABEL_RIGHT = 32, - PL_COLORBAR_LABEL_UPPER = 64, - PL_COLORBAR_LABEL_LOWER = 128, - PL_COLORBAR_IMAGE = 256, - PL_COLORBAR_SHADE = 512, - PL_COLORBAR_GRADIENT = 1024, - PL_COLORBAR_CAP_LOW = 2048, - PL_COLORBAR_CAP_HIGH = 4096, - PL_COLORBAR_SHADE_LABEL = 8192, + PL_COLORBAR_LABEL_LEFT = 1, + PL_COLORBAR_LABEL_RIGHT = 2, + PL_COLORBAR_LABEL_UPPER = 4, + PL_COLORBAR_LABEL_LOWER = 8, + PL_COLORBAR_IMAGE = 16, + PL_COLORBAR_SHADE = 32, + PL_COLORBAR_GRADIENT = 64, + PL_COLORBAR_CAP_LOW = 128, + PL_COLORBAR_CAP_HIGH = 256, + PL_COLORBAR_SHADE_LABEL = 512, }; typedef [set] enum plplot_colorbar_enum plplot_colorbar_opt; @@ -295,5 +291,5 @@ RAW_ML(external plgriddata : float array -> float array -> float array -> float array -> float array -> plplot_grid_method_type -> float -> float array array = "ml_plgriddata_bytecode" "ml_plgriddata") RAW_ML(external plparseopts : string array -> plplot_parse_method_type list -> unit = "ml_plparseopts") -RAW_ML(external pllegend : plplot_legend_opt -> float -> float -> float -> int -> int -> int -> int -> int -> plplot_legend_opt array -> float -> float -> float -> float -> int array -> string array -> int array -> int array -> float array -> int array -> int array -> int array -> int array -> int array -> float array -> int array -> string array -> float * float = "ml_pllegend_byte" "ml_pllegend") +RAW_ML(external pllegend : plplot_position_opt -> plplot_legend_opt -> float -> float -> float -> int -> int -> int -> int -> int -> plplot_legend_opt array -> float -> float -> float -> float -> int array -> string array -> int array -> int array -> float array -> int array -> int array -> int array -> int array -> int array -> float array -> int array -> string array -> float * float = "ml_pllegend_byte" "ml_pllegend") Modified: trunk/bindings/ocaml/plplot_impl.c =================================================================== --- trunk/bindings/ocaml/plplot_impl.c 2011-01-29 17:10:54 UTC (rev 11523) +++ trunk/bindings/ocaml/plplot_impl.c 2011-01-29 17:11:27 UTC (rev 11524) @@ -748,18 +748,30 @@ case 5: translated_option = PL_LEGEND_BACKGROUND; break; case 6: translated_option = PL_LEGEND_BOUNDING_BOX; break; case 7: translated_option = PL_LEGEND_ROW_MAJOR; break; - case 8: translated_option = PL_LEGEND_LEFT; break; - case 9: translated_option = PL_LEGEND_RIGHT; break; - case 10: translated_option = PL_LEGEND_UPPER; break; - case 11: translated_option = PL_LEGEND_LOWER; break; - case 12: translated_option = PL_LEGEND_INSIDE; break; - case 13: translated_option = PL_LEGEND_OUTSIDE; break; default: translated_option = -1; } return translated_option; } -value ml_pllegend( value opt, value x, value y, value plot_width, +int translate_position_option( int position_option ) +{ + int translated_option; + switch ( position_option ) + { + case 0: translated_option = PL_POSITION_LEFT; break; + case 1: translated_option = PL_POSITION_RIGHT; break; + case 2: translated_option = PL_POSITION_UPPER; break; + case 3: translated_option = PL_POSITION_LOWER; break; + case 4: translated_option = PL_POSITION_INSIDE; break; + case 5: translated_option = PL_POSITION_OUTSIDE; break; + case 6: translated_option = PL_POSITION_VIEWPORT; break; + case 7: translated_option = PL_POSITION_SUBPAGE; break; + default: translated_option = -1; + } + return translated_option; +} + +value ml_pllegend( value position, value opt, value x, value y, value plot_width, value bg_color, value bb_color, value bb_style, value nrow, value ncolumn, @@ -772,21 +784,19 @@ value symbol_colors, value symbol_scales, value symbol_numbers, value symbols ) { - CAMLparam5( opt, x, y, plot_width, bg_color ); - CAMLxparam5( bb_color, bb_style, nrow, ncolumn, opt_array ); - CAMLxparam5( text_offset, text_scale, text_spacing, text_justification, - text_colors ); - CAMLxparam5( text, box_colors, box_patterns, box_scales, box_line_widths ); - CAMLxparam5( line_colors, line_styles, line_widths, symbol_colors, - symbol_scales ); - CAMLxparam2( symbol_numbers, symbols ); + CAMLparam5( position, opt, x, y, plot_width ); + CAMLxparam5( bg_color, bb_color, bb_style, nrow, ncolumn ); + CAMLxparam5( opt_array, text_offset, text_scale, text_spacing, text_justification ); + CAMLxparam5( text_colors, text, box_colors, box_patterns, box_scales ); + CAMLxparam5( box_line_widths, line_colors, line_styles, line_widths, symbol_colors ); + CAMLxparam3( symbol_scales, symbol_numbers, symbols ); CAMLlocal1( result ); result = caml_alloc( 2, 0 ); // Counter int i; // General legend options - int c_opt; + int c_position, c_opt; // Number of legend entries int n_legend; n_legend = Wosize_val( opt_array ); @@ -811,6 +821,7 @@ // Translate the legend configuration options c_opt = lor_ml_list( opt, translate_legend_option ); + c_position = lor_ml_list( position, translate_position_option ); for ( i = 0; i < n_legend; i++ ) { @@ -821,7 +832,7 @@ // The returned width and height of the legend PLFLT width, height; - pllegend( &width, &height, c_opt, Double_val( x ), Double_val( y ), + pllegend( &width, &height, c_position, c_opt, Double_val( x ), Double_val( y ), Double_val( plot_width ), Int_val( bg_color ), Int_val( bb_color ), Int_val( bb_style ), Int_val( nrow ), Int_val( ncolumn ), @@ -850,7 +861,7 @@ argv[10], argv[11], argv[12], argv[13], argv[14], argv[15], argv[16], argv[17], argv[18], argv[19], argv[20], argv[21], argv[22], argv[23], argv[24], - argv[25], argv[26] ); + argv[25], argv[26], argv[27] ); } // pltr* function implementations Modified: trunk/examples/ocaml/x04.ml =================================================================== --- trunk/examples/ocaml/x04.ml 2011-01-29 17:10:54 UTC (rev 11523) +++ trunk/examples/ocaml/x04.ml 2011-01-29 17:11:27 UTC (rev 11524) @@ -88,7 +88,7 @@ plscol0a 15 32 32 32 0.70; ignore ( - pllegend [PL_LEGEND_BACKGROUND; PL_LEGEND_BOUNDING_BOX] + pllegend [] [PL_LEGEND_BACKGROUND; PL_LEGEND_BOUNDING_BOX] 0.0 0.0 0.1 15 1 1 0 0 opt_array @@ -117,7 +117,7 @@ plscol0a 15 32 32 32 0.70; ignore ( - pllegend [PL_LEGEND_BACKGROUND; PL_LEGEND_BOUNDING_BOX] + pllegend [] [PL_LEGEND_BACKGROUND; PL_LEGEND_BOUNDING_BOX] 0.0 0.0 0.1 15 1 1 0 0 opt_array Modified: trunk/examples/ocaml/x26.ml =================================================================== --- trunk/examples/ocaml/x26.ml 2011-01-29 17:10:54 UTC (rev 11523) +++ trunk/examples/ocaml/x26.ml 2011-01-29 17:11:27 UTC (rev 11524) @@ -183,7 +183,7 @@ plscol0a 15 32 32 32 0.70; let _, _ = - pllegend [PL_LEGEND_BACKGROUND; PL_LEGEND_BOUNDING_BOX] + pllegend [] [PL_LEGEND_BACKGROUND; PL_LEGEND_BOUNDING_BOX] 0.0 0.0 0.10 15 1 1 0 0 opt_array This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hez...@us...> - 2011-01-29 17:12:06
|
Revision: 11525 http://plplot.svn.sourceforge.net/plplot/?rev=11525&view=rev Author: hezekiahcarty Date: 2011-01-29 17:12:00 +0000 (Sat, 29 Jan 2011) Log Message: ----------- Use the proper PL_POSITION_* values for plcolorbar positioning This will likely be replaced by Alan's positioning fixes, but it compiles and functions for now. Modified Paths: -------------- trunk/include/plplot.h trunk/src/pllegend.c Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2011-01-29 17:11:27 UTC (rev 11524) +++ trunk/include/plplot.h 2011-01-29 17:12:00 UTC (rev 11525) @@ -1230,20 +1230,16 @@ #define PL_LEGEND_ROW_MAJOR 128 // Flags for plcolorbar -#define PL_COLORBAR_LEFT 1 -#define PL_COLORBAR_RIGHT 2 -#define PL_COLORBAR_UPPER 4 -#define PL_COLORBAR_LOWER 8 -#define PL_COLORBAR_LABEL_LEFT 16 -#define PL_COLORBAR_LABEL_RIGHT 32 -#define PL_COLORBAR_LABEL_UPPER 64 -#define PL_COLORBAR_LABEL_LOWER 128 -#define PL_COLORBAR_IMAGE 256 -#define PL_COLORBAR_SHADE 512 -#define PL_COLORBAR_GRADIENT 1024 -#define PL_COLORBAR_CAP_LOW 2048 -#define PL_COLORBAR_CAP_HIGH 4096 -#define PL_COLORBAR_SHADE_LABEL 8192 +#define PL_COLORBAR_LABEL_LEFT 1 +#define PL_COLORBAR_LABEL_RIGHT 2 +#define PL_COLORBAR_LABEL_UPPER 4 +#define PL_COLORBAR_LABEL_LOWER 8 +#define PL_COLORBAR_IMAGE 16 +#define PL_COLORBAR_SHADE 32 +#define PL_COLORBAR_GRADIENT 64 +#define PL_COLORBAR_CAP_LOW 128 +#define PL_COLORBAR_CAP_HIGH 256 +#define PL_COLORBAR_SHADE_LABEL 512 // Routine for drawing discrete line, symbol, or cmap0 legends PLDLLIMPEXP void Modified: trunk/src/pllegend.c =================================================================== --- trunk/src/pllegend.c 2011-01-29 17:11:27 UTC (rev 11524) +++ trunk/src/pllegend.c 2011-01-29 17:12:00 UTC (rev 11525) @@ -842,12 +842,12 @@ if ( opt & PL_COLORBAR_CAP_LOW ) { - if ( opt_position & PL_COLORBAR_LEFT || opt_position & PL_COLORBAR_RIGHT ) + if ( opt_position & PL_POSITION_LEFT || opt_position & PL_POSITION_RIGHT ) { // Draw the cap on the bottom - if ( opt_position & PL_COLORBAR_LEFT ) + if ( opt_position & PL_POSITION_LEFT ) xs[0] = x; - else if ( opt_position & PL_COLORBAR_RIGHT ) + else if ( opt_position & PL_POSITION_RIGHT ) xs[0] = 1.0 - x - width; ys[0] = y; xs[2] = xs[0] + width; @@ -857,13 +857,13 @@ plfill( 3, xs, ys ); } - else if ( opt_position & PL_COLORBAR_UPPER || opt_position & PL_COLORBAR_LOWER ) + else if ( opt_position & PL_POSITION_UPPER || opt_position & PL_POSITION_LOWER ) { // Draw the cap on the left xs[0] = x; - if ( opt_position & PL_COLORBAR_UPPER ) + if ( opt_position & PL_POSITION_UPPER ) ys[0] = 1.0 - y - width; - else if ( opt_position & PL_COLORBAR_LOWER ) + else if ( opt_position & PL_POSITION_LOWER ) ys[0] = y; xs[2] = xs[0]; ys[2] = ys[0] + width; @@ -875,12 +875,12 @@ } else if ( opt & PL_COLORBAR_CAP_HIGH ) { - if ( opt_position & PL_COLORBAR_LEFT || opt_position & PL_COLORBAR_RIGHT ) + if ( opt_position & PL_POSITION_LEFT || opt_position & PL_POSITION_RIGHT ) { // Draw the cap on the top - if ( opt_position & PL_COLORBAR_LEFT ) + if ( opt_position & PL_POSITION_LEFT ) xs[0] = x; - else if ( opt_position & PL_COLORBAR_RIGHT ) + else if ( opt_position & PL_POSITION_RIGHT ) xs[0] = 1.0 - x - width; ys[0] = y + length; xs[2] = xs[0] + width; @@ -890,13 +890,13 @@ plfill( 3, xs, ys ); } - else if ( opt_position & PL_COLORBAR_UPPER || opt_position & PL_COLORBAR_LOWER ) + else if ( opt_position & PL_POSITION_UPPER || opt_position & PL_POSITION_LOWER ) { // Draw the cap on the right xs[0] = x + length; - if ( opt_position & PL_COLORBAR_UPPER ) + if ( opt_position & PL_POSITION_UPPER ) ys[0] = 1.0 - y - width; - else if ( opt_position & PL_COLORBAR_LOWER ) + else if ( opt_position & PL_POSITION_LOWER ) ys[0] = y; xs[2] = xs[0]; ys[2] = ys[0] + width; @@ -979,7 +979,7 @@ PLFLT vx_min, vx_max, vy_min, vy_max; PLFLT wx_min, wx_max, wy_min, wy_max; // Build the proper viewport and window dimensions - if ( opt_position & PL_COLORBAR_LEFT ) + if ( opt_position & PL_POSITION_LEFT ) { vx_min = x; vy_min = y; @@ -990,7 +990,7 @@ wx_max = 1.0; wy_max = max_value; } - else if ( opt_position & PL_COLORBAR_RIGHT ) + else if ( opt_position & PL_POSITION_RIGHT ) { vx_min = 1.0 - x - width; vy_min = y; @@ -1001,7 +1001,7 @@ wx_max = 1.0; wy_max = max_value; } - else if ( opt_position & PL_COLORBAR_UPPER ) + else if ( opt_position & PL_POSITION_UPPER ) { vx_min = x; vy_min = 1.0 - y - width; @@ -1012,7 +1012,7 @@ wx_max = max_value; wy_max = 1.0; } - else if ( opt_position & PL_COLORBAR_LOWER ) + else if ( opt_position & PL_POSITION_LOWER ) { vx_min = x; vy_min = y; @@ -1051,7 +1051,7 @@ // TODO: Determine a better way to specify the steps here? n_steps = plsc->ncol1; step_size = ( max_value - min_value ) / (PLFLT) n_steps; - if ( opt_position & PL_COLORBAR_LEFT || opt_position & PL_COLORBAR_RIGHT ) + if ( opt_position & PL_POSITION_LEFT || opt_position & PL_POSITION_RIGHT ) { ni = 2; nj = n_steps; @@ -1064,7 +1064,7 @@ } } } - else if ( opt_position & PL_COLORBAR_UPPER || opt_position & PL_COLORBAR_LOWER ) + else if ( opt_position & PL_POSITION_UPPER || opt_position & PL_POSITION_LOWER ) { ni = n_steps; nj = 2; @@ -1087,7 +1087,7 @@ { n_steps = n_colors; // Use the provided values in this case. - if ( opt_position & PL_COLORBAR_LEFT || opt_position & PL_COLORBAR_RIGHT ) + if ( opt_position & PL_POSITION_LEFT || opt_position & PL_POSITION_RIGHT ) { ni = 2; nj = n_steps; @@ -1100,7 +1100,7 @@ } } } - else if ( opt_position & PL_COLORBAR_UPPER || opt_position & PL_COLORBAR_LOWER ) + else if ( opt_position & PL_POSITION_UPPER || opt_position & PL_POSITION_LOWER ) { ni = n_steps; nj = 2; @@ -1146,7 +1146,7 @@ } } // Use the provided values. - if ( opt_position & PL_COLORBAR_LEFT || opt_position & PL_COLORBAR_RIGHT ) + if ( opt_position & PL_POSITION_LEFT || opt_position & PL_POSITION_RIGHT ) { grid.xg = grid_axis; grid.yg = values_ext; @@ -1163,7 +1163,7 @@ } } } - else if ( opt_position & PL_COLORBAR_UPPER || opt_position & PL_COLORBAR_LOWER ) + else if ( opt_position & PL_POSITION_UPPER || opt_position & PL_POSITION_LOWER ) { grid.xg = values_ext; grid.yg = grid_axis; @@ -1203,11 +1203,11 @@ xs[3] = wx_min; ys[3] = wy_max; PLFLT angle; - if ( opt_position & PL_COLORBAR_LEFT || opt_position & PL_COLORBAR_RIGHT ) + if ( opt_position & PL_POSITION_LEFT || opt_position & PL_POSITION_RIGHT ) { angle = 90.0; } - else if ( opt_position & PL_COLORBAR_UPPER || opt_position & PL_COLORBAR_LOWER ) + else if ( opt_position & PL_POSITION_UPPER || opt_position & PL_POSITION_LOWER ) { angle = 0.0; } @@ -1230,9 +1230,9 @@ { // Add an extra offset for the label so it does not bump in to the // cap. - if ( ( ( opt_position & PL_COLORBAR_LEFT || opt_position & PL_COLORBAR_RIGHT ) && + if ( ( ( opt_position & PL_POSITION_LEFT || opt_position & PL_POSITION_RIGHT ) && opt & PL_COLORBAR_LABEL_LOWER ) || - ( ( opt_position & PL_COLORBAR_UPPER || opt_position & PL_COLORBAR_LOWER ) && + ( ( opt_position & PL_POSITION_UPPER || opt_position & PL_POSITION_LOWER ) && opt & PL_COLORBAR_LABEL_LEFT ) ) { label_offset += 2.5; @@ -1244,9 +1244,9 @@ { // Add an extra offset for the label so it does not bump in to the // cap. - if ( ( ( opt_position & PL_COLORBAR_LEFT || opt_position & PL_COLORBAR_RIGHT ) && + if ( ( ( opt_position & PL_POSITION_LEFT || opt_position & PL_POSITION_RIGHT ) && opt & PL_COLORBAR_LABEL_UPPER ) || - ( ( opt_position & PL_COLORBAR_UPPER || opt_position & PL_COLORBAR_LOWER ) && + ( ( opt_position & PL_POSITION_UPPER || opt_position & PL_POSITION_LOWER ) && opt & PL_COLORBAR_LABEL_RIGHT ) ) { label_offset += 2.5; @@ -1272,7 +1272,7 @@ char perp; if ( opt & PL_COLORBAR_LABEL_LEFT ) { - if ( opt_position & PL_COLORBAR_RIGHT || opt_position & PL_COLORBAR_LEFT ) + if ( opt_position & PL_POSITION_RIGHT || opt_position & PL_POSITION_LEFT ) { label_offset += 4.0; perp = '\0'; @@ -1287,7 +1287,7 @@ } else if ( opt & PL_COLORBAR_LABEL_RIGHT ) { - if ( opt_position & PL_COLORBAR_RIGHT || opt_position & PL_COLORBAR_LEFT ) + if ( opt_position & PL_POSITION_RIGHT || opt_position & PL_POSITION_LEFT ) { label_offset += 4.0; perp = '\0'; @@ -1302,7 +1302,7 @@ } else if ( opt & PL_COLORBAR_LABEL_UPPER ) { - if ( opt_position & PL_COLORBAR_RIGHT || opt_position & PL_COLORBAR_LEFT ) + if ( opt_position & PL_POSITION_RIGHT || opt_position & PL_POSITION_LEFT ) { label_offset += 1.5; perp = 'v'; @@ -1317,7 +1317,7 @@ } else if ( opt & PL_COLORBAR_LABEL_LOWER ) { - if ( opt_position & PL_COLORBAR_RIGHT || opt_position & PL_COLORBAR_LEFT ) + if ( opt_position & PL_POSITION_RIGHT || opt_position & PL_POSITION_LEFT ) { label_offset += 1.5; perp = 'v'; @@ -1337,22 +1337,22 @@ // along an axis. if ( opt & PL_COLORBAR_SHADE && opt & PL_COLORBAR_SHADE_LABEL ) { - if ( opt_position & PL_COLORBAR_LEFT ) + if ( opt_position & PL_POSITION_LEFT ) { snprintf( opt_string, max_opts, "nt%s", axis_opts ); label_box_custom( "", 0, NULL, opt_string, n_colors, values ); } - else if ( opt_position & PL_COLORBAR_RIGHT ) + else if ( opt_position & PL_POSITION_RIGHT ) { snprintf( opt_string, max_opts, "mt%s", axis_opts ); label_box_custom( "", 0, NULL, opt_string, n_colors, values ); } - else if ( opt_position & PL_COLORBAR_UPPER ) + else if ( opt_position & PL_POSITION_UPPER ) { snprintf( opt_string, max_opts, "mt%s", axis_opts ); label_box_custom( opt_string, n_colors, values, "", 0, NULL ); } - else if ( opt_position & PL_COLORBAR_LOWER ) + else if ( opt_position & PL_POSITION_LOWER ) { snprintf( opt_string, max_opts, "nt%s", axis_opts ); label_box_custom( opt_string, n_colors, values, "", 0, NULL ); @@ -1360,33 +1360,33 @@ } else { - if ( opt_position & PL_COLORBAR_LEFT || opt_position & PL_COLORBAR_LOWER ) + if ( opt_position & PL_POSITION_LEFT || opt_position & PL_POSITION_LOWER ) { tick_string = "n"; } - else if ( opt_position & PL_COLORBAR_RIGHT || opt_position & PL_COLORBAR_UPPER ) + else if ( opt_position & PL_POSITION_RIGHT || opt_position & PL_POSITION_UPPER ) { tick_string = "m"; } } // Draw the boxes, etc. - if ( opt_position & PL_COLORBAR_LEFT ) + if ( opt_position & PL_POSITION_LEFT ) { snprintf( opt_string, max_opts, "bc%s%s", tick_string, axis_opts ); plbox( "bc", ticks, sub_ticks, opt_string, ticks, sub_ticks ); } - else if ( opt_position & PL_COLORBAR_RIGHT ) + else if ( opt_position & PL_POSITION_RIGHT ) { snprintf( opt_string, max_opts, "bc%s%s", tick_string, axis_opts ); plbox( "bc", 0.0, 0, opt_string, ticks, sub_ticks ); } - else if ( opt_position & PL_COLORBAR_UPPER ) + else if ( opt_position & PL_POSITION_UPPER ) { snprintf( opt_string, max_opts, "bc%s%s", tick_string, axis_opts ); plbox( opt_string, ticks, sub_ticks, "bc", 0.0, 0 ); } - else if ( opt_position & PL_COLORBAR_LOWER ) + else if ( opt_position & PL_POSITION_LOWER ) { snprintf( opt_string, max_opts, "bc%s%s", tick_string, axis_opts ); plbox( opt_string, ticks, sub_ticks, "bc", 0.0, 0 ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-01-29 20:32:59
|
Revision: 11531 http://plplot.svn.sourceforge.net/plplot/?rev=11531&view=rev Author: airwin Date: 2011-01-29 20:32:52 +0000 (Sat, 29 Jan 2011) Log Message: ----------- At Hez's request globally change PL_POSITION_UPPER ==> PL_POSITION_TOP and PL_POSITION_LOWER ==> PL_POSITION_BOTTOM. This global change was done with a one-line bash command involving find, xargs, grep, and sed. "svn diff" gives reasonable looking results, but I haven't been able to test it yet because Hez's recent plcolorbar changes have broken the build in a number of places (those issues are next on my agenda). Modified Paths: -------------- trunk/bindings/f77/plplot_parameters.fm4 trunk/bindings/f95/plplot_parameters.h trunk/bindings/ocaml/plplot.mli trunk/bindings/ocaml/plplot_core.idl trunk/bindings/ocaml/plplot_impl.c trunk/bindings/swig-support/plplotcapi.i trunk/examples/c/x33c.c trunk/examples/c++/x33.cc trunk/examples/f77/x33f.fm4 trunk/examples/java/x33.java trunk/examples/octave/x33c.m trunk/examples/python/xw33.py trunk/include/plplot.h trunk/src/pllegend.c Modified: trunk/bindings/f77/plplot_parameters.fm4 =================================================================== --- trunk/bindings/f77/plplot_parameters.fm4 2011-01-29 20:00:28 UTC (rev 11530) +++ trunk/bindings/f77/plplot_parameters.fm4 2011-01-29 20:32:52 UTC (rev 11531) @@ -84,10 +84,10 @@ parameter (PL_POSITION_LEFT = 1) integer*4 PL_POSITION_RIGHT parameter (PL_POSITION_RIGHT = 2) - integer*4 PL_POSITION_UPPER - parameter (PL_POSITION_UPPER = 4) - integer*4 PL_POSITION_LOWER - parameter (PL_POSITION_LOWER = 8) + integer*4 PL_POSITION_TOP + parameter (PL_POSITION_TOP = 4) + integer*4 PL_POSITION_BOTTOM + parameter (PL_POSITION_BOTTOM = 8) integer*4 PL_POSITION_INSIDE parameter (PL_POSITION_INSIDE = 16) integer*4 PL_POSITION_OUTSIDE Modified: trunk/bindings/f95/plplot_parameters.h =================================================================== --- trunk/bindings/f95/plplot_parameters.h 2011-01-29 20:00:28 UTC (rev 11530) +++ trunk/bindings/f95/plplot_parameters.h 2011-01-29 20:32:52 UTC (rev 11531) @@ -41,8 +41,8 @@ integer, parameter :: PL_HIST_NOEMPTY = 16 integer, parameter :: PL_POSITION_LEFT = 1 integer, parameter :: PL_POSITION_RIGHT = 2 - integer, parameter :: PL_POSITION_UPPER = 4 - integer, parameter :: PL_POSITION_LOWER = 8 + integer, parameter :: PL_POSITION_TOP = 4 + integer, parameter :: PL_POSITION_BOTTOM = 8 integer, parameter :: PL_POSITION_INSIDE = 16 integer, parameter :: PL_POSITION_OUTSIDE = 32 integer, parameter :: PL_POSITION_VIEWPORT = 64 Modified: trunk/bindings/ocaml/plplot.mli =================================================================== --- trunk/bindings/ocaml/plplot.mli 2011-01-29 20:00:28 UTC (rev 11530) +++ trunk/bindings/ocaml/plplot.mli 2011-01-29 20:32:52 UTC (rev 11531) @@ -552,8 +552,8 @@ and plplot_position_enum = PL_POSITION_LEFT | PL_POSITION_RIGHT - | PL_POSITION_UPPER - | PL_POSITION_LOWER + | PL_POSITION_TOP + | PL_POSITION_BOTTOM | PL_POSITION_INSIDE | PL_POSITION_OUTSIDE | PL_POSITION_VIEWPORT Modified: trunk/bindings/ocaml/plplot_core.idl =================================================================== --- trunk/bindings/ocaml/plplot_core.idl 2011-01-29 20:00:28 UTC (rev 11530) +++ trunk/bindings/ocaml/plplot_core.idl 2011-01-29 20:32:52 UTC (rev 11531) @@ -61,8 +61,8 @@ enum plplot_position_enum { PL_POSITION_LEFT = 1, PL_POSITION_RIGHT = 2, - PL_POSITION_UPPER = 4, - PL_POSITION_LOWER = 8, + PL_POSITION_TOP = 4, + PL_POSITION_BOTTOM = 8, PL_POSITION_INSIDE = 16, PL_POSITION_OUTSIDE = 32, PL_POSITION_VIEWPORT = 64, Modified: trunk/bindings/ocaml/plplot_impl.c =================================================================== --- trunk/bindings/ocaml/plplot_impl.c 2011-01-29 20:00:28 UTC (rev 11530) +++ trunk/bindings/ocaml/plplot_impl.c 2011-01-29 20:32:52 UTC (rev 11531) @@ -760,8 +760,8 @@ { case 0: translated_option = PL_POSITION_LEFT; break; case 1: translated_option = PL_POSITION_RIGHT; break; - case 2: translated_option = PL_POSITION_UPPER; break; - case 3: translated_option = PL_POSITION_LOWER; break; + case 2: translated_option = PL_POSITION_TOP; break; + case 3: translated_option = PL_POSITION_BOTTOM; break; case 4: translated_option = PL_POSITION_INSIDE; break; case 5: translated_option = PL_POSITION_OUTSIDE; break; case 6: translated_option = PL_POSITION_VIEWPORT; break; Modified: trunk/bindings/swig-support/plplotcapi.i =================================================================== --- trunk/bindings/swig-support/plplotcapi.i 2011-01-29 20:00:28 UTC (rev 11530) +++ trunk/bindings/swig-support/plplotcapi.i 2011-01-29 20:32:52 UTC (rev 11531) @@ -98,8 +98,8 @@ //flags used for position argument of both pllegend and plcolorbar #define PL_POSITION_LEFT 1 #define PL_POSITION_RIGHT 2 -#define PL_POSITION_UPPER 4 -#define PL_POSITION_LOWER 8 +#define PL_POSITION_TOP 4 +#define PL_POSITION_BOTTOM 8 #define PL_POSITION_INSIDE 16 #define PL_POSITION_OUTSIDE 32 #define PL_POSITION_VIEWPORT 64 Modified: trunk/examples/c/x33c.c =================================================================== --- trunk/examples/c/x33c.c 2011-01-29 20:00:28 UTC (rev 11530) +++ trunk/examples/c/x33c.c 2011-01-29 20:32:52 UTC (rev 11531) @@ -33,21 +33,21 @@ #include "plcdemos.h" static PLINT position_options[16] = { - PL_POSITION_LEFT | PL_POSITION_UPPER | PL_POSITION_OUTSIDE, - PL_POSITION_UPPER | PL_POSITION_OUTSIDE, - PL_POSITION_RIGHT | PL_POSITION_UPPER | PL_POSITION_OUTSIDE, + PL_POSITION_LEFT | PL_POSITION_TOP | PL_POSITION_OUTSIDE, + PL_POSITION_TOP | PL_POSITION_OUTSIDE, + PL_POSITION_RIGHT | PL_POSITION_TOP | PL_POSITION_OUTSIDE, PL_POSITION_RIGHT | PL_POSITION_OUTSIDE, - PL_POSITION_RIGHT | PL_POSITION_LOWER | PL_POSITION_OUTSIDE, - PL_POSITION_LOWER | PL_POSITION_OUTSIDE, - PL_POSITION_LEFT | PL_POSITION_LOWER | PL_POSITION_OUTSIDE, + PL_POSITION_RIGHT | PL_POSITION_BOTTOM | PL_POSITION_OUTSIDE, + PL_POSITION_BOTTOM | PL_POSITION_OUTSIDE, + PL_POSITION_LEFT | PL_POSITION_BOTTOM | PL_POSITION_OUTSIDE, PL_POSITION_LEFT | PL_POSITION_OUTSIDE, - PL_POSITION_LEFT | PL_POSITION_UPPER | PL_POSITION_INSIDE, - PL_POSITION_UPPER | PL_POSITION_INSIDE, - PL_POSITION_RIGHT | PL_POSITION_UPPER | PL_POSITION_INSIDE, + PL_POSITION_LEFT | PL_POSITION_TOP | PL_POSITION_INSIDE, + PL_POSITION_TOP | PL_POSITION_INSIDE, + PL_POSITION_RIGHT | PL_POSITION_TOP | PL_POSITION_INSIDE, PL_POSITION_RIGHT | PL_POSITION_INSIDE, - PL_POSITION_RIGHT | PL_POSITION_LOWER | PL_POSITION_INSIDE, - PL_POSITION_LOWER | PL_POSITION_INSIDE, - PL_POSITION_LEFT | PL_POSITION_LOWER | PL_POSITION_INSIDE, + PL_POSITION_RIGHT | PL_POSITION_BOTTOM | PL_POSITION_INSIDE, + PL_POSITION_BOTTOM | PL_POSITION_INSIDE, + PL_POSITION_LEFT | PL_POSITION_BOTTOM | PL_POSITION_INSIDE, PL_POSITION_LEFT | PL_POSITION_INSIDE }; @@ -77,7 +77,7 @@ } PLINT opt, opt_position; - opt = bar_type | PL_COLORBAR_LABEL_LEFT | PL_COLORBAR_CAP_HIGH; + opt = bar_type | PL_COLORBAR_LABEL_LEFT | PL_COLORBAR_CAP_HIGH; opt_position = PL_POSITION_LEFT; const char *axis_opts_1, *axis_opts_2; @@ -106,7 +106,7 @@ axis_opts_1, "Test label - Left, High Cap", n, colors, values ); - opt = bar_type | PL_COLORBAR_LABEL_RIGHT | PL_COLORBAR_CAP_LOW; + opt = bar_type | PL_COLORBAR_LABEL_RIGHT | PL_COLORBAR_CAP_LOW; opt_position = PL_POSITION_RIGHT; plcolorbar( opt, opt_position, 0.1, 0.4, 0.5, 0.1, @@ -115,8 +115,8 @@ axis_opts_1, "Test label - Right, Low Cap", n, colors, values ); - opt = bar_type | PL_COLORBAR_LABEL_UPPER | PL_COLORBAR_CAP_HIGH; - opt_position = PL_POSITION_UPPER; + opt = bar_type | PL_COLORBAR_LABEL_UPPER | PL_COLORBAR_CAP_HIGH; + opt_position = PL_POSITION_TOP; plcolorbar( opt, opt_position, 0.1, 0.1, 0.5, 0.1, cont_color, cont_width, @@ -124,8 +124,8 @@ axis_opts_2, "Test label - Upper, High Cap", n, colors, values ); - opt = bar_type | PL_COLORBAR_LABEL_LOWER | PL_COLORBAR_CAP_LOW; - opt_position = PL_POSITION_LOWER; + opt = bar_type | PL_COLORBAR_LABEL_LOWER | PL_COLORBAR_CAP_LOW; + opt_position = PL_POSITION_BOTTOM; plcolorbar( opt, opt_position, 0.4, 0.1, 0.5, 0.1, cont_color, cont_width, @@ -167,7 +167,7 @@ } PLINT opt, opt_position; - opt = bar_type | PL_COLORBAR_LABEL_LEFT | PL_COLORBAR_CAP_LOW; + opt = bar_type | PL_COLORBAR_LABEL_LEFT | PL_COLORBAR_CAP_LOW; opt_position = PL_POSITION_LEFT; const char *axis_opts_1, *axis_opts_2; @@ -196,7 +196,7 @@ axis_opts_1, "Test label - Left, Low Cap", n, colors, values ); - opt = bar_type | PL_COLORBAR_LABEL_RIGHT | PL_COLORBAR_CAP_HIGH; + opt = bar_type | PL_COLORBAR_LABEL_RIGHT | PL_COLORBAR_CAP_HIGH; opt_position = PL_POSITION_RIGHT; plcolorbar( opt, opt_position, 0.1, 0.4, 0.5, 0.1, @@ -205,8 +205,8 @@ axis_opts_1, "Test label - Right, High Cap", n, colors, values ); - opt = bar_type | PL_COLORBAR_LABEL_UPPER | PL_COLORBAR_CAP_LOW; - opt_position = PL_POSITION_UPPER; + opt = bar_type | PL_COLORBAR_LABEL_UPPER | PL_COLORBAR_CAP_LOW; + opt_position = PL_POSITION_TOP; plcolorbar( opt, opt_position, 0.1, 0.1, 0.5, 0.1, cont_color, cont_width, @@ -214,8 +214,8 @@ axis_opts_2, "Test label - Upper, Low Cap", n, colors, values ); - opt = bar_type | PL_COLORBAR_LABEL_LOWER | PL_COLORBAR_CAP_HIGH; - opt_position = PL_POSITION_LOWER; + opt = bar_type | PL_COLORBAR_LABEL_LOWER | PL_COLORBAR_CAP_HIGH; + opt_position = PL_POSITION_BOTTOM; plcolorbar( opt, opt_position, 0.4, 0.1, 0.5, 0.1, cont_color, cont_width, @@ -343,7 +343,7 @@ plsfont( PL_FCI_MONO, -1, -1 ); plscol0a( 15, 32, 32, 32, 0.70 ); - position = PL_POSITION_UPPER | PL_POSITION_OUTSIDE; + position = PL_POSITION_TOP | PL_POSITION_OUTSIDE; opt = opt_base; x = 0.; y = 0.1; @@ -357,7 +357,7 @@ line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); - position = PL_POSITION_LOWER | PL_POSITION_OUTSIDE; + position = PL_POSITION_BOTTOM | PL_POSITION_OUTSIDE; opt = opt_base; x = 0.; y = 0.1; @@ -399,7 +399,7 @@ line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); - position = PL_POSITION_LEFT | PL_POSITION_UPPER | PL_POSITION_INSIDE; + position = PL_POSITION_LEFT | PL_POSITION_TOP | PL_POSITION_INSIDE; opt = opt_base; x = 0.; y = 0.; @@ -413,7 +413,7 @@ line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); - position = PL_POSITION_RIGHT | PL_POSITION_UPPER | PL_POSITION_INSIDE; + position = PL_POSITION_RIGHT | PL_POSITION_TOP | PL_POSITION_INSIDE; opt = opt_base | PL_LEGEND_ROW_MAJOR; x = 0.; y = 0.; @@ -427,7 +427,7 @@ line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); - position = PL_POSITION_LOWER | PL_POSITION_INSIDE; + position = PL_POSITION_BOTTOM | PL_POSITION_INSIDE; opt = opt_base | PL_LEGEND_ROW_MAJOR; x = 0.; y = 0.; @@ -452,7 +452,7 @@ y = 0.1; nturn = 4; nlegend = 0; - position = PL_POSITION_UPPER | PL_POSITION_LEFT; + position = PL_POSITION_TOP | PL_POSITION_LEFT; opt_base = PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX; opt = opt_base; for ( i = 0; i < 9; i++ ) @@ -495,7 +495,7 @@ if ( i == nturn ) { - position = PL_POSITION_UPPER | PL_POSITION_RIGHT; + position = PL_POSITION_TOP | PL_POSITION_RIGHT; opt = opt_base; x = 1. - x; y += legend_height; @@ -524,7 +524,7 @@ nlegend = 5; // Only specify legend data that are required according to the // value of opt_array for that entry. - position = PL_POSITION_LEFT | PL_POSITION_UPPER; + position = PL_POSITION_LEFT | PL_POSITION_TOP; opt_base = PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX | PL_LEGEND_TEXT_LEFT; // Set up None, Box, Line, Symbol, and Line & Symbol legend entries. Modified: trunk/examples/c++/x33.cc =================================================================== --- trunk/examples/c++/x33.cc 2011-01-29 20:00:28 UTC (rev 11530) +++ trunk/examples/c++/x33.cc 2011-01-29 20:32:52 UTC (rev 11531) @@ -56,21 +56,21 @@ }; const PLINT x33::position_options[16] = { - PL_POSITION_LEFT | PL_POSITION_UPPER | PL_POSITION_OUTSIDE, - PL_POSITION_UPPER | PL_POSITION_OUTSIDE, - PL_POSITION_RIGHT | PL_POSITION_UPPER | PL_POSITION_OUTSIDE, + PL_POSITION_LEFT | PL_POSITION_TOP | PL_POSITION_OUTSIDE, + PL_POSITION_TOP | PL_POSITION_OUTSIDE, + PL_POSITION_RIGHT | PL_POSITION_TOP | PL_POSITION_OUTSIDE, PL_POSITION_RIGHT | PL_POSITION_OUTSIDE, - PL_POSITION_RIGHT | PL_POSITION_LOWER | PL_POSITION_OUTSIDE, - PL_POSITION_LOWER | PL_POSITION_OUTSIDE, - PL_POSITION_LEFT | PL_POSITION_LOWER | PL_POSITION_OUTSIDE, + PL_POSITION_RIGHT | PL_POSITION_BOTTOM | PL_POSITION_OUTSIDE, + PL_POSITION_BOTTOM | PL_POSITION_OUTSIDE, + PL_POSITION_LEFT | PL_POSITION_BOTTOM | PL_POSITION_OUTSIDE, PL_POSITION_LEFT | PL_POSITION_OUTSIDE, - PL_POSITION_LEFT | PL_POSITION_UPPER | PL_POSITION_INSIDE, - PL_POSITION_UPPER | PL_POSITION_INSIDE, - PL_POSITION_RIGHT | PL_POSITION_UPPER | PL_POSITION_INSIDE, + PL_POSITION_LEFT | PL_POSITION_TOP | PL_POSITION_INSIDE, + PL_POSITION_TOP | PL_POSITION_INSIDE, + PL_POSITION_RIGHT | PL_POSITION_TOP | PL_POSITION_INSIDE, PL_POSITION_RIGHT | PL_POSITION_INSIDE, - PL_POSITION_RIGHT | PL_POSITION_LOWER | PL_POSITION_INSIDE, - PL_POSITION_LOWER | PL_POSITION_INSIDE, - PL_POSITION_LEFT | PL_POSITION_LOWER | PL_POSITION_INSIDE, + PL_POSITION_RIGHT | PL_POSITION_BOTTOM | PL_POSITION_INSIDE, + PL_POSITION_BOTTOM | PL_POSITION_INSIDE, + PL_POSITION_LEFT | PL_POSITION_BOTTOM | PL_POSITION_INSIDE, PL_POSITION_LEFT | PL_POSITION_INSIDE }; @@ -347,7 +347,7 @@ pls->sfont( PL_FCI_MONO, -1, -1 ); pls->scol0a( 15, 32, 32, 32, 0.70 ); - position = PL_POSITION_UPPER | PL_POSITION_OUTSIDE; + position = PL_POSITION_TOP | PL_POSITION_OUTSIDE; opt = opt_base; x = 0.; y = 0.1; @@ -361,7 +361,7 @@ line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); - position = PL_POSITION_LOWER | PL_POSITION_OUTSIDE; + position = PL_POSITION_BOTTOM | PL_POSITION_OUTSIDE; opt = opt_base; x = 0.; y = 0.1; @@ -403,7 +403,7 @@ line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); - position = PL_POSITION_LEFT | PL_POSITION_UPPER | PL_POSITION_INSIDE; + position = PL_POSITION_LEFT | PL_POSITION_TOP | PL_POSITION_INSIDE; opt = opt_base; x = 0.; y = 0.; @@ -417,7 +417,7 @@ line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); - position = PL_POSITION_RIGHT | PL_POSITION_UPPER | PL_POSITION_INSIDE; + position = PL_POSITION_RIGHT | PL_POSITION_TOP | PL_POSITION_INSIDE; opt = opt_base | PL_LEGEND_ROW_MAJOR; x = 0.; y = 0.; @@ -431,7 +431,7 @@ line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ); - position = PL_POSITION_LOWER | PL_POSITION_INSIDE; + position = PL_POSITION_BOTTOM | PL_POSITION_INSIDE; opt = opt_base | PL_LEGEND_ROW_MAJOR; x = 0.; y = 0.; @@ -456,7 +456,7 @@ y = 0.1; nturn = 4; nlegend = 0; - position = PL_POSITION_UPPER | PL_POSITION_LEFT; + position = PL_POSITION_TOP | PL_POSITION_LEFT; opt_base = PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX; opt = opt_base; for ( i = 0; i < 9; i++ ) @@ -499,7 +499,7 @@ if ( i == nturn ) { - position = PL_POSITION_UPPER | PL_POSITION_RIGHT; + position = PL_POSITION_TOP | PL_POSITION_RIGHT; opt = opt_base; x = 1. - x; y += legend_height; @@ -528,7 +528,7 @@ nlegend = 5; // Only specify legend data that are required according to the // value of opt_array for that entry. - position = PL_POSITION_LEFT | PL_POSITION_UPPER; + position = PL_POSITION_LEFT | PL_POSITION_TOP; opt_base = PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX | PL_LEGEND_TEXT_LEFT; // Set up None, Box, Line, Symbol, and Line & Symbol legend entries. Modified: trunk/examples/f77/x33f.fm4 =================================================================== --- trunk/examples/f77/x33f.fm4 2011-01-29 20:00:28 UTC (rev 11530) +++ trunk/examples/f77/x33f.fm4 2011-01-29 20:32:52 UTC (rev 11531) @@ -179,7 +179,7 @@ call plsfont( PL_FCI_MONO, -1, -1 ) call plscol0a( 15, 32, 32, 32, 0.70d0 ) - position = PL_POSITION_UPPER + PL_POSITION_OUTSIDE + position = PL_POSITION_TOP + PL_POSITION_OUTSIDE opt = opt_base x = 0.d0 y = 0.1d0 @@ -193,7 +193,7 @@ & line_colors, line_styles, line_widths, & symbol_colors, symbol_scales, symbol_numbers, symbols ) - position = PL_POSITION_LOWER + PL_POSITION_OUTSIDE + position = PL_POSITION_BOTTOM + PL_POSITION_OUTSIDE opt = opt_base x = 0.d0 y = 0.1d0 @@ -235,7 +235,7 @@ & line_colors, line_styles, line_widths, & symbol_colors, symbol_scales, symbol_numbers, (const char **) symbols ) - position = PL_POSITION_LEFT + PL_POSITION_UPPER + PL_POSITION_INSIDE + position = PL_POSITION_LEFT + PL_POSITION_TOP + PL_POSITION_INSIDE opt = opt_base x = 0.d0 y = 0.d0 @@ -249,7 +249,7 @@ & line_colors, line_styles, line_widths, & symbol_colors, symbol_scales, symbol_numbers, symbols ) - position = PL_POSITION_RIGHT + PL_POSITION_UPPER + PL_POSITION_INSIDE + position = PL_POSITION_RIGHT + PL_POSITION_TOP + PL_POSITION_INSIDE opt = opt_base + PL_LEGEND_ROW_MAJOR x = 0.d0 y = 0.d0 @@ -264,7 +264,7 @@ & symbol_colors, symbol_scales, symbol_numbers, symbols ) & - position = PL_POSITION_LOWER + PL_POSITION_INSIDE + position = PL_POSITION_BOTTOM + PL_POSITION_INSIDE opt = opt_base + PL_LEGEND_ROW_MAJOR x = 0.d0 y = 0.d0 @@ -290,7 +290,7 @@ y = 0.1d0 nturn = 4 nlegend = 0 - position = PL_POSITION_UPPER + PL_POSITION_LEFT + position = PL_POSITION_TOP + PL_POSITION_LEFT opt_base = PL_LEGEND_BACKGROUND + PL_LEGEND_BOUNDING_BOX opt = opt_base + PL_LEGEND_LEFT do 140 i = 1,9 @@ -337,7 +337,7 @@ & symbol_colors, symbol_scales, symbol_numbers, symbols ) if ( i == nturn ) then - position = PL_POSITION_UPPER + PL_POSITION_RIGHT + position = PL_POSITION_TOP + PL_POSITION_RIGHT opt = opt_base x = 1.d0 - x y = y + legend_height @@ -367,7 +367,7 @@ c Only specify legend data that are required according to the c value of opt_array for that entry. - position = PL_POSITION_LEFT + PL_POSITION_UPPER + position = PL_POSITION_LEFT + PL_POSITION_TOP opt_base = PL_LEGEND_BACKGROUND + PL_LEGEND_BOUNDING_BOX + PL_LEGEND_TEXT_LEFT c Set up None, Box, Line, Symbol, and Line & Symbol legend entries. Modified: trunk/examples/java/x33.java =================================================================== --- trunk/examples/java/x33.java 2011-01-29 20:00:28 UTC (rev 11530) +++ trunk/examples/java/x33.java 2011-01-29 20:32:52 UTC (rev 11531) @@ -231,21 +231,21 @@ double max_height, text_scale; int position, opt_base, nrow, ncolumn; int[] position_options = { - PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_UPPER | PLStream.PL_POSITION_OUTSIDE, - PLStream.PL_POSITION_UPPER | PLStream.PL_POSITION_OUTSIDE, - PLStream.PL_POSITION_RIGHT | PLStream.PL_POSITION_UPPER | PLStream.PL_POSITION_OUTSIDE, + PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_TOP | PLStream.PL_POSITION_OUTSIDE, + PLStream.PL_POSITION_TOP | PLStream.PL_POSITION_OUTSIDE, + PLStream.PL_POSITION_RIGHT | PLStream.PL_POSITION_TOP | PLStream.PL_POSITION_OUTSIDE, PLStream.PL_POSITION_RIGHT | PLStream.PL_POSITION_OUTSIDE, - PLStream.PL_POSITION_RIGHT | PLStream.PL_POSITION_LOWER | PLStream.PL_POSITION_OUTSIDE, - PLStream.PL_POSITION_LOWER | PLStream.PL_POSITION_OUTSIDE, - PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_LOWER | PLStream.PL_POSITION_OUTSIDE, + PLStream.PL_POSITION_RIGHT | PLStream.PL_POSITION_BOTTOM | PLStream.PL_POSITION_OUTSIDE, + PLStream.PL_POSITION_BOTTOM | PLStream.PL_POSITION_OUTSIDE, + PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_BOTTOM | PLStream.PL_POSITION_OUTSIDE, PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_OUTSIDE, - PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_UPPER | PLStream.PL_POSITION_INSIDE, - PLStream.PL_POSITION_UPPER | PLStream.PL_POSITION_INSIDE, - PLStream.PL_POSITION_RIGHT | PLStream.PL_POSITION_UPPER | PLStream.PL_POSITION_INSIDE, + PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_TOP | PLStream.PL_POSITION_INSIDE, + PLStream.PL_POSITION_TOP | PLStream.PL_POSITION_INSIDE, + PLStream.PL_POSITION_RIGHT | PLStream.PL_POSITION_TOP | PLStream.PL_POSITION_INSIDE, PLStream.PL_POSITION_RIGHT | PLStream.PL_POSITION_INSIDE, - PLStream.PL_POSITION_RIGHT | PLStream.PL_POSITION_LOWER | PLStream.PL_POSITION_INSIDE, - PLStream.PL_POSITION_LOWER | PLStream.PL_POSITION_INSIDE, - PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_LOWER | PLStream.PL_POSITION_INSIDE, + PLStream.PL_POSITION_RIGHT | PLStream.PL_POSITION_BOTTOM | PLStream.PL_POSITION_INSIDE, + PLStream.PL_POSITION_BOTTOM | PLStream.PL_POSITION_INSIDE, + PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_BOTTOM | PLStream.PL_POSITION_INSIDE, PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_INSIDE }; @@ -357,7 +357,7 @@ pls.sfont( PLStream.PL_FCI_MONO, -1, -1 ); pls.scol0a( 15, 32, 32, 32, 0.70 ); - position = PLStream.PL_POSITION_UPPER | PLStream.PL_POSITION_OUTSIDE; + position = PLStream.PL_POSITION_TOP | PLStream.PL_POSITION_OUTSIDE; opt = opt_base; x = 0.; y = 0.1; @@ -371,7 +371,7 @@ line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ); - position = PLStream.PL_POSITION_LOWER | PLStream.PL_POSITION_OUTSIDE; + position = PLStream.PL_POSITION_BOTTOM | PLStream.PL_POSITION_OUTSIDE; opt = opt_base; x = 0.; y = 0.1; @@ -413,7 +413,7 @@ line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ); - position = PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_UPPER | PLStream.PL_POSITION_INSIDE; + position = PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_TOP | PLStream.PL_POSITION_INSIDE; opt = opt_base; x = 0.; y = 0.; @@ -427,7 +427,7 @@ line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ); - position = PLStream.PL_POSITION_RIGHT | PLStream.PL_POSITION_UPPER | PLStream.PL_POSITION_INSIDE; + position = PLStream.PL_POSITION_RIGHT | PLStream.PL_POSITION_TOP | PLStream.PL_POSITION_INSIDE; opt = opt_base | PLStream.PL_LEGEND_ROW_MAJOR; x = 0.; y = 0.; @@ -441,7 +441,7 @@ line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ); - position = PLStream.PL_POSITION_LOWER | PLStream.PL_POSITION_INSIDE; + position = PLStream.PL_POSITION_BOTTOM | PLStream.PL_POSITION_INSIDE; opt = opt_base | PLStream.PL_LEGEND_ROW_MAJOR; x = 0.; y = 0.; @@ -467,7 +467,7 @@ nturn = 4; nlegend = 0; opt_base = PLStream.PL_LEGEND_BACKGROUND | PLStream.PL_LEGEND_BOUNDING_BOX; - position = PLStream.PL_POSITION_UPPER | PLStream.PL_POSITION_LEFT; + position = PLStream.PL_POSITION_TOP | PLStream.PL_POSITION_LEFT; opt = opt_base; for ( i = 0; i < 9; i++ ) { @@ -524,7 +524,7 @@ if ( i == nturn ) { - position = PLStream.PL_POSITION_UPPER | PLStream.PL_POSITION_RIGHT; + position = PLStream.PL_POSITION_TOP | PLStream.PL_POSITION_RIGHT; opt = opt_base; x = 1. - x; y = y + legend_height[0]; @@ -572,7 +572,7 @@ // Only specify legend data that are required according to the // value of opt_array for that entry. - position = PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_UPPER; + position = PLStream.PL_POSITION_LEFT | PLStream.PL_POSITION_TOP; opt_base = PLStream.PL_LEGEND_BACKGROUND | PLStream.PL_LEGEND_BOUNDING_BOX | PLStream.PL_LEGEND_TEXT_LEFT; // Set up None, Box, Line, Symbol, and Line & Symbol legend entries. Modified: trunk/examples/octave/x33c.m =================================================================== --- trunk/examples/octave/x33c.m 2011-01-29 20:00:28 UTC (rev 11530) +++ trunk/examples/octave/x33c.m 2011-01-29 20:32:52 UTC (rev 11531) @@ -31,21 +31,21 @@ global position_options special_symbols position_options = [ - bitor(PL_POSITION_LEFT, bitor(PL_POSITION_UPPER, PL_POSITION_OUTSIDE)); - bitor(PL_POSITION_UPPER, PL_POSITION_OUTSIDE); - bitor(PL_POSITION_RIGHT, bitor(PL_POSITION_UPPER, PL_POSITION_OUTSIDE)); + bitor(PL_POSITION_LEFT, bitor(PL_POSITION_TOP, PL_POSITION_OUTSIDE)); + bitor(PL_POSITION_TOP, PL_POSITION_OUTSIDE); + bitor(PL_POSITION_RIGHT, bitor(PL_POSITION_TOP, PL_POSITION_OUTSIDE)); bitor(PL_POSITION_RIGHT, PL_POSITION_OUTSIDE); - bitor(PL_POSITION_RIGHT, bitor(PL_POSITION_LOWER, PL_POSITION_OUTSIDE)); - bitor(PL_POSITION_LOWER, PL_POSITION_OUTSIDE); - bitor(PL_POSITION_LEFT, bitor(PL_POSITION_LOWER, PL_POSITION_OUTSIDE)); + bitor(PL_POSITION_RIGHT, bitor(PL_POSITION_BOTTOM, PL_POSITION_OUTSIDE)); + bitor(PL_POSITION_BOTTOM, PL_POSITION_OUTSIDE); + bitor(PL_POSITION_LEFT, bitor(PL_POSITION_BOTTOM, PL_POSITION_OUTSIDE)); bitor(PL_POSITION_LEFT, PL_POSITION_OUTSIDE); - bitor(PL_POSITION_LEFT, bitor(PL_POSITION_UPPER, PL_POSITION_INSIDE)); - bitor(PL_POSITION_UPPER, PL_POSITION_INSIDE); - bitor(PL_POSITION_RIGHT, bitor(PL_POSITION_UPPER, PL_POSITION_INSIDE)); + bitor(PL_POSITION_LEFT, bitor(PL_POSITION_TOP, PL_POSITION_INSIDE)); + bitor(PL_POSITION_TOP, PL_POSITION_INSIDE); + bitor(PL_POSITION_RIGHT, bitor(PL_POSITION_TOP, PL_POSITION_INSIDE)); bitor(PL_POSITION_RIGHT, PL_POSITION_INSIDE); - bitor(PL_POSITION_RIGHT, bitor(PL_POSITION_LOWER, PL_POSITION_INSIDE)); - bitor(PL_POSITION_LOWER, PL_POSITION_INSIDE); - bitor(PL_POSITION_LEFT, bitor(PL_POSITION_LOWER, PL_POSITION_INSIDE)); + bitor(PL_POSITION_RIGHT, bitor(PL_POSITION_BOTTOM, PL_POSITION_INSIDE)); + bitor(PL_POSITION_BOTTOM, PL_POSITION_INSIDE); + bitor(PL_POSITION_LEFT, bitor(PL_POSITION_BOTTOM, PL_POSITION_INSIDE)); bitor(PL_POSITION_LEFT, PL_POSITION_INSIDE) ]; @@ -177,7 +177,7 @@ ## Initialize plplot ## set global attributes for PLplot variables used in this function. global PL_FCI_SANS PL_FCI_MONO PL_LEGEND_NONE PL_LEGEND_COLOR_BOX PL_LEGEND_LINE PL_LEGEND_SYMBOL PL_LEGEND_TEXT_LEFT PL_LEGEND_BACKGROUND PL_LEGEND_BOUNDING_BOX PL_LEGEND_ROW_MAJOR - global PL_POSITION_LEFT PL_POSITION_RIGHT PL_POSITION_UPPER PL_POSITION_LOWER PL_POSITION_INSIDE PL_POSITION_OUTSIDE + global PL_POSITION_LEFT PL_POSITION_RIGHT PL_POSITION_TOP PL_POSITION_BOTTOM PL_POSITION_INSIDE PL_POSITION_OUTSIDE global PL_COLORBAR_IMAGE PL_COLORBAR_SHADE PL_COLORBAR_GRADIENT PL_COLORBAR_SHADE_LABEL global position_options special_symbols plinit(); @@ -322,7 +322,7 @@ plsfont(PL_FCI_MONO, -1, -1); plscol0a( 15, 32, 32, 32, 0.70 ); - position = bitor(PL_POSITION_UPPER, PL_POSITION_OUTSIDE); + position = bitor(PL_POSITION_TOP, PL_POSITION_OUTSIDE); opt = opt_base; x = 0.; y = 0.1; @@ -336,7 +336,7 @@ line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ); - position = bitor(PL_POSITION_LOWER, PL_POSITION_OUTSIDE); + position = bitor(PL_POSITION_BOTTOM, PL_POSITION_OUTSIDE); opt = opt_base; x = 0.; y = 0.1; @@ -379,7 +379,7 @@ line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ); - position = bitor(PL_POSITION_LEFT, bitor(PL_POSITION_UPPER, PL_POSITION_INSIDE)); + position = bitor(PL_POSITION_LEFT, bitor(PL_POSITION_TOP, PL_POSITION_INSIDE)); opt = opt_base; x = 0.; y = 0.; @@ -393,7 +393,7 @@ line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ); - position = bitor(PL_POSITION_RIGHT, bitor(PL_POSITION_UPPER, PL_POSITION_INSIDE)); + position = bitor(PL_POSITION_RIGHT, bitor(PL_POSITION_TOP, PL_POSITION_INSIDE)); opt = bitor(opt_base, PL_LEGEND_ROW_MAJOR); x = 0.; y = 0.; @@ -407,7 +407,7 @@ line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ); - position = bitor(PL_POSITION_LOWER, PL_POSITION_INSIDE); + position = bitor(PL_POSITION_BOTTOM, PL_POSITION_INSIDE); opt = bitor(opt_base, PL_LEGEND_ROW_MAJOR); x = 0.; y = 0.; @@ -432,7 +432,7 @@ y = 0.1; nturn = 4; nlegend = 0; - position = bitor(PL_POSITION_LEFT, PL_POSITION_UPPER); + position = bitor(PL_POSITION_LEFT, PL_POSITION_TOP); opt_base = bitor(PL_LEGEND_BACKGROUND, PL_LEGEND_BOUNDING_BOX); opt = opt_base; for i=0:8 @@ -511,7 +511,7 @@ line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ); if(i == nturn) - position = bitor(PL_POSITION_RIGHT, PL_POSITION_UPPER); + position = bitor(PL_POSITION_RIGHT, PL_POSITION_TOP); opt = opt_base; x = 1. - x; y += legend_height; @@ -576,7 +576,7 @@ ## Only specify legend data that are required according to the ## value of opt_array for that entry. - position = bitor(PL_POSITION_LEFT, PL_POSITION_UPPER); + position = bitor(PL_POSITION_LEFT, PL_POSITION_TOP); opt_base = bitor(PL_LEGEND_BACKGROUND, bitor(PL_LEGEND_BOUNDING_BOX, PL_LEGEND_TEXT_LEFT)); ## Set up None, Box, Line, Symbol, and Line & Symbol legend entries. Modified: trunk/examples/python/xw33.py =================================================================== --- trunk/examples/python/xw33.py 2011-01-29 20:00:28 UTC (rev 11530) +++ trunk/examples/python/xw33.py 2011-01-29 20:32:52 UTC (rev 11531) @@ -30,21 +30,21 @@ from plplot_py_demos import * position_options = [ -PL_POSITION_LEFT | PL_POSITION_UPPER | PL_POSITION_OUTSIDE, -PL_POSITION_UPPER | PL_POSITION_OUTSIDE, -PL_POSITION_RIGHT | PL_POSITION_UPPER | PL_POSITION_OUTSIDE, +PL_POSITION_LEFT | PL_POSITION_TOP | PL_POSITION_OUTSIDE, +PL_POSITION_TOP | PL_POSITION_OUTSIDE, +PL_POSITION_RIGHT | PL_POSITION_TOP | PL_POSITION_OUTSIDE, PL_POSITION_RIGHT| PL_POSITION_OUTSIDE, -PL_POSITION_RIGHT | PL_POSITION_LOWER | PL_POSITION_OUTSIDE, -PL_POSITION_LOWER | PL_POSITION_OUTSIDE, -PL_POSITION_LEFT | PL_POSITION_LOWER | PL_POSITION_OUTSIDE, +PL_POSITION_RIGHT | PL_POSITION_BOTTOM | PL_POSITION_OUTSIDE, +PL_POSITION_BOTTOM | PL_POSITION_OUTSIDE, +PL_POSITION_LEFT | PL_POSITION_BOTTOM | PL_POSITION_OUTSIDE, PL_POSITION_LEFT | PL_POSITION_OUTSIDE, -PL_POSITION_LEFT | PL_POSITION_UPPER | PL_POSITION_INSIDE, -PL_POSITION_UPPER | PL_POSITION_INSIDE, -PL_POSITION_RIGHT | PL_POSITION_UPPER | PL_POSITION_INSIDE, +PL_POSITION_LEFT | PL_POSITION_TOP | PL_POSITION_INSIDE, +PL_POSITION_TOP | PL_POSITION_INSIDE, +PL_POSITION_RIGHT | PL_POSITION_TOP | PL_POSITION_INSIDE, PL_POSITION_RIGHT| PL_POSITION_INSIDE, -PL_POSITION_RIGHT | PL_POSITION_LOWER | PL_POSITION_INSIDE, -PL_POSITION_LOWER | PL_POSITION_INSIDE, -PL_POSITION_LEFT | PL_POSITION_LOWER | PL_POSITION_INSIDE, +PL_POSITION_RIGHT | PL_POSITION_BOTTOM | PL_POSITION_INSIDE, +PL_POSITION_BOTTOM | PL_POSITION_INSIDE, +PL_POSITION_LEFT | PL_POSITION_BOTTOM | PL_POSITION_INSIDE, PL_POSITION_LEFT | PL_POSITION_INSIDE, ] @@ -263,7 +263,7 @@ plsfont(PL_FCI_MONO, -1, -1) plscol0a( 15, 32, 32, 32, 0.70 ) - position = PL_POSITION_UPPER | PL_POSITION_OUTSIDE + position = PL_POSITION_TOP | PL_POSITION_OUTSIDE opt = opt_base x = 0. y = 0.1 @@ -277,7 +277,7 @@ line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ) - position = PL_POSITION_LOWER | PL_POSITION_OUTSIDE + position = PL_POSITION_BOTTOM | PL_POSITION_OUTSIDE opt = opt_base x = 0. y = 0.1 @@ -319,7 +319,7 @@ line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ) - position = PL_POSITION_LEFT | PL_POSITION_UPPER | PL_POSITION_INSIDE + position = PL_POSITION_LEFT | PL_POSITION_TOP | PL_POSITION_INSIDE opt = opt_base x = 0. y = 0. @@ -333,7 +333,7 @@ line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ) - position = PL_POSITION_RIGHT | PL_POSITION_UPPER | PL_POSITION_INSIDE + position = PL_POSITION_RIGHT | PL_POSITION_TOP | PL_POSITION_INSIDE opt = opt_base | PL_LEGEND_ROW_MAJOR x = 0. y = 0. @@ -347,7 +347,7 @@ line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ) - position = PL_POSITION_LOWER | PL_POSITION_INSIDE + position = PL_POSITION_BOTTOM | PL_POSITION_INSIDE opt = opt_base | PL_LEGEND_ROW_MAJOR x = 0. y = 0. @@ -372,7 +372,7 @@ y = 0.1 nturn = 4 nlegend = 0 - position = PL_POSITION_UPPER | PL_POSITION_LEFT + position = PL_POSITION_TOP | PL_POSITION_LEFT opt_base = PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX opt = opt_base for i in range(9): @@ -426,7 +426,7 @@ line_colors, line_styles, line_widths, symbol_colors, symbol_scales, symbol_numbers, symbols ) if i == nturn: - position = PL_POSITION_UPPER | PL_POSITION_RIGHT + position = PL_POSITION_TOP | PL_POSITION_RIGHT opt = opt_base x = 1. - x y += legend_height @@ -467,7 +467,7 @@ # Only specify legend data that are required according to the # value of opt_array for that entry. - position = PL_POSITION_LEFT | PL_POSITION_UPPER + position = PL_POSITION_LEFT | PL_POSITION_TOP opt_base = PL_LEGEND_BACKGROUND | PL_LEGEND_BOUNDING_BOX | PL_LEGEND_TEXT_LEFT # Set up None, Box, Line, Symbol, and Line & Symbol legend entries. Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2011-01-29 20:00:28 UTC (rev 11530) +++ trunk/include/plplot.h 2011-01-29 20:32:52 UTC (rev 11531) @@ -1212,8 +1212,8 @@ //flags used for position argument of both pllegend and plcolorbar #define PL_POSITION_LEFT 1 #define PL_POSITION_RIGHT 2 -#define PL_POSITION_UPPER 4 -#define PL_POSITION_LOWER 8 +#define PL_POSITION_TOP 4 +#define PL_POSITION_BOTTOM 8 #define PL_POSITION_INSIDE 16 #define PL_POSITION_OUTSIDE 32 #define PL_POSITION_VIEWPORT 64 Modified: trunk/src/pllegend.c =================================================================== --- trunk/src/pllegend.c 2011-01-29 20:00:28 UTC (rev 11530) +++ trunk/src/pllegend.c 2011-01-29 20:32:52 UTC (rev 11531) @@ -34,8 +34,8 @@ //! //! @param position Control variable containing valid combinations of the //! following control bits that specify the 16 standard positions of -//! the legend: PL_POSITION_LEFT, PL_POSITION_RIGHT, PL_POSITION_UPPER, -//! PL_POSITION_LOWER, PL_POSITION_INSIDE, and PL_POSITION_OUTSIDE. +//! the legend: PL_POSITION_LEFT, PL_POSITION_RIGHT, PL_POSITION_TOP, +//! PL_POSITION_BOTTOM, PL_POSITION_INSIDE, and PL_POSITION_OUTSIDE. //! @param legend_width Total legend width in normalized viewport //! coordinates. //! @param legend_height Total legend height in normalized viewport @@ -73,7 +73,7 @@ if ( position & PL_POSITION_RIGHT ) { xorigin = 1.; - if ( position & PL_POSITION_UPPER ) + if ( position & PL_POSITION_TOP ) { yorigin = 1.; if ( position & PL_POSITION_INSIDE ) @@ -93,7 +93,7 @@ plexit( "legend_position: internal logic error 1" ); } } - else if ( !( position & PL_POSITION_UPPER ) && !( position & PL_POSITION_LOWER ) ) + else if ( !( position & PL_POSITION_TOP ) && !( position & PL_POSITION_BOTTOM ) ) { yorigin = 0.5; ylegend = 0.5 * legend_height; @@ -111,7 +111,7 @@ plexit( "legend_position: internal logic error 2" ); } } - else if ( position & PL_POSITION_LOWER ) + else if ( position & PL_POSITION_BOTTOM ) { yorigin = 0.; if ( position & PL_POSITION_INSIDE ) @@ -140,7 +140,7 @@ { xorigin = 0.5; xlegend = -0.5 * legend_width; - if ( position & PL_POSITION_UPPER ) + if ( position & PL_POSITION_TOP ) { yorigin = 1.; if ( position & PL_POSITION_INSIDE ) @@ -157,7 +157,7 @@ plexit( "legend_position: internal logic error 5" ); } } - else if ( position & PL_POSITION_LOWER ) + else if ( position & PL_POSITION_BOTTOM ) { yorigin = 0.; if ( position & PL_POSITION_INSIDE ) @@ -182,7 +182,7 @@ else if ( position & PL_POSITION_LEFT ) { xorigin = 0.; - if ( position & PL_POSITION_UPPER ) + if ( position & PL_POSITION_TOP ) { yorigin = 1.; if ( position & PL_POSITION_INSIDE ) @@ -202,7 +202,7 @@ plexit( "legend_position: internal logic error 8" ); } } - else if ( !( position & PL_POSITION_UPPER ) && !( position & PL_POSITION_LOWER ) ) + else if ( !( position & PL_POSITION_TOP ) && !( position & PL_POSITION_BOTTOM ) ) { yorigin = 0.5; ylegend = 0.5 * legend_height; @@ -220,7 +220,7 @@ plexit( "legend_position: internal logic error 9" ); } } - else if ( position & PL_POSITION_LOWER ) + else if ( position & PL_POSITION_BOTTOM ) { yorigin = 0.; if ( position & PL_POSITION_INSIDE ) @@ -354,8 +354,8 @@ //! on the nlegend and ncolum arguments). //! @param position This variable contains bits which control the //! overall position of the legend. The combination of the -//! PL_POSITION_LEFT, PL_POSITION_RIGHT, PL_POSITION_UPPER, -//! PL_POSITION_LOWER, PL_POSITION_INSIDE, and PL_POSITION_OUTSIDE +//! PL_POSITION_LEFT, PL_POSITION_RIGHT, PL_POSITION_TOP, +//! PL_POSITION_BOTTOM, PL_POSITION_INSIDE, and PL_POSITION_OUTSIDE //! position bits specifies one of the 16 possible standard positions //! (the 4 corners and 4 side centers for both the inside and outside //! cases) of the legend relative to the viewport. @@ -520,9 +520,9 @@ // fprintf(stdout, "nrow, ncolumn = %d, %d\n", nrow, ncolumn); // Default position flags and sanity checks for position flags. - if ( !( position & PL_POSITION_RIGHT ) && !( position & PL_POSITION_LEFT ) && !( position & PL_POSITION_UPPER ) && !( position & PL_POSITION_LOWER ) ) + if ( !( position & PL_POSITION_RIGHT ) && !( position & PL_POSITION_LEFT ) && !( position & PL_POSITION_TOP ) && !( position & PL_POSITION_BOTTOM ) ) { - position = position | PL_POSITION_RIGHT | PL_POSITION_UPPER; + position = position | PL_POSITION_RIGHT | PL_POSITION_TOP; } else if ( ( position & PL_POSITION_RIGHT ) && ( position & PL_POSITION_LEFT ) ) { @@ -530,9 +530,9 @@ return; } - else if ( ( position & PL_POSITION_UPPER ) && ( position & PL_POSITION_LOWER ) ) + else if ( ( position & PL_POSITION_TOP ) && ( position & PL_POSITION_BOTTOM ) ) { - plabort( "pllegend: PL_POSITION_UPPER and PL_POSITION_LOWER cannot be simultaneously set." ); + plabort( "pllegend: PL_POSITION_TOP and PL_POSITION_BOTTOM cannot be simultaneously set." ); return; } @@ -857,13 +857,13 @@ plfill( 3, xs, ys ); } - else if ( opt_position & PL_POSITION_UPPER || opt_position & PL_POSITION_LOWER ) + else if ( opt_position & PL_POSITION_TOP || opt_position & PL_POSITION_BOTTOM ) { // Draw the cap on the left xs[0] = x; - if ( opt_position & PL_POSITION_UPPER ) + if ( opt_position & PL_POSITION_TOP ) ys[0] = 1.0 - y - width; - else if ( opt_position & PL_POSITION_LOWER ) + else if ( opt_position & PL_POSITION_BOTTOM ) ys[0] = y; xs[2] = xs[0]; ys[2] = ys[0] + width; @@ -890,13 +890,13 @@ plfill( 3, xs, ys ); } - else if ( opt_position & PL_POSITION_UPPER || opt_position & PL_POSITION_LOWER ) + else if ( opt_position & PL_POSITION_TOP || opt_position & PL_POSITION_BOTTOM ) { // Draw the cap on the right xs[0] = x + length; - if ( opt_position & PL_POSITION_UPPER ) + if ( opt_position & PL_POSITION_TOP ) ys[0] = 1.0 - y - width; - else if ( opt_position & PL_POSITION_LOWER ) + else if ( opt_position & PL_POSITION_BOTTOM ) ys[0] = y; xs[2] = xs[0]; ys[2] = ys[0] + width; @@ -1001,7 +1001,7 @@ wx_max = 1.0; wy_max = max_value; } - else if ( opt_position & PL_POSITION_UPPER ) + else if ( opt_position & PL_POSITION_TOP ) { vx_min = x; vy_min = 1.0 - y - width; @@ -1012,7 +1012,7 @@ wx_max = max_value; wy_max = 1.0; } - else if ( opt_position & PL_POSITION_LOWER ) + else if ( opt_position & PL_POSITION_BOTTOM ) { vx_min = x; vy_min = y; @@ -1064,7 +1064,7 @@ } } } - else if ( opt_position & PL_POSITION_UPPER || opt_position & PL_POSITION_LOWER ) + else if ( opt_position & PL_POSITION_TOP || opt_position & PL_POSITION_BOTTOM ) { ni = n_steps; nj = 2; @@ -1100,7 +1100,7 @@ } } } - else if ( opt_position & PL_POSITION_UPPER || opt_position & PL_POSITION_LOWER ) + else if ( opt_position & PL_POSITION_TOP || opt_position & PL_POSITION_BOTTOM ) { ni = n_steps; nj = 2; @@ -1129,16 +1129,16 @@ PLcGrid grid; PLFLT grid_axis[2] = { 0.0, 1.0 }; n_steps = n_colors + 2; - PLFLT values_ext[n_steps]; + PLFLT values_ext[n_steps]; for ( i = 0; i < n_steps; i++ ) { if ( i == 0 ) { - values_ext[i] = min_value - (values[i + 1] - min_value) * 0.1; + values_ext[i] = min_value - ( values[i + 1] - min_value ) * 0.1; } else if ( i == n_steps - 1 ) { - values_ext[i] = max_value + (max_value - values[i - 1]) * 0.1; + values_ext[i] = max_value + ( max_value - values[i - 1] ) * 0.1; } else { @@ -1163,7 +1163,7 @@ } } } - else if ( opt_position & PL_POSITION_UPPER || opt_position & PL_POSITION_LOWER ) + else if ( opt_position & PL_POSITION_TOP || opt_position & PL_POSITION_BOTTOM ) { grid.xg = values_ext; grid.yg = grid_axis; @@ -1207,7 +1207,7 @@ { angle = 90.0; } - else if ( opt_position & PL_POSITION_UPPER || opt_position & PL_POSITION_LOWER ) + else if ( opt_position & PL_POSITION_TOP || opt_position & PL_POSITION_BOTTOM ) { angle = 0.0; } @@ -1232,7 +1232,7 @@ // cap. if ( ( ( opt_position & PL_POSITION_LEFT || opt_position & PL_POSITION_RIGHT ) && opt & PL_COLORBAR_LABEL_LOWER ) || - ( ( opt_position & PL_POSITION_UPPER || opt_position & PL_POSITION_LOWER ) && + ( ( opt_position & PL_POSITION_TOP || opt_position & PL_POSITION_BOTTOM ) && opt & PL_COLORBAR_LABEL_LEFT ) ) { label_offset += 2.5; @@ -1246,7 +1246,7 @@ // cap. if ( ( ( opt_position & PL_POSITION_LEFT || opt_position & PL_POSITION_RIGHT ) && opt & PL_COLORBAR_LABEL_UPPER ) || - ( ( opt_position & PL_POSITION_UPPER || opt_position & PL_POSITION_LOWER ) && + ( ( opt_position & PL_POSITION_TOP || opt_position & PL_POSITION_BOTTOM ) && opt & PL_COLORBAR_LABEL_RIGHT ) ) { label_offset += 2.5; @@ -1347,12 +1347,12 @@ snprintf( opt_string, max_opts, "mt%s", axis_opts ); label_box_custom( "", 0, NULL, opt_string, n_colors, values ); } - else if ( opt_position & PL_POSITION_UPPER ) + else if ( opt_position & PL_POSITION_TOP ) { snprintf( opt_string, max_opts, "mt%s", axis_opts ); label_box_custom( opt_string, n_colors, values, "", 0, NULL ); } - else if ( opt_position & PL_POSITION_LOWER ) + else if ( opt_position & PL_POSITION_BOTTOM ) { snprintf( opt_string, max_opts, "nt%s", axis_opts ); label_box_custom( opt_string, n_colors, values, "", 0, NULL ); @@ -1360,11 +1360,11 @@ } else { - if ( opt_position & PL_POSITION_LEFT || opt_position & PL_POSITION_LOWER ) + if ( opt_position & PL_POSITION_LEFT || opt_position & PL_POSITION_BOTTOM ) { tick_string = "n"; } - else if ( opt_position & PL_POSITION_RIGHT || opt_position & PL_POSITION_UPPER ) + else if ( opt_position & PL_POSITION_RIGHT || opt_position & PL_POSITION_TOP ) { tick_string = "m"; } @@ -1381,12 +1381,12 @@ snprintf( opt_string, max_opts, "bc%s%s", tick_string, axis_opts ); plbox( "bc", 0.0, 0, opt_string, ticks, sub_ticks ); } - else if ( opt_position & PL_POSITION_UPPER ) + else if ( opt_position & PL_POSITION_TOP ) { snprintf( opt_string, max_opts, "bc%s%s", tick_string, axis_opts ); plbox( opt_string, ticks, sub_ticks, "bc", 0.0, 0 ); } - else if ( opt_position & PL_POSITION_LOWER ) + else if ( opt_position & PL_POSITION_BOTTOM ) { snprintf( opt_string, max_opts, "bc%s%s", tick_string, axis_opts ); plbox( opt_string, ticks, sub_ticks, "bc", 0.0, 0 ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-01-29 21:11:54
|
Revision: 11532 http://plplot.svn.sourceforge.net/plplot/?rev=11532&view=rev Author: airwin Date: 2011-01-29 21:11:48 +0000 (Sat, 29 Jan 2011) Log Message: ----------- First two arguments of plcolorbar changed from PLINT opt, PLINT opt_position ==> PLINT position, PLINT opt to be consistent with corresponding pllegend arguments. N.B. this does not cure the current broken default build but it does not make it worse. OTOH, the -DBUILD_TEST=ON -DDEFAULT_NO_BINDINGS=ON cmake options and the make test_c_psc target do work with this change and produce good-looking results. ToDo: propagate this plcolorbar API change to the other languages so the default build does work again. Modified Paths: -------------- trunk/examples/c/x33c.c trunk/include/plplot.h trunk/src/pllegend.c Modified: trunk/examples/c/x33c.c =================================================================== --- trunk/examples/c/x33c.c 2011-01-29 20:32:52 UTC (rev 11531) +++ trunk/examples/c/x33c.c 2011-01-29 21:11:48 UTC (rev 11532) @@ -63,24 +63,24 @@ void plcolorbar_example_1( PLINT bar_type, PLINT cont_color, PLINT cont_width, PLFLT ticks, PLINT sub_ticks, PLINT n, PLFLT *values, const char *title ) { + PLFLT colors[n]; + int i; + PLFLT color_step, color_offset; + PLINT position, opt; + const char *axis_opts_1, *axis_opts_2; pladv( 0 ); // Setup color palette 1 plspal1( "cmap1_blue_red.pal", 1 ); - PLFLT colors[n]; - int i; - PLFLT color_step, color_offset; color_step = 1.0 / (PLFLT) ( n - 1 ); for ( i = 0; i < n; i++ ) { colors[i] = color_offset + color_step * (PLFLT) ( i ); } - PLINT opt, opt_position; - opt = bar_type | PL_COLORBAR_LABEL_LEFT | PL_COLORBAR_CAP_HIGH; - opt_position = PL_POSITION_LEFT; + position = PL_POSITION_LEFT; + opt = bar_type | PL_COLORBAR_LABEL_LEFT | PL_COLORBAR_CAP_HIGH; - const char *axis_opts_1, *axis_opts_2; if ( bar_type & PL_COLORBAR_SHADE_LABEL ) { axis_opts_1 = "iv"; @@ -100,34 +100,34 @@ } } - plcolorbar( opt, opt_position, 0.1, 0.1, 0.5, 0.1, + plcolorbar( position, opt, 0.1, 0.1, 0.5, 0.1, cont_color, cont_width, ticks, sub_ticks, axis_opts_1, "Test label - Left, High Cap", n, colors, values ); - opt = bar_type | PL_COLORBAR_LABEL_RIGHT | PL_COLORBAR_CAP_LOW; - opt_position = PL_POSITION_RIGHT; + position = PL_POSITION_RIGHT; + opt = bar_type | PL_COLORBAR_LABEL_RIGHT | PL_COLORBAR_CAP_LOW; - plcolorbar( opt, opt_position, 0.1, 0.4, 0.5, 0.1, + plcolorbar( position, opt, 0.1, 0.4, 0.5, 0.1, cont_color, cont_width, ticks, sub_ticks, axis_opts_1, "Test label - Right, Low Cap", n, colors, values ); - opt = bar_type | PL_COLORBAR_LABEL_UPPER | PL_COLORBAR_CAP_HIGH; - opt_position = PL_POSITION_TOP; + position = PL_POSITION_TOP; + opt = bar_type | PL_COLORBAR_LABEL_UPPER | PL_COLORBAR_CAP_HIGH; - plcolorbar( opt, opt_position, 0.1, 0.1, 0.5, 0.1, + plcolorbar( position, opt, 0.1, 0.1, 0.5, 0.1, cont_color, cont_width, ticks, sub_ticks, axis_opts_2, "Test label - Upper, High Cap", n, colors, values ); - opt = bar_type | PL_COLORBAR_LABEL_LOWER | PL_COLORBAR_CAP_LOW; - opt_position = PL_POSITION_BOTTOM; + position = PL_POSITION_BOTTOM; + opt = bar_type | PL_COLORBAR_LABEL_LOWER | PL_COLORBAR_CAP_LOW; - plcolorbar( opt, opt_position, 0.4, 0.1, 0.5, 0.1, + plcolorbar( position, opt, 0.4, 0.1, 0.5, 0.1, cont_color, cont_width, ticks, sub_ticks, axis_opts_2, "Test label - Lower, Low Cap", @@ -141,13 +141,15 @@ void plcolorbar_example_2( PLINT bar_type, PLINT cont_color, PLINT cont_width, PLFLT ticks, PLFLT sub_ticks, PLINT n, PLFLT *values, const char *title ) { + PLFLT colors[n]; + int i; + PLFLT color_step, color_offset; + PLINT position, opt; + const char *axis_opts_1, *axis_opts_2; pladv( 0 ); // Setup color palette 1 plspal1( "cmap1_blue_yellow.pal", 1 ); - PLFLT colors[n]; - int i; - PLFLT color_step, color_offset; color_step = 1.0 / (PLFLT) ( n - 1 ); for ( i = 0; i < n; i++ ) { @@ -166,11 +168,9 @@ colors[i] = color_offset + color_step * (PLFLT) ( i ); } - PLINT opt, opt_position; - opt = bar_type | PL_COLORBAR_LABEL_LEFT | PL_COLORBAR_CAP_LOW; - opt_position = PL_POSITION_LEFT; + position = PL_POSITION_LEFT; + opt = bar_type | PL_COLORBAR_LABEL_LEFT | PL_COLORBAR_CAP_LOW; - const char *axis_opts_1, *axis_opts_2; if ( bar_type == PL_COLORBAR_SHADE_LABEL ) { axis_opts_1 = ""; @@ -190,34 +190,34 @@ } } - plcolorbar( opt, opt_position, 0.1, 0.1, 0.5, 0.1, + plcolorbar( position, opt, 0.1, 0.1, 0.5, 0.1, cont_color, cont_width, ticks, sub_ticks, axis_opts_1, "Test label - Left, Low Cap", n, colors, values ); - opt = bar_type | PL_COLORBAR_LABEL_RIGHT | PL_COLORBAR_CAP_HIGH; - opt_position = PL_POSITION_RIGHT; + position = PL_POSITION_RIGHT; + opt = bar_type | PL_COLORBAR_LABEL_RIGHT | PL_COLORBAR_CAP_HIGH; - plcolorbar( opt, opt_position, 0.1, 0.4, 0.5, 0.1, + plcolorbar( position, opt, 0.1, 0.4, 0.5, 0.1, cont_color, cont_width, ticks, sub_ticks, axis_opts_1, "Test label - Right, High Cap", n, colors, values ); - opt = bar_type | PL_COLORBAR_LABEL_UPPER | PL_COLORBAR_CAP_LOW; - opt_position = PL_POSITION_TOP; + position = PL_POSITION_TOP; + opt = bar_type | PL_COLORBAR_LABEL_UPPER | PL_COLORBAR_CAP_LOW; - plcolorbar( opt, opt_position, 0.1, 0.1, 0.5, 0.1, + plcolorbar( position, opt, 0.1, 0.1, 0.5, 0.1, cont_color, cont_width, ticks, sub_ticks, axis_opts_2, "Test label - Upper, Low Cap", n, colors, values ); - opt = bar_type | PL_COLORBAR_LABEL_LOWER | PL_COLORBAR_CAP_HIGH; - opt_position = PL_POSITION_BOTTOM; + position = PL_POSITION_BOTTOM; + opt = bar_type | PL_COLORBAR_LABEL_LOWER | PL_COLORBAR_CAP_HIGH; - plcolorbar( opt, opt_position, 0.4, 0.1, 0.5, 0.1, + plcolorbar( position, opt, 0.4, 0.1, 0.5, 0.1, cont_color, cont_width, ticks, sub_ticks, axis_opts_2, "Test label - Lower, High Cap", Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2011-01-29 20:32:52 UTC (rev 11531) +++ trunk/include/plplot.h 2011-01-29 21:11:48 UTC (rev 11532) @@ -1260,7 +1260,7 @@ // Routine for drawing continous colour legends PLDLLIMPEXP void -c_plcolorbar( PLINT opt, PLINT opt_position, +c_plcolorbar( PLINT position, PLINT opt, PLFLT x, PLFLT y, PLFLT length, PLFLT width, PLINT cont_color, PLINT cont_width, PLFLT ticks, PLINT sub_ticks, Modified: trunk/src/pllegend.c =================================================================== --- trunk/src/pllegend.c 2011-01-29 20:32:52 UTC (rev 11531) +++ trunk/src/pllegend.c 2011-01-29 21:11:48 UTC (rev 11532) @@ -815,7 +815,7 @@ //! void -draw_cap( PLINT opt, PLINT opt_position, PLFLT x, PLFLT y, PLFLT length, PLFLT width, PLFLT color ) +draw_cap( PLINT position, PLINT opt, PLFLT x, PLFLT y, PLFLT length, PLFLT width, PLFLT color ) { // Save drawing color PLINT col0_save = plsc->icol0; @@ -842,12 +842,12 @@ if ( opt & PL_COLORBAR_CAP_LOW ) { - if ( opt_position & PL_POSITION_LEFT || opt_position & PL_POSITION_RIGHT ) + if ( position & PL_POSITION_LEFT || position & PL_POSITION_RIGHT ) { // Draw the cap on the bottom - if ( opt_position & PL_POSITION_LEFT ) + if ( position & PL_POSITION_LEFT ) xs[0] = x; - else if ( opt_position & PL_POSITION_RIGHT ) + else if ( position & PL_POSITION_RIGHT ) xs[0] = 1.0 - x - width; ys[0] = y; xs[2] = xs[0] + width; @@ -857,13 +857,13 @@ plfill( 3, xs, ys ); } - else if ( opt_position & PL_POSITION_TOP || opt_position & PL_POSITION_BOTTOM ) + else if ( position & PL_POSITION_TOP || position & PL_POSITION_BOTTOM ) { // Draw the cap on the left xs[0] = x; - if ( opt_position & PL_POSITION_TOP ) + if ( position & PL_POSITION_TOP ) ys[0] = 1.0 - y - width; - else if ( opt_position & PL_POSITION_BOTTOM ) + else if ( position & PL_POSITION_BOTTOM ) ys[0] = y; xs[2] = xs[0]; ys[2] = ys[0] + width; @@ -875,12 +875,12 @@ } else if ( opt & PL_COLORBAR_CAP_HIGH ) { - if ( opt_position & PL_POSITION_LEFT || opt_position & PL_POSITION_RIGHT ) + if ( position & PL_POSITION_LEFT || position & PL_POSITION_RIGHT ) { // Draw the cap on the top - if ( opt_position & PL_POSITION_LEFT ) + if ( position & PL_POSITION_LEFT ) xs[0] = x; - else if ( opt_position & PL_POSITION_RIGHT ) + else if ( position & PL_POSITION_RIGHT ) xs[0] = 1.0 - x - width; ys[0] = y + length; xs[2] = xs[0] + width; @@ -890,13 +890,13 @@ plfill( 3, xs, ys ); } - else if ( opt_position & PL_POSITION_TOP || opt_position & PL_POSITION_BOTTOM ) + else if ( position & PL_POSITION_TOP || position & PL_POSITION_BOTTOM ) { // Draw the cap on the right xs[0] = x + length; - if ( opt_position & PL_POSITION_TOP ) + if ( position & PL_POSITION_TOP ) ys[0] = 1.0 - y - width; - else if ( opt_position & PL_POSITION_BOTTOM ) + else if ( position & PL_POSITION_BOTTOM ) ys[0] = y; xs[2] = xs[0]; ys[2] = ys[0] + width; @@ -921,8 +921,8 @@ //-------------------------------------------------------------------------- //! Plot color bar for image, shade or gradient plots. //! +//! @param position TODO //! @param opt TODO -//! @param opt_position TODO //! @param x TODO //! @param y TODO //! @param length TODO @@ -939,7 +939,7 @@ //! void -c_plcolorbar( PLINT opt, PLINT opt_position, +c_plcolorbar( PLINT position, PLINT opt, PLFLT x, PLFLT y, PLFLT length, PLFLT width, PLINT cont_color, PLINT cont_width, PLFLT ticks, PLINT sub_ticks, @@ -979,7 +979,7 @@ PLFLT vx_min, vx_max, vy_min, vy_max; PLFLT wx_min, wx_max, wy_min, wy_max; // Build the proper viewport and window dimensions - if ( opt_position & PL_POSITION_LEFT ) + if ( position & PL_POSITION_LEFT ) { vx_min = x; vy_min = y; @@ -990,7 +990,7 @@ wx_max = 1.0; wy_max = max_value; } - else if ( opt_position & PL_POSITION_RIGHT ) + else if ( position & PL_POSITION_RIGHT ) { vx_min = 1.0 - x - width; vy_min = y; @@ -1001,7 +1001,7 @@ wx_max = 1.0; wy_max = max_value; } - else if ( opt_position & PL_POSITION_TOP ) + else if ( position & PL_POSITION_TOP ) { vx_min = x; vy_min = 1.0 - y - width; @@ -1012,7 +1012,7 @@ wx_max = max_value; wy_max = 1.0; } - else if ( opt_position & PL_POSITION_BOTTOM ) + else if ( position & PL_POSITION_BOTTOM ) { vx_min = x; vy_min = y; @@ -1051,7 +1051,7 @@ // TODO: Determine a better way to specify the steps here? n_steps = plsc->ncol1; step_size = ( max_value - min_value ) / (PLFLT) n_steps; - if ( opt_position & PL_POSITION_LEFT || opt_position & PL_POSITION_RIGHT ) + if ( position & PL_POSITION_LEFT || position & PL_POSITION_RIGHT ) { ni = 2; nj = n_steps; @@ -1064,7 +1064,7 @@ } } } - else if ( opt_position & PL_POSITION_TOP || opt_position & PL_POSITION_BOTTOM ) + else if ( position & PL_POSITION_TOP || position & PL_POSITION_BOTTOM ) { ni = n_steps; nj = 2; @@ -1087,7 +1087,7 @@ { n_steps = n_colors; // Use the provided values in this case. - if ( opt_position & PL_POSITION_LEFT || opt_position & PL_POSITION_RIGHT ) + if ( position & PL_POSITION_LEFT || position & PL_POSITION_RIGHT ) { ni = 2; nj = n_steps; @@ -1100,7 +1100,7 @@ } } } - else if ( opt_position & PL_POSITION_TOP || opt_position & PL_POSITION_BOTTOM ) + else if ( position & PL_POSITION_TOP || position & PL_POSITION_BOTTOM ) { ni = n_steps; nj = 2; @@ -1146,7 +1146,7 @@ } } // Use the provided values. - if ( opt_position & PL_POSITION_LEFT || opt_position & PL_POSITION_RIGHT ) + if ( position & PL_POSITION_LEFT || position & PL_POSITION_RIGHT ) { grid.xg = grid_axis; grid.yg = values_ext; @@ -1163,7 +1163,7 @@ } } } - else if ( opt_position & PL_POSITION_TOP || opt_position & PL_POSITION_BOTTOM ) + else if ( position & PL_POSITION_TOP || position & PL_POSITION_BOTTOM ) { grid.xg = values_ext; grid.yg = grid_axis; @@ -1203,11 +1203,11 @@ xs[3] = wx_min; ys[3] = wy_max; PLFLT angle; - if ( opt_position & PL_POSITION_LEFT || opt_position & PL_POSITION_RIGHT ) + if ( position & PL_POSITION_LEFT || position & PL_POSITION_RIGHT ) { angle = 90.0; } - else if ( opt_position & PL_POSITION_TOP || opt_position & PL_POSITION_BOTTOM ) + else if ( position & PL_POSITION_TOP || position & PL_POSITION_BOTTOM ) { angle = 0.0; } @@ -1230,29 +1230,29 @@ { // Add an extra offset for the label so it does not bump in to the // cap. - if ( ( ( opt_position & PL_POSITION_LEFT || opt_position & PL_POSITION_RIGHT ) && + if ( ( ( position & PL_POSITION_LEFT || position & PL_POSITION_RIGHT ) && opt & PL_COLORBAR_LABEL_LOWER ) || - ( ( opt_position & PL_POSITION_TOP || opt_position & PL_POSITION_BOTTOM ) && + ( ( position & PL_POSITION_TOP || position & PL_POSITION_BOTTOM ) && opt & PL_COLORBAR_LABEL_LEFT ) ) { label_offset += 2.5; } // Draw a filled triangle (cap/arrow) at the low end of the scale - draw_cap( opt, opt_position, x, y, length, width, 0.0 ); + draw_cap( position, opt, x, y, length, width, 0.0 ); } else if ( opt & PL_COLORBAR_CAP_HIGH ) { // Add an extra offset for the label so it does not bump in to the // cap. - if ( ( ( opt_position & PL_POSITION_LEFT || opt_position & PL_POSITION_RIGHT ) && + if ( ( ( position & PL_POSITION_LEFT || position & PL_POSITION_RIGHT ) && opt & PL_COLORBAR_LABEL_UPPER ) || - ( ( opt_position & PL_POSITION_TOP || opt_position & PL_POSITION_BOTTOM ) && + ( ( position & PL_POSITION_TOP || position & PL_POSITION_BOTTOM ) && opt & PL_COLORBAR_LABEL_RIGHT ) ) { label_offset += 2.5; } // Draw a filled triangle (cap/arrow) at the high end of the scale - draw_cap( opt, opt_position, x, y, length, width, 1.0 ); + draw_cap( position, opt, x, y, length, width, 1.0 ); } // Smaller text @@ -1272,7 +1272,7 @@ char perp; if ( opt & PL_COLORBAR_LABEL_LEFT ) { - if ( opt_position & PL_POSITION_RIGHT || opt_position & PL_POSITION_LEFT ) + if ( position & PL_POSITION_RIGHT || position & PL_POSITION_LEFT ) { label_offset += 4.0; perp = '\0'; @@ -1287,7 +1287,7 @@ } else if ( opt & PL_COLORBAR_LABEL_RIGHT ) { - if ( opt_position & PL_POSITION_RIGHT || opt_position & PL_POSITION_LEFT ) + if ( position & PL_POSITION_RIGHT || position & PL_POSITION_LEFT ) { label_offset += 4.0; perp = '\0'; @@ -1302,7 +1302,7 @@ } else if ( opt & PL_COLORBAR_LABEL_UPPER ) { - if ( opt_position & PL_POSITION_RIGHT || opt_position & PL_POSITION_LEFT ) + if ( position & PL_POSITION_RIGHT || position & PL_POSITION_LEFT ) { label_offset += 1.5; perp = 'v'; @@ -1317,7 +1317,7 @@ } else if ( opt & PL_COLORBAR_LABEL_LOWER ) { - if ( opt_position & PL_POSITION_RIGHT || opt_position & PL_POSITION_LEFT ) + if ( position & PL_POSITION_RIGHT || position & PL_POSITION_LEFT ) { label_offset += 1.5; perp = 'v'; @@ -1337,22 +1337,22 @@ // along an axis. if ( opt & PL_COLORBAR_SHADE && opt & PL_COLORBAR_SHADE_LABEL ) { - if ( opt_position & PL_POSITION_LEFT ) + if ( position & PL_POSITION_LEFT ) { snprintf( opt_string, max_opts, "nt%s", axis_opts ); label_box_custom( "", 0, NULL, opt_string, n_colors, values ); } - else if ( opt_position & PL_POSITION_RIGHT ) + else if ( position & PL_POSITION_RIGHT ) { snprintf( opt_string, max_opts, "mt%s", axis_opts ); label_box_custom( "", 0, NULL, opt_string, n_colors, values ); } - else if ( opt_position & PL_POSITION_TOP ) + else if ( position & PL_POSITION_TOP ) { snprintf( opt_string, max_opts, "mt%s", axis_opts ); label_box_custom( opt_string, n_colors, values, "", 0, NULL ); } - else if ( opt_position & PL_POSITION_BOTTOM ) + else if ( position & PL_POSITION_BOTTOM ) { snprintf( opt_string, max_opts, "nt%s", axis_opts ); label_box_custom( opt_string, n_colors, values, "", 0, NULL ); @@ -1360,33 +1360,33 @@ } else { - if ( opt_position & PL_POSITION_LEFT || opt_position & PL_POSITION_BOTTOM ) + if ( position & PL_POSITION_LEFT || position & PL_POSITION_BOTTOM ) { tick_string = "n"; } - else if ( opt_position & PL_POSITION_RIGHT || opt_position & PL_POSITION_TOP ) + else if ( position & PL_POSITION_RIGHT || position & PL_POSITION_TOP ) { tick_string = "m"; } } // Draw the boxes, etc. - if ( opt_position & PL_POSITION_LEFT ) + if ( position & PL_POSITION_LEFT ) { snprintf( opt_string, max_opts, "bc%s%s", tick_string, axis_opts ); plbox( "bc", ticks, sub_ticks, opt_string, ticks, sub_ticks ); } - else if ( opt_position & PL_POSITION_RIGHT ) + else if ( position & PL_POSITION_RIGHT ) { snprintf( opt_string, max_opts, "bc%s%s", tick_string, axis_opts ); plbox( "bc", 0.0, 0, opt_string, ticks, sub_ticks ); } - else if ( opt_position & PL_POSITION_TOP ) + else if ( position & PL_POSITION_TOP ) { snprintf( opt_string, max_opts, "bc%s%s", tick_string, axis_opts ); plbox( opt_string, ticks, sub_ticks, "bc", 0.0, 0 ); } - else if ( opt_position & PL_POSITION_BOTTOM ) + else if ( position & PL_POSITION_BOTTOM ) { snprintf( opt_string, max_opts, "bc%s%s", tick_string, axis_opts ); plbox( opt_string, ticks, sub_ticks, "bc", 0.0, 0 ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-01-29 23:45:58
|
Revision: 11534 http://plplot.svn.sourceforge.net/plplot/?rev=11534&view=rev Author: airwin Date: 2011-01-29 23:45:49 +0000 (Sat, 29 Jan 2011) Log Message: ----------- PL_COLORBAR_LABEL_UPPER==>PL_COLORBAR_LABEL_TOP PL_COLORBAR_LABEL_LOWER==>PL_COLORBAR_LABEL_BOTTOM PL_COLORBAR_UPPER==>PL_POSITION_TOP PL_COLORBAR_LOWER==>PL_POSITION_BOTTOM PL_COLORBAR_RIGHT==>PL_POSITION_RIGHT PL_COLORBAR_LEFT==>PL_POSITION_LEFT This mass change was done with find, xargs, grep and sed. It is largely untested since default build does not work (because of plcolorbar API change). However, if you use cmake options -DBUILD_TEST=ON -DDEFAULT_NO_BINDINGS=ON, the test_c_psc target does work. Modified Paths: -------------- trunk/bindings/f77/plplot_parameters.fm4 trunk/bindings/f95/plplot_parameters.h trunk/bindings/ocaml/plplot.mli trunk/bindings/ocaml/plplot_core.idl trunk/bindings/octave/plplot_octave_def trunk/bindings/swig-support/plplotcapi.i trunk/examples/c/x33c.c trunk/examples/c++/x33.cc trunk/examples/f77/x33f.fm4 trunk/examples/java/x33.java trunk/examples/octave/x33c.m trunk/examples/python/xw33.py trunk/include/plplot.h trunk/src/pllegend.c Modified: trunk/bindings/f77/plplot_parameters.fm4 =================================================================== --- trunk/bindings/f77/plplot_parameters.fm4 2011-01-29 22:30:37 UTC (rev 11533) +++ trunk/bindings/f77/plplot_parameters.fm4 2011-01-29 23:45:49 UTC (rev 11534) @@ -112,22 +112,22 @@ parameter (PL_LEGEND_BOUNDING_BOX = 64) integer*4 PL_LEGEND_ROW_MAJOR parameter (PL_LEGEND_ROW_MAJOR = 128) - integer*4 PL_COLORBAR_LEFT - parameter (PL_COLORBAR_LEFT = 1) - integer*4 PL_COLORBAR_RIGHT - parameter (PL_COLORBAR_RIGHT = 2) - integer*4 PL_COLORBAR_UPPER - parameter (PL_COLORBAR_UPPER = 4) - integer*4 PL_COLORBAR_LOWER - parameter (PL_COLORBAR_LOWER = 8) + integer*4 PL_POSITION_LEFT + parameter (PL_POSITION_LEFT = 1) + integer*4 PL_POSITION_RIGHT + parameter (PL_POSITION_RIGHT = 2) + integer*4 PL_POSITION_TOP + parameter (PL_POSITION_TOP = 4) + integer*4 PL_POSITION_BOTTOM + parameter (PL_POSITION_BOTTOM = 8) integer*4 PL_COLORBAR_LABEL_LEFT parameter (PL_COLORBAR_LABEL_LEFT = 16) integer*4 PL_COLORBAR_LABEL_RIGHT parameter (PL_COLORBAR_LABEL_RIGHT = 32) - integer*4 PL_COLORBAR_LABEL_UPPER - parameter (PL_COLORBAR_LABEL_UPPER = 64) - integer*4 PL_COLORBAR_LABEL_LOWER - parameter (PL_COLORBAR_LABEL_LOWER = 128) + integer*4 PL_COLORBAR_LABEL_TOP + parameter (PL_COLORBAR_LABEL_TOP = 64) + integer*4 PL_COLORBAR_LABEL_BOTTOM + parameter (PL_COLORBAR_LABEL_BOTTOM = 128) integer*4 PL_COLORBAR_IMAGE parameter (PL_COLORBAR_IMAGE = 256) integer*4 PL_COLORBAR_SHADE Modified: trunk/bindings/f95/plplot_parameters.h =================================================================== --- trunk/bindings/f95/plplot_parameters.h 2011-01-29 22:30:37 UTC (rev 11533) +++ trunk/bindings/f95/plplot_parameters.h 2011-01-29 23:45:49 UTC (rev 11534) @@ -55,14 +55,14 @@ integer, parameter :: PL_LEGEND_BACKGROUND = 32 integer, parameter :: PL_LEGEND_BOUNDING_BOX = 64 integer, parameter :: PL_LEGEND_ROW_MAJOR = 128 - integer, parameter :: PL_COLORBAR_LEFT = 1 - integer, parameter :: PL_COLORBAR_RIGHT = 2 - integer, parameter :: PL_COLORBAR_UPPER = 4 - integer, parameter :: PL_COLORBAR_LOWER = 8 + integer, parameter :: PL_POSITION_LEFT = 1 + integer, parameter :: PL_POSITION_RIGHT = 2 + integer, parameter :: PL_POSITION_TOP = 4 + integer, parameter :: PL_POSITION_BOTTOM = 8 integer, parameter :: PL_COLORBAR_LABEL_LEFT = 16 integer, parameter :: PL_COLORBAR_LABEL_RIGHT = 32 - integer, parameter :: PL_COLORBAR_LABEL_UPPER = 64 - integer, parameter :: PL_COLORBAR_LABEL_LOWER = 128 + integer, parameter :: PL_COLORBAR_LABEL_TOP = 64 + integer, parameter :: PL_COLORBAR_LABEL_BOTTOM = 128 integer, parameter :: PL_COLORBAR_IMAGE = 256 integer, parameter :: PL_COLORBAR_SHADE = 512 integer, parameter :: PL_COLORBAR_GRADIENT = 1024 Modified: trunk/bindings/ocaml/plplot.mli =================================================================== --- trunk/bindings/ocaml/plplot.mli 2011-01-29 22:30:37 UTC (rev 11533) +++ trunk/bindings/ocaml/plplot.mli 2011-01-29 23:45:49 UTC (rev 11534) @@ -572,8 +572,8 @@ and plplot_colorbar_enum = | PL_COLORBAR_LABEL_LEFT | PL_COLORBAR_LABEL_RIGHT - | PL_COLORBAR_LABEL_UPPER - | PL_COLORBAR_LABEL_LOWER + | PL_COLORBAR_LABEL_TOP + | PL_COLORBAR_LABEL_BOTTOM | PL_COLORBAR_IMAGE | PL_COLORBAR_SHADE | PL_COLORBAR_GRADIENT Modified: trunk/bindings/ocaml/plplot_core.idl =================================================================== --- trunk/bindings/ocaml/plplot_core.idl 2011-01-29 22:30:37 UTC (rev 11533) +++ trunk/bindings/ocaml/plplot_core.idl 2011-01-29 23:45:49 UTC (rev 11534) @@ -85,8 +85,8 @@ enum plplot_colorbar_enum { PL_COLORBAR_LABEL_LEFT = 1, PL_COLORBAR_LABEL_RIGHT = 2, - PL_COLORBAR_LABEL_UPPER = 4, - PL_COLORBAR_LABEL_LOWER = 8, + PL_COLORBAR_LABEL_TOP = 4, + PL_COLORBAR_LABEL_BOTTOM = 8, PL_COLORBAR_IMAGE = 16, PL_COLORBAR_SHADE = 32, PL_COLORBAR_GRADIENT = 64, Modified: trunk/bindings/octave/plplot_octave_def =================================================================== --- trunk/bindings/octave/plplot_octave_def 2011-01-29 22:30:37 UTC (rev 11533) +++ trunk/bindings/octave/plplot_octave_def 2011-01-29 23:45:49 UTC (rev 11534) @@ -108,22 +108,22 @@ PL_LEGEND_INSIDE = 4096; global PL_LEGEND_OUTSIDE PL_LEGEND_OUTSIDE = 8192; -global PL_COLORBAR_LEFT -PL_COLORBAR_LEFT = 1; -global PL_COLORBAR_RIGHT -PL_COLORBAR_RIGHT = 2; -global PL_COLORBAR_UPPER -PL_COLORBAR_UPPER = 4; -global PL_COLORBAR_LOWER -PL_COLORBAR_LOWER = 8; +global PL_POSITION_LEFT +PL_POSITION_LEFT = 1; +global PL_POSITION_RIGHT +PL_POSITION_RIGHT = 2; +global PL_POSITION_TOP +PL_POSITION_TOP = 4; +global PL_POSITION_BOTTOM +PL_POSITION_BOTTOM = 8; global PL_COLORBAR_LABEL_LEFT PL_COLORBAR_LABEL_LEFT = 16; global PL_COLORBAR_LABEL_RIGHT PL_COLORBAR_LABEL_RIGHT = 32; -global PL_COLORBAR_LABEL_UPPER -PL_COLORBAR_LABEL_UPPER = 64; -global PL_COLORBAR_LABEL_LOWER -PL_COLORBAR_LABEL_LOWER = 128; +global PL_COLORBAR_LABEL_TOP +PL_COLORBAR_LABEL_TOP = 64; +global PL_COLORBAR_LABEL_BOTTOM +PL_COLORBAR_LABEL_BOTTOM = 128; global PL_COLORBAR_IMAGE PL_COLORBAR_IMAGE = 256; global PL_COLORBAR_SHADE Modified: trunk/bindings/swig-support/plplotcapi.i =================================================================== --- trunk/bindings/swig-support/plplotcapi.i 2011-01-29 22:30:37 UTC (rev 11533) +++ trunk/bindings/swig-support/plplotcapi.i 2011-01-29 23:45:49 UTC (rev 11534) @@ -117,14 +117,14 @@ #define PL_LEGEND_ROW_MAJOR 128 // Flags for plcolorbar -#define PL_COLORBAR_LEFT 1 -#define PL_COLORBAR_RIGHT 2 -#define PL_COLORBAR_UPPER 4 -#define PL_COLORBAR_LOWER 8 +#define PL_POSITION_LEFT 1 +#define PL_POSITION_RIGHT 2 +#define PL_POSITION_TOP 4 +#define PL_POSITION_BOTTOM 8 #define PL_COLORBAR_LABEL_LEFT 16 #define PL_COLORBAR_LABEL_RIGHT 32 -#define PL_COLORBAR_LABEL_UPPER 64 -#define PL_COLORBAR_LABEL_LOWER 128 +#define PL_COLORBAR_LABEL_TOP 64 +#define PL_COLORBAR_LABEL_BOTTOM 128 #define PL_COLORBAR_IMAGE 256 #define PL_COLORBAR_SHADE 512 #define PL_COLORBAR_GRADIENT 1024 Modified: trunk/examples/c/x33c.c =================================================================== --- trunk/examples/c/x33c.c 2011-01-29 22:30:37 UTC (rev 11533) +++ trunk/examples/c/x33c.c 2011-01-29 23:45:49 UTC (rev 11534) @@ -116,7 +116,7 @@ n, colors, values ); position = PL_POSITION_TOP; - opt = bar_type | PL_COLORBAR_LABEL_UPPER | PL_COLORBAR_CAP_HIGH; + opt = bar_type | PL_COLORBAR_LABEL_TOP | PL_COLORBAR_CAP_HIGH; plcolorbar( position, opt, 0.1, 0.1, 0.5, 0.1, cont_color, cont_width, @@ -125,7 +125,7 @@ n, colors, values ); position = PL_POSITION_BOTTOM; - opt = bar_type | PL_COLORBAR_LABEL_LOWER | PL_COLORBAR_CAP_LOW; + opt = bar_type | PL_COLORBAR_LABEL_BOTTOM | PL_COLORBAR_CAP_LOW; plcolorbar( position, opt, 0.4, 0.1, 0.5, 0.1, cont_color, cont_width, @@ -206,7 +206,7 @@ n, colors, values ); position = PL_POSITION_TOP; - opt = bar_type | PL_COLORBAR_LABEL_UPPER | PL_COLORBAR_CAP_LOW; + opt = bar_type | PL_COLORBAR_LABEL_TOP | PL_COLORBAR_CAP_LOW; plcolorbar( position, opt, 0.1, 0.1, 0.5, 0.1, cont_color, cont_width, @@ -215,7 +215,7 @@ n, colors, values ); position = PL_POSITION_BOTTOM; - opt = bar_type | PL_COLORBAR_LABEL_LOWER | PL_COLORBAR_CAP_HIGH; + opt = bar_type | PL_COLORBAR_LABEL_BOTTOM | PL_COLORBAR_CAP_HIGH; plcolorbar( position, opt, 0.4, 0.1, 0.5, 0.1, cont_color, cont_width, Modified: trunk/examples/c++/x33.cc =================================================================== --- trunk/examples/c++/x33.cc 2011-01-29 22:30:37 UTC (rev 11533) +++ trunk/examples/c++/x33.cc 2011-01-29 23:45:49 UTC (rev 11534) @@ -100,7 +100,7 @@ } PLINT opt; - opt = PL_COLORBAR_LEFT | bar_type | PL_COLORBAR_LABEL_LEFT | + opt = PL_POSITION_LEFT | bar_type | PL_COLORBAR_LABEL_LEFT | PL_COLORBAR_CAP_HIGH; const char *axis_opts_1, *axis_opts_2; @@ -128,7 +128,7 @@ axis_opts_1, "Test label - Left, High Cap", n, colors, values ); - opt = PL_COLORBAR_RIGHT | bar_type | PL_COLORBAR_LABEL_RIGHT | + opt = PL_POSITION_RIGHT | bar_type | PL_COLORBAR_LABEL_RIGHT | PL_COLORBAR_CAP_LOW; pls->colorbar( opt, 0.1, 0.4, 0.5, 0.1, @@ -136,7 +136,7 @@ axis_opts_1, "Test label - Right, Low Cap", n, colors, values ); - opt = PL_COLORBAR_UPPER | bar_type | PL_COLORBAR_LABEL_UPPER | + opt = PL_POSITION_TOP | bar_type | PL_COLORBAR_LABEL_TOP | PL_COLORBAR_CAP_HIGH; pls->colorbar( opt, 0.1, 0.1, 0.5, 0.1, @@ -144,7 +144,7 @@ axis_opts_2, "Test label - Upper, High Cap", n, colors, values ); - opt = PL_COLORBAR_LOWER | bar_type | PL_COLORBAR_LABEL_LOWER | + opt = PL_POSITION_BOTTOM | bar_type | PL_COLORBAR_LABEL_BOTTOM | PL_COLORBAR_CAP_LOW; pls->colorbar( opt, 0.4, 0.1, 0.5, 0.1, @@ -174,7 +174,7 @@ } PLINT opt; - opt = PL_COLORBAR_LEFT | bar_type | PL_COLORBAR_LABEL_LEFT | + opt = PL_POSITION_LEFT | bar_type | PL_COLORBAR_LABEL_LEFT | PL_COLORBAR_CAP_LOW; const char *axis_opts_1, *axis_opts_2; @@ -202,7 +202,7 @@ axis_opts_1, "Test label - Left, Low Cap", n, colors, values ); - opt = PL_COLORBAR_RIGHT | bar_type | PL_COLORBAR_LABEL_RIGHT | + opt = PL_POSITION_RIGHT | bar_type | PL_COLORBAR_LABEL_RIGHT | PL_COLORBAR_CAP_HIGH; pls->colorbar( opt, 0.1, 0.4, 0.5, 0.1, @@ -210,7 +210,7 @@ axis_opts_1, "Test label - Right, High Cap", n, colors, values ); - opt = PL_COLORBAR_UPPER | bar_type | PL_COLORBAR_LABEL_UPPER | + opt = PL_POSITION_TOP | bar_type | PL_COLORBAR_LABEL_TOP | PL_COLORBAR_CAP_LOW; pls->colorbar( opt, 0.1, 0.1, 0.5, 0.1, @@ -218,7 +218,7 @@ axis_opts_2, "Test label - Upper, Low Cap", n, colors, values ); - opt = PL_COLORBAR_LOWER | bar_type | PL_COLORBAR_LABEL_LOWER | + opt = PL_POSITION_BOTTOM | bar_type | PL_COLORBAR_LABEL_BOTTOM | PL_COLORBAR_CAP_HIGH; pls->colorbar( opt, 0.4, 0.1, 0.5, 0.1, Modified: trunk/examples/f77/x33f.fm4 =================================================================== --- trunk/examples/f77/x33f.fm4 2011-01-29 22:30:37 UTC (rev 11533) +++ trunk/examples/f77/x33f.fm4 2011-01-29 23:45:49 UTC (rev 11534) @@ -695,7 +695,7 @@ } integer opt - opt = PL_COLORBAR_LEFT + bar_type + PL_COLORBAR_LABEL_LEFT + + opt = PL_POSITION_LEFT + bar_type + PL_COLORBAR_LABEL_LEFT + & PL_COLORBAR_CAP_HIGH const char *axis_opts_1, *axis_opts_2 @@ -723,7 +723,7 @@ & axis_opts_1, 'Test label - Left, High Cap', & n, colors, values ) - opt = PL_COLORBAR_RIGHT + bar_type + PL_COLORBAR_LABEL_RIGHT + + opt = PL_POSITION_RIGHT + bar_type + PL_COLORBAR_LABEL_RIGHT + PL_COLORBAR_CAP_LOW call plcolorbar( opt, 0.1d0, 0.4d0, 0.5d0, 0.1d0, @@ -731,7 +731,7 @@ & axis_opts_1, 'Test label - Right, Low Cap', & n, colors, values ) - opt = PL_COLORBAR_UPPER + bar_type + PL_COLORBAR_LABEL_UPPER + + opt = PL_POSITION_TOP + bar_type + PL_COLORBAR_LABEL_TOP + & PL_COLORBAR_CAP_HIGH call plcolorbar( opt, 0.1d0, 0.1d0, 0.5d0, 0.1d0, @@ -739,7 +739,7 @@ & axis_opts_2, 'Test label - Upper, High Cap', & n, colors, values ) - opt = PL_COLORBAR_LOWER + bar_type + PL_COLORBAR_LABEL_LOWER + + opt = PL_POSITION_BOTTOM + bar_type + PL_COLORBAR_LABEL_BOTTOM + & PL_COLORBAR_CAP_LOW call plcolorbar( opt, 0.4d0, 0.1d0, 0.5d0, 0.1d0, @@ -769,7 +769,7 @@ } integer opt - opt = PL_COLORBAR_LEFT + bar_type + PL_COLORBAR_LABEL_LEFT + + opt = PL_POSITION_LEFT + bar_type + PL_COLORBAR_LABEL_LEFT + PL_COLORBAR_CAP_LOW const char *axis_opts_1, *axis_opts_2 @@ -797,7 +797,7 @@ axis_opts_1, 'Test label - Left, Low Cap', n, colors, values ) - opt = PL_COLORBAR_RIGHT + bar_type + PL_COLORBAR_LABEL_RIGHT + + opt = PL_POSITION_RIGHT + bar_type + PL_COLORBAR_LABEL_RIGHT + PL_COLORBAR_CAP_HIGH call plcolorbar( opt, 0.1d0, 0.4d0, 0.5d0, 0.1d0, @@ -805,7 +805,7 @@ axis_opts_1, 'Test label - Right, High Cap', n, colors, values ) - opt = PL_COLORBAR_UPPER + bar_type + PL_COLORBAR_LABEL_UPPER + + opt = PL_POSITION_TOP + bar_type + PL_COLORBAR_LABEL_TOP + PL_COLORBAR_CAP_LOW call plcolorbar( opt, 0.1d0, 0.1d0, 0.5d0, 0.1d0, @@ -813,7 +813,7 @@ axis_opts_2, 'Test label - Upper, Low Cap', n, colors, values ) - opt = PL_COLORBAR_LOWER + bar_type + PL_COLORBAR_LABEL_LOWER + + opt = PL_POSITION_BOTTOM + bar_type + PL_COLORBAR_LABEL_BOTTOM + PL_COLORBAR_CAP_HIGH call plcolorbar( opt, 0.4d0, 0.1d0, 0.5d0, 0.1d0, Modified: trunk/examples/java/x33.java =================================================================== --- trunk/examples/java/x33.java 2011-01-29 22:30:37 UTC (rev 11533) +++ trunk/examples/java/x33.java 2011-01-29 23:45:49 UTC (rev 11534) @@ -71,7 +71,7 @@ } int opt; - opt = PLStream.PL_COLORBAR_LEFT | bar_type | PLStream.PL_COLORBAR_LABEL_LEFT | + opt = PLStream.PL_POSITION_LEFT | bar_type | PLStream.PL_COLORBAR_LABEL_LEFT | PLStream.PL_COLORBAR_CAP_HIGH; String axis_opts_1, axis_opts_2; @@ -99,7 +99,7 @@ axis_opts_1, "Test label - Left, High Cap", colors, values ); - opt = PLStream.PL_COLORBAR_RIGHT | bar_type | PLStream.PL_COLORBAR_LABEL_RIGHT | + opt = PLStream.PL_POSITION_RIGHT | bar_type | PLStream.PL_COLORBAR_LABEL_RIGHT | PLStream.PL_COLORBAR_CAP_LOW; pls.colorbar( opt, 0.1, 0.4, 0.5, 0.1, @@ -107,7 +107,7 @@ axis_opts_1, "Test label - Right, Low Cap", colors, values ); - opt = PLStream.PL_COLORBAR_UPPER | bar_type | PLStream.PL_COLORBAR_LABEL_UPPER | + opt = PLStream.PL_POSITION_TOP | bar_type | PLStream.PL_COLORBAR_LABEL_TOP | PLStream.PL_COLORBAR_CAP_HIGH; pls.colorbar( opt, 0.1, 0.1, 0.5, 0.1, @@ -115,7 +115,7 @@ axis_opts_2, "Test label - Upper, High Cap", colors, values ); - opt = PLStream.PL_COLORBAR_LOWER | bar_type | PLStream.PL_COLORBAR_LABEL_LOWER | + opt = PLStream.PL_POSITION_BOTTOM | bar_type | PLStream.PL_COLORBAR_LABEL_BOTTOM | PLStream.PL_COLORBAR_CAP_LOW; pls.colorbar( opt, 0.4, 0.1, 0.5, 0.1, @@ -144,7 +144,7 @@ } int opt; - opt = PLStream.PL_COLORBAR_LEFT | bar_type | PLStream.PL_COLORBAR_LABEL_LEFT | + opt = PLStream.PL_POSITION_LEFT | bar_type | PLStream.PL_COLORBAR_LABEL_LEFT | PLStream.PL_COLORBAR_CAP_LOW; String axis_opts_1, axis_opts_2; @@ -172,7 +172,7 @@ axis_opts_1, "Test label - Left, Low Cap", colors, values ); - opt = PLStream.PL_COLORBAR_RIGHT | bar_type | PLStream.PL_COLORBAR_LABEL_RIGHT | + opt = PLStream.PL_POSITION_RIGHT | bar_type | PLStream.PL_COLORBAR_LABEL_RIGHT | PLStream.PL_COLORBAR_CAP_HIGH; pls.colorbar( opt, 0.1, 0.4, 0.5, 0.1, @@ -180,7 +180,7 @@ axis_opts_1, "Test label - Right, High Cap", colors, values ); - opt = PLStream.PL_COLORBAR_UPPER | bar_type | PLStream.PL_COLORBAR_LABEL_UPPER | + opt = PLStream.PL_POSITION_TOP | bar_type | PLStream.PL_COLORBAR_LABEL_TOP | PLStream.PL_COLORBAR_CAP_LOW; pls.colorbar( opt, 0.1, 0.1, 0.5, 0.1, @@ -188,7 +188,7 @@ axis_opts_2, "Test label - Upper, Low Cap", colors, values ); - opt = PLStream.PL_COLORBAR_LOWER | bar_type | PLStream.PL_COLORBAR_LABEL_LOWER | + opt = PLStream.PL_POSITION_BOTTOM | bar_type | PLStream.PL_COLORBAR_LABEL_BOTTOM | PLStream.PL_COLORBAR_CAP_HIGH; pls.colorbar( opt, 0.4, 0.1, 0.5, 0.1, Modified: trunk/examples/octave/x33c.m =================================================================== --- trunk/examples/octave/x33c.m 2011-01-29 22:30:37 UTC (rev 11533) +++ trunk/examples/octave/x33c.m 2011-01-29 23:45:49 UTC (rev 11534) @@ -59,7 +59,7 @@ ]; function plcolorbar_example_1( bar_type, ticks, sub_ticks, values, title ) - global PL_COLORBAR_LEFT PL_COLORBAR_LABEL_LEFT PL_COLORBAR_CAP_HIGH PL_COLORBAR_SHADE_LABEL PL_COLORBAR_RIGHT PL_COLORBAR_LABEL_RIGHT PL_COLORBAR_CAP_LOW PL_COLORBAR_UPPER PL_COLORBAR_LABEL_UPPER PL_COLORBAR_CAP_HIGH PL_COLORBAR_LOWER PL_COLORBAR_LABEL_LOWER PL_COLORBAR_CAP_LOW + global PL_POSITION_LEFT PL_COLORBAR_LABEL_LEFT PL_COLORBAR_CAP_HIGH PL_COLORBAR_SHADE_LABEL PL_POSITION_RIGHT PL_COLORBAR_LABEL_RIGHT PL_COLORBAR_CAP_LOW PL_POSITION_TOP PL_COLORBAR_LABEL_TOP PL_COLORBAR_CAP_HIGH PL_POSITION_BOTTOM PL_COLORBAR_LABEL_BOTTOM PL_COLORBAR_CAP_LOW pladv( 0 ); ## Setup color palette 1 plspal1( "cmap1_blue_red.pal", 1 ); @@ -68,7 +68,7 @@ color_step = 1.0 / (n - 1); colors = (0:n-1)'*color_step; - opt = bitor(PL_COLORBAR_LEFT, bitor(bar_type, bitor(PL_COLORBAR_LABEL_LEFT, PL_COLORBAR_CAP_HIGH))); + opt = bitor(PL_POSITION_LEFT, bitor(bar_type, bitor(PL_COLORBAR_LABEL_LEFT, PL_COLORBAR_CAP_HIGH))); if (bitand(bar_type, PL_COLORBAR_SHADE_LABEL)) axis_opts_1 = "iv"; @@ -88,21 +88,21 @@ axis_opts_1, "Test label - Left, High Cap", colors, values ); - opt = bitor(PL_COLORBAR_RIGHT, bitor(bar_type, bitor(PL_COLORBAR_LABEL_RIGHT, PL_COLORBAR_CAP_LOW))); + opt = bitor(PL_POSITION_RIGHT, bitor(bar_type, bitor(PL_COLORBAR_LABEL_RIGHT, PL_COLORBAR_CAP_LOW))); plcolorbar( opt, 0.1, 0.4, 0.5, 0.1, ticks, sub_ticks, axis_opts_1, "Test label - Right, Low Cap", colors, values ); - opt = bitor(PL_COLORBAR_UPPER, bitor(bar_type, bitor(PL_COLORBAR_LABEL_UPPER, PL_COLORBAR_CAP_HIGH))); + opt = bitor(PL_POSITION_TOP, bitor(bar_type, bitor(PL_COLORBAR_LABEL_TOP, PL_COLORBAR_CAP_HIGH))); plcolorbar( opt, 0.1, 0.1, 0.5, 0.1, ticks, sub_ticks, axis_opts_2, "Test label - Upper, High Cap", colors, values ); - opt = bitor(PL_COLORBAR_LOWER, bitor(bar_type, bitor(PL_COLORBAR_LABEL_LOWER, PL_COLORBAR_CAP_LOW))); + opt = bitor(PL_POSITION_BOTTOM, bitor(bar_type, bitor(PL_COLORBAR_LABEL_BOTTOM, PL_COLORBAR_CAP_LOW))); plcolorbar( opt, 0.4, 0.1, 0.5, 0.1, ticks, sub_ticks, @@ -115,7 +115,7 @@ endfunction function plcolorbar_example_2( bar_type, ticks, sub_ticks, values, title ) - global PL_COLORBAR_LEFT PL_COLORBAR_LABEL_LEFT PL_COLORBAR_CAP_HIGH PL_COLORBAR_SHADE_LABEL PL_COLORBAR_RIGHT PL_COLORBAR_LABEL_RIGHT PL_COLORBAR_CAP_LOW PL_COLORBAR_UPPER PL_COLORBAR_LABEL_UPPER PL_COLORBAR_CAP_HIGH PL_COLORBAR_LOWER PL_COLORBAR_LABEL_LOWER PL_COLORBAR_CAP_LOW + global PL_POSITION_LEFT PL_COLORBAR_LABEL_LEFT PL_COLORBAR_CAP_HIGH PL_COLORBAR_SHADE_LABEL PL_POSITION_RIGHT PL_COLORBAR_LABEL_RIGHT PL_COLORBAR_CAP_LOW PL_POSITION_TOP PL_COLORBAR_LABEL_TOP PL_COLORBAR_CAP_HIGH PL_POSITION_BOTTOM PL_COLORBAR_LABEL_BOTTOM PL_COLORBAR_CAP_LOW pladv( 0 ); ## Setup color palette 1 plspal1( "cmap1_blue_yellow.pal", 1 ); @@ -123,7 +123,7 @@ n = length(values); color_step = 1.0 / (n - 1); colors = (0:n-1)'*color_step; - opt = bitor(PL_COLORBAR_LEFT, bitor(bar_type, bitor(PL_COLORBAR_LABEL_LEFT, PL_COLORBAR_CAP_LOW))); + opt = bitor(PL_POSITION_LEFT, bitor(bar_type, bitor(PL_COLORBAR_LABEL_LEFT, PL_COLORBAR_CAP_LOW))); if (bar_type == PL_COLORBAR_SHADE_LABEL) axis_opts_1 = ""; @@ -143,21 +143,21 @@ axis_opts_1, "Test label - Left, Low Cap", colors, values ); - opt = bitor(PL_COLORBAR_RIGHT, bitor(bar_type, bitor(PL_COLORBAR_LABEL_RIGHT, PL_COLORBAR_CAP_HIGH))); + opt = bitor(PL_POSITION_RIGHT, bitor(bar_type, bitor(PL_COLORBAR_LABEL_RIGHT, PL_COLORBAR_CAP_HIGH))); plcolorbar( opt, 0.1, 0.4, 0.5, 0.1, ticks, sub_ticks, axis_opts_1, "Test label - Right, High Cap", colors, values ); - opt = bitor(PL_COLORBAR_UPPER, bitor(bar_type, bitor(PL_COLORBAR_LABEL_UPPER, PL_COLORBAR_CAP_LOW))); + opt = bitor(PL_POSITION_TOP, bitor(bar_type, bitor(PL_COLORBAR_LABEL_TOP, PL_COLORBAR_CAP_LOW))); plcolorbar( opt, 0.1, 0.1, 0.5, 0.1, ticks, sub_ticks, axis_opts_2, "Test label - Upper, Low Cap", colors, values ); - opt = bitor(PL_COLORBAR_LOWER, bitor(bar_type, bitor(PL_COLORBAR_LABEL_LOWER, PL_COLORBAR_CAP_HIGH))); + opt = bitor(PL_POSITION_BOTTOM, bitor(bar_type, bitor(PL_COLORBAR_LABEL_BOTTOM, PL_COLORBAR_CAP_HIGH))); plcolorbar( opt, 0.4, 0.1, 0.5, 0.1, ticks, sub_ticks, Modified: trunk/examples/python/xw33.py =================================================================== --- trunk/examples/python/xw33.py 2011-01-29 22:30:37 UTC (rev 11533) +++ trunk/examples/python/xw33.py 2011-01-29 23:45:49 UTC (rev 11534) @@ -66,7 +66,7 @@ color_step = 1.0 / float(n - 1) colors = color_step*arange(n) - opt = PL_COLORBAR_LEFT | bar_type | PL_COLORBAR_LABEL_LEFT | PL_COLORBAR_CAP_HIGH + opt = PL_POSITION_LEFT | bar_type | PL_COLORBAR_LABEL_LEFT | PL_COLORBAR_CAP_HIGH if bar_type & PL_COLORBAR_SHADE_LABEL: axis_opts_1 = "iv" @@ -84,21 +84,21 @@ axis_opts_1, "Test label - Left, High Cap", colors, values ) - opt = PL_COLORBAR_RIGHT | bar_type | PL_COLORBAR_LABEL_RIGHT | PL_COLORBAR_CAP_LOW + opt = PL_POSITION_RIGHT | bar_type | PL_COLORBAR_LABEL_RIGHT | PL_COLORBAR_CAP_LOW plcolorbar( opt, 0.1, 0.4, 0.5, 0.1, ticks, sub_ticks, axis_opts_1, "Test label - Right, Low Cap", colors, values ) - opt = PL_COLORBAR_UPPER | bar_type | PL_COLORBAR_LABEL_UPPER | PL_COLORBAR_CAP_HIGH + opt = PL_POSITION_TOP | bar_type | PL_COLORBAR_LABEL_TOP | PL_COLORBAR_CAP_HIGH plcolorbar( opt, 0.1, 0.1, 0.5, 0.1, ticks, sub_ticks, axis_opts_2, "Test label - Upper, High Cap", colors, values ) - opt = PL_COLORBAR_LOWER | bar_type | PL_COLORBAR_LABEL_LOWER | PL_COLORBAR_CAP_LOW + opt = PL_POSITION_BOTTOM | bar_type | PL_COLORBAR_LABEL_BOTTOM | PL_COLORBAR_CAP_LOW plcolorbar( opt, 0.4, 0.1, 0.5, 0.1, ticks, sub_ticks, @@ -117,7 +117,7 @@ n = len(values) color_step = 1.0 / float(n - 1) colors = color_step*arange(n) - opt = PL_COLORBAR_LEFT | bar_type | PL_COLORBAR_LABEL_LEFT | PL_COLORBAR_CAP_LOW + opt = PL_POSITION_LEFT | bar_type | PL_COLORBAR_LABEL_LEFT | PL_COLORBAR_CAP_LOW if bar_type == PL_COLORBAR_SHADE_LABEL: axis_opts_1 = "" @@ -135,21 +135,21 @@ axis_opts_1, "Test label - Left, Low Cap", colors, values ) - opt = PL_COLORBAR_RIGHT | bar_type | PL_COLORBAR_LABEL_RIGHT | PL_COLORBAR_CAP_HIGH + opt = PL_POSITION_RIGHT | bar_type | PL_COLORBAR_LABEL_RIGHT | PL_COLORBAR_CAP_HIGH plcolorbar( opt, 0.1, 0.4, 0.5, 0.1, ticks, sub_ticks, axis_opts_1, "Test label - Right, High Cap", colors, values ) - opt = PL_COLORBAR_UPPER | bar_type | PL_COLORBAR_LABEL_UPPER | PL_COLORBAR_CAP_LOW + opt = PL_POSITION_TOP | bar_type | PL_COLORBAR_LABEL_TOP | PL_COLORBAR_CAP_LOW plcolorbar( opt, 0.1, 0.1, 0.5, 0.1, ticks, sub_ticks, axis_opts_2, "Test label - Upper, Low Cap", colors, values ) - opt = PL_COLORBAR_LOWER | bar_type | PL_COLORBAR_LABEL_LOWER | PL_COLORBAR_CAP_HIGH + opt = PL_POSITION_BOTTOM | bar_type | PL_COLORBAR_LABEL_BOTTOM | PL_COLORBAR_CAP_HIGH plcolorbar( opt, 0.4, 0.1, 0.5, 0.1, ticks, sub_ticks, Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2011-01-29 22:30:37 UTC (rev 11533) +++ trunk/include/plplot.h 2011-01-29 23:45:49 UTC (rev 11534) @@ -1232,8 +1232,8 @@ // Flags for plcolorbar #define PL_COLORBAR_LABEL_LEFT 1 #define PL_COLORBAR_LABEL_RIGHT 2 -#define PL_COLORBAR_LABEL_UPPER 4 -#define PL_COLORBAR_LABEL_LOWER 8 +#define PL_COLORBAR_LABEL_TOP 4 +#define PL_COLORBAR_LABEL_BOTTOM 8 #define PL_COLORBAR_IMAGE 16 #define PL_COLORBAR_SHADE 32 #define PL_COLORBAR_GRADIENT 64 Modified: trunk/src/pllegend.c =================================================================== --- trunk/src/pllegend.c 2011-01-29 22:30:37 UTC (rev 11533) +++ trunk/src/pllegend.c 2011-01-29 23:45:49 UTC (rev 11534) @@ -1231,7 +1231,7 @@ // Add an extra offset for the label so it does not bump in to the // cap. if ( ( ( position & PL_POSITION_LEFT || position & PL_POSITION_RIGHT ) && - opt & PL_COLORBAR_LABEL_LOWER ) || + opt & PL_COLORBAR_LABEL_BOTTOM ) || ( ( position & PL_POSITION_TOP || position & PL_POSITION_BOTTOM ) && opt & PL_COLORBAR_LABEL_LEFT ) ) { @@ -1245,7 +1245,7 @@ // Add an extra offset for the label so it does not bump in to the // cap. if ( ( ( position & PL_POSITION_LEFT || position & PL_POSITION_RIGHT ) && - opt & PL_COLORBAR_LABEL_UPPER ) || + opt & PL_COLORBAR_LABEL_TOP ) || ( ( position & PL_POSITION_TOP || position & PL_POSITION_BOTTOM ) && opt & PL_COLORBAR_LABEL_RIGHT ) ) { @@ -1300,7 +1300,7 @@ snprintf( opt_string, max_opts, "r%c", perp ); plmtex( opt_string, label_offset, 0.5, 0.5, label ); } - else if ( opt & PL_COLORBAR_LABEL_UPPER ) + else if ( opt & PL_COLORBAR_LABEL_TOP ) { if ( position & PL_POSITION_RIGHT || position & PL_POSITION_LEFT ) { @@ -1315,7 +1315,7 @@ snprintf( opt_string, max_opts, "t%c", perp ); plmtex( opt_string, label_offset, 0.5, 0.5, label ); } - else if ( opt & PL_COLORBAR_LABEL_LOWER ) + else if ( opt & PL_COLORBAR_LABEL_BOTTOM ) { if ( position & PL_POSITION_RIGHT || position & PL_POSITION_LEFT ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-01-30 22:48:44
|
Revision: 11540 http://plplot.svn.sourceforge.net/plplot/?rev=11540&view=rev Author: airwin Date: 2011-01-30 22:48:38 +0000 (Sun, 30 Jan 2011) Log Message: ----------- Disable plcolorbar for all but C and OCaml as a temporary measure to make on-going development of plcolorbar easier while allowing example 33 tests of pllegend against the C example with plcolorbar pages ignored by default. Modified Paths: -------------- trunk/bindings/java/PLStream.java trunk/bindings/swig-support/plplotcapi.i trunk/examples/java/x33.java trunk/examples/octave/x33c.m trunk/examples/python/xw33.py Modified: trunk/bindings/java/PLStream.java =================================================================== --- trunk/bindings/java/PLStream.java 2011-01-30 22:46:02 UTC (rev 11539) +++ trunk/bindings/java/PLStream.java 2011-01-30 22:48:38 UTC (rev 11540) @@ -554,6 +554,7 @@ symbol_numbers, symbols ); } + /* public void colorbar( int opt, double x, double y, double length, double width, double ticks, double subticks, String axis_opts, String label, @@ -563,6 +564,7 @@ plplotjavac.plcolorbar( opt, x, y, length, width, ticks, subticks, axis_opts, label, colors, values ); } + */ public void lightsource( double x, double y, double z ) { Modified: trunk/bindings/swig-support/plplotcapi.i =================================================================== --- trunk/bindings/swig-support/plplotcapi.i 2011-01-30 22:46:02 UTC (rev 11539) +++ trunk/bindings/swig-support/plplotcapi.i 2011-01-30 22:48:38 UTC (rev 11540) @@ -492,11 +492,13 @@ const PLINT *ArrayCkNull, const PLFLT *ArrayCkNull, const PLINT *ArrayCkNull, const char **ArrayCk ); +#if 0 void plcolorbar( PLINT opt, PLFLT x, PLFLT y, PLFLT length, PLFLT width, PLFLT ticks, PLFLT sub_ticks, const char *axis_opts, const char *label, PLINT n, PLFLT *Array, PLFLT *ArrayCk ); +#endif void pllightsource( PLFLT x, PLFLT y, PLFLT z ); Modified: trunk/examples/java/x33.java =================================================================== --- trunk/examples/java/x33.java 2011-01-30 22:46:02 UTC (rev 11539) +++ trunk/examples/java/x33.java 2011-01-30 22:48:38 UTC (rev 11540) @@ -55,6 +55,7 @@ "✦" }; + /* void plcolorbar_example_1( int bar_type, double ticks, int sub_ticks, int n, double[] values, String title ) { pls.adv( 0 ); @@ -200,7 +201,7 @@ pls.wind( 0.0, 1.0, 0.0, 1.0 ); pls.ptex( 0.5, 0.5, 0.0, 0.0, 0.5, title ); } - + */ //-------------------------------------------------------------------------- // x33 // @@ -829,6 +830,7 @@ null, null, null, null ); max_height = Math.max( max_height, legend_height[0] ); + /* // Color bar examples double[] values_small = { 0.0, 1.0 }; double[] values_uneven = { 0.0, 2.0, 2.6, 3.4, 6.0, 7.0, 8.0, 9.0, 10.0 }; @@ -843,6 +845,7 @@ "Gradient Color Bars" ); plcolorbar_example_2( PLStream.PL_COLORBAR_GRADIENT, 0.5, 5, 2, values_small, "Gradient Color Bars" ); + */ pls.end(); } Modified: trunk/examples/octave/x33c.m =================================================================== --- trunk/examples/octave/x33c.m 2011-01-30 22:46:02 UTC (rev 11539) +++ trunk/examples/octave/x33c.m 2011-01-30 22:48:38 UTC (rev 11540) @@ -877,6 +877,7 @@ [], [], [], [] ); max_height = max(max_height, legend_height); +if(0== 1) ## Color bar examples values_small = [ 0.0; 1.0 ]; values_uneven = [ 0.0; 2.0; 2.6; 3.4; 6.0; 7.0; 8.0; 9.0; 10.0 ]; @@ -887,6 +888,7 @@ plcolorbar_example_2( PL_COLORBAR_SHADE, 3.0, 3, values_even, "Shade Color Bars - Even Steps" ); plcolorbar_example_1( PL_COLORBAR_GRADIENT, 0.5, 5, values_small, "Gradient Color Bars" ); plcolorbar_example_2( PL_COLORBAR_GRADIENT, 0.5, 5, values_small, "Gradient Color Bars" ); +endif plend1(); endfunction Modified: trunk/examples/python/xw33.py =================================================================== --- trunk/examples/python/xw33.py 2011-01-30 22:46:02 UTC (rev 11539) +++ trunk/examples/python/xw33.py 2011-01-30 22:48:38 UTC (rev 11540) @@ -699,14 +699,15 @@ symbol_colors, symbol_scales, symbol_numbers, symbols ) max_height = max(max_height, legend_height) - # Color bar examples - values_small = [ 0.0, 1.0 ] - values_uneven = [ 0.0, 2.0, 2.6, 3.4, 6.0, 7.0, 8.0, 9.0, 10.0 ] - values_even = [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] - plcolorbar_example_1( PL_COLORBAR_IMAGE, 0.0, 0, values_small, "Image Color Bars" ) - plcolorbar_example_2( PL_COLORBAR_IMAGE, 0.0, 0, values_small, "Image Color Bars" ) - plcolorbar_example_1( PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0.0, 0, values_uneven, "Shade Color Bars - Uneven Steps" ) - plcolorbar_example_2( PL_COLORBAR_SHADE, 3.0, 3, values_even, "Shade Color Bars - Even Steps" ) - plcolorbar_example_1( PL_COLORBAR_GRADIENT, 0.5, 5, values_small, "Gradient Color Bars" ) - plcolorbar_example_2( PL_COLORBAR_GRADIENT, 0.5, 5, values_small, "Gradient Color Bars" ) + if False: + # Color bar examples + values_small = [ 0.0, 1.0 ] + values_uneven = [ 0.0, 2.0, 2.6, 3.4, 6.0, 7.0, 8.0, 9.0, 10.0 ] + values_even = [ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] + plcolorbar_example_1( PL_COLORBAR_IMAGE, 0.0, 0, values_small, "Image Color Bars" ) + plcolorbar_example_2( PL_COLORBAR_IMAGE, 0.0, 0, values_small, "Image Color Bars" ) + plcolorbar_example_1( PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0.0, 0, values_uneven, "Shade Color Bars - Uneven Steps" ) + plcolorbar_example_2( PL_COLORBAR_SHADE, 3.0, 3, values_even, "Shade Color Bars - Even Steps" ) + plcolorbar_example_1( PL_COLORBAR_GRADIENT, 0.5, 5, values_small, "Gradient Color Bars" ) + plcolorbar_example_2( PL_COLORBAR_GRADIENT, 0.5, 5, values_small, "Gradient Color Bars" ) main() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arj...@us...> - 2011-02-01 07:32:03
|
Revision: 11542 http://plplot.svn.sourceforge.net/plplot/?rev=11542&view=rev Author: arjenmarkus Date: 2011-02-01 07:31:56 +0000 (Tue, 01 Feb 2011) Log Message: ----------- Further work on interfaces to pllegend and plcolorbar for Fortran 77. Example 33 is not ready yet (so leave it out of the build for now) Modified Paths: -------------- trunk/bindings/f77/plplotf77.def trunk/bindings/f77/plplotf77_ifort.def trunk/bindings/f77/plplotf77_mingw.def trunk/bindings/f77/plstubs.h trunk/bindings/f77/scstubs.c trunk/bindings/f77/sfstubs.fm4 trunk/examples/f77/x33f.fm4 Modified: trunk/bindings/f77/plplotf77.def =================================================================== --- trunk/bindings/f77/plplotf77.def 2011-01-31 08:26:36 UTC (rev 11541) +++ trunk/bindings/f77/plplotf77.def 2011-02-01 07:31:56 UTC (rev 11542) @@ -3,6 +3,7 @@ _PLAXES@40 _PLBOX3@72 _PLBOX@32 + _PLCOLORBAR@48 _PLCON0@36 _PLCON1@44 _PLCON2@44 Modified: trunk/bindings/f77/plplotf77_ifort.def =================================================================== --- trunk/bindings/f77/plplotf77_ifort.def 2011-01-31 08:26:36 UTC (rev 11541) +++ trunk/bindings/f77/plplotf77_ifort.def 2011-02-01 07:31:56 UTC (rev 11542) @@ -3,6 +3,7 @@ PLAXES PLBOX3 PLBOX + PLCOLORBAR PLCON0 PLCON1 PLCON2 Modified: trunk/bindings/f77/plplotf77_mingw.def =================================================================== --- trunk/bindings/f77/plplotf77_mingw.def 2011-01-31 08:26:36 UTC (rev 11541) +++ trunk/bindings/f77/plplotf77_mingw.def 2011-02-01 07:31:56 UTC (rev 11542) @@ -5,6 +5,7 @@ plaxes_ plbox3_ plbox_ + plcolorbar_ plcon0_ plcon1_ plcon2_ Modified: trunk/bindings/f77/plstubs.h =================================================================== --- trunk/bindings/f77/plstubs.h 2011-01-31 08:26:36 UTC (rev 11541) +++ trunk/bindings/f77/plstubs.h 2011-02-01 07:31:56 UTC (rev 11542) @@ -186,6 +186,7 @@ #define PLCOL FNAME( PLCOL, plcol ) #define PLCOL0 FNAME( PLCOL0, plcol0 ) #define PLCOL1 FNAME( PLCOL1, plcol1 ) +#define PLCOLORBAR FNAME( PLCOLORBAR7, plcolorbar7 ) #define PLCONFIGTIME FNAME( PLCONFIGTIME, plconfigtime ) #define PLCON07 FNAME( PLCON07, plcon07 ) #define PLCON17 FNAME( PLCON17, plcon17 ) Modified: trunk/bindings/f77/scstubs.c =================================================================== --- trunk/bindings/f77/scstubs.c 2011-01-31 08:26:36 UTC (rev 11541) +++ trunk/bindings/f77/scstubs.c 2011-02-01 07:31:56 UTC (rev 11542) @@ -176,6 +176,15 @@ } void +PLCOLORBAR( PLINT *position, PLINT *opt, PLFLT *x, PLFLT *y, PLFLT *length, PLFLT *width, + PLINT *cont_color, PLINT *cont_width, PLFLT *ticks, PLINT *sub_ticks, + char *axis_opts, char *label, PLINT *n_colors, PLFLT *colors, PLFLT *values ) +{ + c_plcolorbar( *position, *opt, *x, *y, *length, *width, *cont_color, *cont_width, *ticks, *sub_ticks, + axis_opts, label, *n_colors, colors, values ); +} + +void PLCONFIGTIME( PLFLT *scale, PLFLT *offset1, PLFLT *offset2, PLINT *ccontrol, PLBOOL *ifbtime_offset, PLINT *year, PLINT *month, PLINT *day, PLINT *hour, PLINT *min, PLFLT *sec ) { c_plconfigtime( *scale, *offset1, *offset2, *ccontrol, *ifbtime_offset, *year, *month, *day, *hour, *min, *sec ); @@ -531,6 +540,7 @@ { p_string[j] = data + j * ( length + 1 ); memcpy( p_string[j], &string[j * length], length ); + p_string[j][length] = '\0'; i = length - 1; while ( ( i >= 0 ) && ( p_string[j][i] == ' ' ) ) i--; @@ -563,20 +573,20 @@ const PLINT *symbol_colors, const PLFLT *symbol_scales, const PLINT *symbol_numbers ) { - c_pllegend( p_legend_width, p_legend_height, - *position, *opt, *x, *y, *plot_width, - *bg_color, *bb_color, *bb_style, - *nrow, *ncolumn, - *nlegend, opt_array, - *text_offset, *text_scale, *text_spacing, - *text_justification, - text_colors, pllegend_text, - box_colors, box_patterns, - box_scales, box_line_widths, - line_colors, line_styles, - line_widths, - symbol_colors, symbol_scales, - symbol_numbers, pllegend_symbols ); + c_pllegend( p_legend_width, p_legend_height, + *position, *opt, *x, *y, *plot_width, + *bg_color, *bb_color, *bb_style, + *nrow, *ncolumn, + *nlegend, opt_array, + *text_offset, *text_scale, *text_spacing, + *text_justification, + text_colors, (const char **)pllegend_text, + box_colors, box_patterns, + box_scales, box_line_widths, + line_colors, line_styles, + line_widths, + symbol_colors, symbol_scales, + symbol_numbers, (const char **)pllegend_symbols ) ; free( *pllegend_text ); free( pllegend_text ); Modified: trunk/bindings/f77/sfstubs.fm4 =================================================================== --- trunk/bindings/f77/sfstubs.fm4 2011-01-31 08:26:36 UTC (rev 11541) +++ trunk/bindings/f77/sfstubs.fm4 2011-02-01 07:31:56 UTC (rev 11542) @@ -213,6 +213,29 @@ c*********************************************************************** + subroutine plcolorbar(position,opt,x,y,length,width, + & cont_color,cont_width,ticks,sub_ticks, + & axis_opts,label,n_colors,colors,values) + + implicit none + integer position, opt, cont_color, cont_width, sub_ticks, n_colors + real*8 x, y, length, width, ticks + real*8 colors(*), values(*) + character(*) axis_opts, label + + include 'sfstubs.h' + + call plstrf2c(axis_opts, string1, maxlen) + call plstrf2c(label, string2, maxlen) + + call plcolorbar7(position,opt,x,y,length,width, + & cont_color,cont_width,ticks,sub_ticks, + & string1,string2,n_colors,colors,values) + + end + +c*********************************************************************** + subroutine plcon0(z,nx,ny,kx,lx,ky,ly,clevel,nlevel) implicit none Modified: trunk/examples/f77/x33f.fm4 =================================================================== --- trunk/examples/f77/x33f.fm4 2011-01-31 08:26:36 UTC (rev 11541) +++ trunk/examples/f77/x33f.fm4 2011-02-01 07:31:56 UTC (rev 11542) @@ -88,35 +88,35 @@ &/ 0.0d0, 1.0d0, 2.0d0, 3.0d0, 4.0d0, 5.0d0, 6.0d0, 7.0d0, 8.0d0 / position_options(1) = - & PL_POSITION_LEFT + PL_POSITION_UPPER + PL_POSITION_OUTSIDE + & PL_POSITION_LEFT + PL_POSITION_TOP + PL_POSITION_OUTSIDE position_options(2) = - & PL_POSITION_UPPER + PL_POSITION_OUTSIDE + & PL_POSITION_TOP + PL_POSITION_OUTSIDE position_options(3) = - & PL_POSITION_RIGHT + PL_POSITION_UPPER + PL_POSITION_OUTSIDE + & PL_POSITION_RIGHT + PL_POSITION_TOP + PL_POSITION_OUTSIDE position_options(4) = & PL_POSITION_RIGHT + PL_POSITION_OUTSIDE position_options(5) = - & PL_POSITION_RIGHT + PL_POSITION_LOWER + PL_POSITION_OUTSIDE + & PL_POSITION_RIGHT + PL_POSITION_BOTTOM + PL_POSITION_OUTSIDE position_options(6) = - & PL_POSITION_LOWER + PL_POSITION_OUTSIDE + & PL_POSITION_BOTTOM + PL_POSITION_OUTSIDE position_options(7) = - & PL_POSITION_LEFT + PL_POSITION_LOWER + PL_POSITION_OUTSIDE + & PL_POSITION_LEFT + PL_POSITION_BOTTOM + PL_POSITION_OUTSIDE position_options(8) = & PL_POSITION_LEFT + PL_POSITION_OUTSIDE position_options(9) = - & PL_POSITION_LEFT + PL_POSITION_UPPER + PL_POSITION_INSIDE + & PL_POSITION_LEFT + PL_POSITION_TOP + PL_POSITION_INSIDE position_options(10) = - & PL_POSITION_UPPER + PL_POSITION_INSIDE + & PL_POSITION_TOP + PL_POSITION_INSIDE position_options(11) = - & PL_POSITION_RIGHT + PL_POSITION_UPPER + PL_POSITION_INSIDE + & PL_POSITION_RIGHT + PL_POSITION_TOP + PL_POSITION_INSIDE position_options(12) = & PL_POSITION_RIGHT + PL_POSITION_INSIDE position_options(13) = - & PL_POSITION_RIGHT + PL_POSITION_LOWER + PL_POSITION_INSIDE + & PL_POSITION_RIGHT + PL_POSITION_BOTTOM + PL_POSITION_INSIDE position_options(14) = - & PL_POSITION_LOWER + PL_POSITION_INSIDE + & PL_POSITION_BOTTOM + PL_POSITION_INSIDE position_options(15) = - & PL_POSITION_LEFT + PL_POSITION_LOWER + PL_POSITION_INSIDE + & PL_POSITION_LEFT + PL_POSITION_BOTTOM + PL_POSITION_INSIDE position_options(16) = & PL_POSITION_LEFT + PL_POSITION_INSIDE @@ -208,7 +208,7 @@ call plsfont( PL_FCI_MONO, -1, -1 ) call plscol0a( 15, 32, 32, 32, 0.70d0 ) - position = PL_POSITION_UPPER + PL_POSITION_OUTSIDE + position = PL_POSITION_TOP + PL_POSITION_OUTSIDE opt = opt_base x = 0.d0 y = 0.1d0 @@ -222,7 +222,7 @@ & line_colors, line_styles, line_widths, & symbol_colors, symbol_scales, symbol_numbers, symbols ) - position = PL_POSITION_LOWER + PL_POSITION_OUTSIDE + position = PL_POSITION_BOTTOM + PL_POSITION_OUTSIDE opt = opt_base x = 0.d0 y = 0.1d0 @@ -264,7 +264,7 @@ & line_colors, line_styles, line_widths, & symbol_colors, symbol_scales, symbol_numbers, symbols ) - position = PL_POSITION_LEFT + PL_POSITION_UPPER + + position = PL_POSITION_LEFT + PL_POSITION_TOP + & PL_POSITION_INSIDE opt = opt_base x = 0.d0 @@ -279,7 +279,7 @@ & line_colors, line_styles, line_widths, & symbol_colors, symbol_scales, symbol_numbers, symbols ) - position = PL_POSITION_RIGHT + PL_POSITION_UPPER + + position = PL_POSITION_RIGHT + PL_POSITION_TOP + & PL_POSITION_INSIDE opt = opt_base + PL_LEGEND_ROW_MAJOR x = 0.d0 @@ -298,7 +298,7 @@ c This causes an access violation? c - position = PL_POSITION_LOWER + PL_POSITION_INSIDE + position = PL_POSITION_BOTTOM + PL_POSITION_INSIDE opt = opt_base + PL_LEGEND_ROW_MAJOR x = 0.d0 y = 0.d0 @@ -325,7 +325,7 @@ y = 0.1d0 nturn = 5 nlegend = 0 - position = PL_POSITION_UPPER + PL_POSITION_LEFT + position = PL_POSITION_TOP + PL_POSITION_LEFT opt_base = PL_LEGEND_BACKGROUND + PL_LEGEND_BOUNDING_BOX opt = opt_base + PL_LEGEND_TEXT_LEFT do 140 i = 1,9 @@ -373,7 +373,7 @@ & symbol_colors, symbol_scales, symbol_numbers, symbols ) if ( i .eq. nturn ) then - position = PL_POSITION_UPPER + PL_POSITION_RIGHT + position = PL_POSITION_TOP + PL_POSITION_RIGHT opt = opt_base x = 1.d0 - x y = y + legend_height @@ -404,7 +404,7 @@ c Only specify legend data that are required according to the c value of opt_array for that entry. - position = PL_POSITION_LEFT + PL_POSITION_UPPER + position = PL_POSITION_LEFT + PL_POSITION_TOP opt_base = PL_LEGEND_BACKGROUND + PL_LEGEND_BOUNDING_BOX + & PL_LEGEND_TEXT_LEFT @@ -725,7 +725,7 @@ include 'plplot_parameters.h' - integer bar_type + integer bar_type, position real*8 ticks integer sub_ticks integer n @@ -751,8 +751,9 @@ colors(i) = 0.0d0 + color_step * i 110 continue - opt = PL_COLORBAR_LEFT + bar_type + PL_COLORBAR_LABEL_LEFT + - & PL_COLORBAR_CAP_HIGH + position = PL_POSITION_LEFT + opt = bar_type + PL_COLORBAR_LABEL_LEFT + + & PL_COLORBAR_CAP_HIGH if ( mod( bar_type, 2*PL_COLORBAR_SHADE_LABEL ) / & PL_COLORBAR_SHADE_LABEL .eq. 1 ) then @@ -773,24 +774,27 @@ & axis_opts_1, 'Test label - Left, High Cap', & n, colors, values ) - opt = PL_COLORBAR_RIGHT + bar_type + PL_COLORBAR_LABEL_RIGHT + - & PL_COLORBAR_CAP_LOW + position = PL_POSITION_RIGHT + opt = bar_type + PL_COLORBAR_LABEL_RIGHT + + & PL_COLORBAR_CAP_LOW call plcolorbar( opt, 0.1d0, 0.4d0, 0.5d0, 0.1d0, & ticks, sub_ticks, & axis_opts_1, 'Test label - Right, Low Cap', & n, colors, values ) - opt = PL_COLORBAR_UPPER + bar_type + PL_COLORBAR_LABEL_UPPER + - & PL_COLORBAR_CAP_HIGH + position = PL_POSITION_TOP + opt = bar_type + PL_COLORBAR_LABEL_TOP + + & PL_COLORBAR_CAP_HIGH call plcolorbar( opt, 0.1d0, 0.1d0, 0.5d0, 0.1d0, & ticks, sub_ticks, & axis_opts_2, 'Test label - Upper, High Cap', & n, colors, values ) - opt = PL_COLORBAR_LOWER + bar_type + PL_COLORBAR_LABEL_LOWER + - & PL_COLORBAR_CAP_LOW + position = PL_POSITION_TOP + opt = bar_type + PL_COLORBAR_LABEL_BOTTOM + + & PL_COLORBAR_CAP_LOW call plcolorbar( opt, 0.4d0, 0.1d0, 0.5d0, 0.1d0, & ticks, sub_ticks, @@ -809,7 +813,7 @@ include 'plplot_parameters.h' - integer bar_type + integer bar_type, position real*8 ticks integer sub_ticks integer n @@ -831,8 +835,9 @@ colors(i) = 0.0d0 + color_step * i 110 continue - opt = PL_COLORBAR_LEFT + bar_type + PL_COLORBAR_LABEL_LEFT + - & PL_COLORBAR_CAP_LOW + position = PL_POSITION_LEFT + opt = bar_type + PL_COLORBAR_LABEL_LEFT + + & PL_COLORBAR_CAP_LOW if ( bar_type .eq. PL_COLORBAR_SHADE_LABEL ) then axis_opts_1 = '' @@ -852,24 +857,27 @@ & axis_opts_1, 'Test label - Left, Low Cap', & n, colors, values ) - opt = PL_COLORBAR_RIGHT + bar_type + PL_COLORBAR_LABEL_RIGHT + - & PL_COLORBAR_CAP_HIGH + position = PL_POSITION_RIGHT + opt = bar_type + PL_COLORBAR_LABEL_RIGHT + + & PL_COLORBAR_CAP_HIGH call plcolorbar( opt, 0.1d0, 0.4d0, 0.5d0, 0.1d0, & ticks, sub_ticks, & axis_opts_1, 'Test label - Right, High Cap', & n, colors, values ) - opt = PL_COLORBAR_UPPER + bar_type + PL_COLORBAR_LABEL_UPPER + - & PL_COLORBAR_CAP_LOW + position = PL_POSITION_TOP + opt = bar_type + PL_COLORBAR_LABEL_TOP + + & PL_COLORBAR_CAP_LOW call plcolorbar( opt, 0.1d0, 0.1d0, 0.5d0, 0.1d0, & ticks, sub_ticks, & axis_opts_2, 'Test label - Upper, Low Cap', & n, colors, values ) - opt = PL_COLORBAR_LOWER + bar_type + PL_COLORBAR_LABEL_LOWER + - & PL_COLORBAR_CAP_HIGH + position = PL_POSITION_BOTTOM + opt = bar_type + PL_COLORBAR_LABEL_BOTTOM + + & PL_COLORBAR_CAP_HIGH call plcolorbar( opt, 0.4d0, 0.1d0, 0.5d0, 0.1d0, & ticks, sub_ticks, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |