From: <ai...@us...> - 2011-05-12 20:39:49
|
Revision: 11749 http://plplot.svn.sourceforge.net/plplot/?rev=11749&view=rev Author: airwin Date: 2011-05-12 20:39:42 +0000 (Thu, 12 May 2011) Log Message: ----------- Style recent changes. Modified Paths: -------------- trunk/drivers/xwin.c trunk/examples/c/x16c.c trunk/examples/c/x33c.c trunk/include/plplot.h trunk/include/plxwd.h trunk/src/plcore.c trunk/src/plimage.c trunk/src/pllegend.c trunk/src/plshade.c Modified: trunk/drivers/xwin.c =================================================================== --- trunk/drivers/xwin.c 2011-05-12 20:24:26 UTC (rev 11748) +++ trunk/drivers/xwin.c 2011-05-12 20:39:42 UTC (rev 11749) @@ -2380,8 +2380,9 @@ dev->width, dev->height ); XSetForeground( xwd->display, dev->gc, dev->curcolor.pixel ); } - if ( dev->write_to_window ) { - XClearWindow( xwd->display, dev->window ); + if ( dev->write_to_window ) + { + XClearWindow( xwd->display, dev->window ); } plRemakePlot( pls ); XSync( xwd->display, 0 ); @@ -2456,15 +2457,17 @@ // Initialize & redraw (to pixmap, if available). - if ( dev->write_to_pixmap ) { + if ( dev->write_to_pixmap ) + { dev->write_to_window = 0; XSetForeground( xwd->display, dev->gc, dev->bgcolor.pixel ); XFillRectangle( xwd->display, dev->pixmap, dev->gc, 0, 0, dev->width, dev->height ); XSetForeground( xwd->display, dev->gc, dev->curcolor.pixel ); } - if ( dev->write_to_window ) { - XClearWindow( xwd->display, dev->window ); + if ( dev->write_to_window ) + { + XClearWindow( xwd->display, dev->window ); } plRemakePlot( pls ); XSync( xwd->display, 0 ); Modified: trunk/examples/c/x16c.c =================================================================== --- trunk/examples/c/x16c.c 2011-05-12 20:24:26 UTC (rev 11748) +++ trunk/examples/c/x16c.c 2011-05-12 20:39:42 UTC (rev 11749) @@ -242,9 +242,9 @@ plsmin( 0.0, 0.5 ); plcolorbar( PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL | PL_COLORBAR_EDGE, PL_POSITION_RIGHT, - 0.05, 0.15, 0.03, 0.7, 0.0, 0.0, - cont_color, cont_width, 0.0, 0, "vt", "", - ns + 1, shedge ); + 0.05, 0.15, 0.03, 0.7, 0.0, 0.0, + cont_color, cont_width, 0.0, 0, "vt", "", + ns + 1, shedge ); // Reset text and tick sizes plschr( 0.0, 1.0 ); @@ -288,9 +288,9 @@ plsmin( 0.0, 0.5 ); plcolorbar( PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL | PL_COLORBAR_EDGE, PL_POSITION_RIGHT, - 0.05, 0.15, 0.03, 0.7, 0.0, 0.0, - cont_color, cont_width, 0.0, 0, "vt", "", - ns + 1, shedge ); + 0.05, 0.15, 0.03, 0.7, 0.0, 0.0, + cont_color, cont_width, 0.0, 0, "vt", "", + ns + 1, shedge ); // Reset text and tick sizes plschr( 0.0, 1.0 ); @@ -334,9 +334,9 @@ plsmin( 0.0, 0.5 ); plcolorbar( PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL | PL_COLORBAR_EDGE, PL_POSITION_RIGHT, - 0.05, 0.15, 0.03, 0.7, 0.0, 0.0, - cont_color, cont_width, 0.0, 0, "vt", "", - ns + 1, shedge ); + 0.05, 0.15, 0.03, 0.7, 0.0, 0.0, + cont_color, cont_width, 0.0, 0, "vt", "", + ns + 1, shedge ); // Reset text and tick sizes plschr( 0.0, 1.0 ); @@ -379,9 +379,9 @@ plsmin( 0.0, 0.5 ); plcolorbar( PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL | PL_COLORBAR_EDGE, PL_POSITION_RIGHT, - 0.05, 0.15, 0.03, 0.7, 0.0, 0.0, - 2, 3, 0.0, 0, "vx", "", - ns + 1, shedge ); + 0.05, 0.15, 0.03, 0.7, 0.0, 0.0, + 2, 3, 0.0, 0, "vx", "", + ns + 1, shedge ); // Reset text and tick sizes plschr( 0.0, 1.0 ); @@ -475,9 +475,9 @@ plsmin( 0.0, 0.5 ); plcolorbar( PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL | PL_COLORBAR_EDGE, PL_POSITION_RIGHT, - 0.06, 0.15, 0.03, 0.7, 0.0, 0.0, - cont_color, cont_width, 0.0, 0, "vt", "", - ns + 1, shedge ); + 0.06, 0.15, 0.03, 0.7, 0.0, 0.0, + cont_color, cont_width, 0.0, 0, "vt", "", + ns + 1, shedge ); // Reset text and tick sizes plschr( 0.0, 1.0 ); Modified: trunk/examples/c/x33c.c =================================================================== --- trunk/examples/c/x33c.c 2011-05-12 20:24:26 UTC (rev 11748) +++ trunk/examples/c/x33c.c 2011-05-12 20:39:42 UTC (rev 11749) @@ -52,7 +52,7 @@ }; // Pick 5 arbitrary UTF-8 symbols useful for plotting points (✠✚✱✪✽✺✰✴✦). -static char *special_symbols[5] = { +static char *special_symbols[5] = { "✰", "✴", "✱", @@ -63,8 +63,8 @@ // plcolorbar options // Colorbar type options -#define COLORBAR_KINDS 4 -static PLINT colorbar_option_kinds[COLORBAR_KINDS] = { +#define COLORBAR_KINDS 4 +static PLINT colorbar_option_kinds[COLORBAR_KINDS] = { PL_COLORBAR_SHADE, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, PL_COLORBAR_IMAGE, @@ -78,8 +78,8 @@ }; // Which side of the page are we positioned relative to? -#define COLORBAR_POSITIONS 4 -static PLINT colorbar_position_options[COLORBAR_POSITIONS] = { +#define COLORBAR_POSITIONS 4 +static PLINT colorbar_position_options[COLORBAR_POSITIONS] = { PL_POSITION_LEFT, PL_POSITION_RIGHT, PL_POSITION_TOP, @@ -93,8 +93,8 @@ }; // Colorbar label positioning options -#define COLORBAR_LABELS 4 -static PLINT colorbar_label_options[COLORBAR_LABELS] = { +#define COLORBAR_LABELS 4 +static PLINT colorbar_label_options[COLORBAR_LABELS] = { PL_COLORBAR_LABEL_LEFT, PL_COLORBAR_LABEL_RIGHT, PL_COLORBAR_LABEL_TOP, @@ -108,14 +108,14 @@ }; // Colorbar cap options -#define COLORBAR_CAPS 4 -static PLINT colorbar_cap_options[COLORBAR_CAPS] = { +#define COLORBAR_CAPS 4 +static PLINT colorbar_cap_options[COLORBAR_CAPS] = { PL_COLORBAR_CAP_NONE, PL_COLORBAR_CAP_LOW, PL_COLORBAR_CAP_HIGH, PL_COLORBAR_CAP_LOW | PL_COLORBAR_CAP_HIGH }; -static const char *colorbar_cap_option_labels[COLORBAR_CAPS] = { +static const char *colorbar_cap_option_labels[COLORBAR_CAPS] = { "No caps", "Low cap", "High cap", @@ -151,30 +151,30 @@ plcolorbar_example_page( int kind_i, int label_i, int cap_i, PLINT cont_color, PLINT cont_width, PLINT n_values, PLFLT *values ) { // Parameters for the colorbars on this page - PLINT position_i, position, opt; - PLFLT x, y, x_length, y_length; - PLFLT ticks; - PLINT sub_ticks; - PLFLT low_cap_color, high_cap_color; - PLINT vertical; + PLINT position_i, position, opt; + PLFLT x, y, x_length, y_length; + PLFLT ticks; + PLINT sub_ticks; + PLFLT low_cap_color, high_cap_color; + PLINT vertical; const char *axis_opts; - char label[200]; - char title[200]; + char label[200]; + char title[200]; - ticks = 0.0; + ticks = 0.0; sub_ticks = 0; - low_cap_color = 0.0; + low_cap_color = 0.0; high_cap_color = 1.0; // Start a new page pladv( 0 ); // Draw one colorbar relative to each side of the page - for ( position_i = 0; position_i < COLORBAR_POSITIONS; position_i ++ ) + for ( position_i = 0; position_i < COLORBAR_POSITIONS; position_i++ ) { position = colorbar_position_options[position_i]; - opt = + opt = colorbar_option_kinds[kind_i] | colorbar_label_options[label_i] | colorbar_cap_options[cap_i]; @@ -184,16 +184,15 @@ // Set the offset position on the page if ( vertical ) { - x = 0.1; - y = 0.25; + x = 0.1; + y = 0.25; x_length = 0.05; y_length = 0.5; - } else { - x = 0.25; - y = 0.1; + x = 0.25; + y = 0.1; x_length = 0.5; y_length = 0.05; } @@ -209,8 +208,8 @@ } sprintf( label, "%s, %s", - colorbar_position_option_labels[position_i], - colorbar_label_option_labels[label_i] ); + colorbar_position_option_labels[position_i], + colorbar_label_option_labels[label_i] ); // Smaller text plschr( 0.0, 0.75 ); @@ -219,12 +218,12 @@ plsmin( 0.0, 0.5 ); plcolorbar( opt, position, - x, y, x_length, y_length, - low_cap_color, high_cap_color, - cont_color, cont_width, - ticks, sub_ticks, - axis_opts, label, - n_values, values ); + x, y, x_length, y_length, + low_cap_color, high_cap_color, + cont_color, cont_width, + ticks, sub_ticks, + axis_opts, label, + n_values, values ); // Reset text and tick sizes plschr( 0.0, 1.0 ); @@ -234,8 +233,8 @@ // Draw a page title sprintf( title, "%s - %s", - colorbar_option_kind_labels[kind_i], - colorbar_cap_option_labels[cap_i] ); + colorbar_option_kind_labels[kind_i], + colorbar_cap_option_labels[cap_i] ); plvpor( 0.0, 1.0, 0.0, 1.0 ); plwind( 0.0, 1.0, 0.0, 1.0 ); plptex( 0.5, 0.5, 0.0, 0.0, 0.5, title ); @@ -254,8 +253,8 @@ for ( cap_i = 0; cap_i < COLORBAR_CAPS; cap_i++ ) { plcolorbar_example_page( kind_i, label_i, cap_i, - cont_color, cont_width, - n_values, values ); + cont_color, cont_width, + n_values, values ); } } } @@ -821,7 +820,7 @@ if ( colorbar ) { // Use unsaturated green background colour to contrast with black caps. - plscolbg (70, 185, 70); + plscolbg( 70, 185, 70 ); // Color bar examples 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 }; @@ -832,7 +831,7 @@ plscmap1_range( 0.01, 0.99 ); // We can only test image and gradient colorbars with two element arrays - for ( i = 2; i < COLORBAR_KINDS; i ++ ) + for ( i = 2; i < COLORBAR_KINDS; i++ ) { plcolorbar_example( "cmap1_blue_yellow.pal", i, 0, 0, 2, values_small ); } Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2011-05-12 20:24:26 UTC (rev 11748) +++ trunk/include/plplot.h 2011-05-12 20:39:42 UTC (rev 11749) @@ -1222,43 +1222,43 @@ c_pllab( const char *xlabel, const char *ylabel, const char *tlabel ); //flags used for position argument of both pllegend and plcolorbar -#define PL_POSITION_LEFT 1 -#define PL_POSITION_RIGHT 2 -#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 -#define PL_POSITION_SUBPAGE 128 +#define PL_POSITION_LEFT 1 +#define PL_POSITION_RIGHT 2 +#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 +#define PL_POSITION_SUBPAGE 128 // Flags for pllegend. -#define PL_LEGEND_NONE 1 -#define PL_LEGEND_COLOR_BOX 2 -#define PL_LEGEND_LINE 4 -#define PL_LEGEND_SYMBOL 8 -#define PL_LEGEND_TEXT_LEFT 16 -#define PL_LEGEND_BACKGROUND 32 -#define PL_LEGEND_BOUNDING_BOX 64 -#define PL_LEGEND_ROW_MAJOR 128 +#define PL_LEGEND_NONE 1 +#define PL_LEGEND_COLOR_BOX 2 +#define PL_LEGEND_LINE 4 +#define PL_LEGEND_SYMBOL 8 +#define PL_LEGEND_TEXT_LEFT 16 +#define PL_LEGEND_BACKGROUND 32 +#define PL_LEGEND_BOUNDING_BOX 64 +#define PL_LEGEND_ROW_MAJOR 128 // Flags for plcolorbar -#define PL_COLORBAR_LABEL_LEFT 1 -#define PL_COLORBAR_LABEL_RIGHT 2 -#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 -#define PL_COLORBAR_CAP_NONE 128 -#define PL_COLORBAR_CAP_LOW 256 -#define PL_COLORBAR_CAP_HIGH 512 -#define PL_COLORBAR_SHADE_LABEL 1024 -#define PL_COLORBAR_ORIENT_RIGHT 2048 -#define PL_COLORBAR_ORIENT_TOP 4096 -#define PL_COLORBAR_ORIENT_LEFT 8192 -#define PL_COLORBAR_ORIENT_BOTTOM 16384 -#define PL_COLORBAR_NOEDGE 32768 -#define PL_COLORBAR_EDGE 65536 +#define PL_COLORBAR_LABEL_LEFT 1 +#define PL_COLORBAR_LABEL_RIGHT 2 +#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 +#define PL_COLORBAR_CAP_NONE 128 +#define PL_COLORBAR_CAP_LOW 256 +#define PL_COLORBAR_CAP_HIGH 512 +#define PL_COLORBAR_SHADE_LABEL 1024 +#define PL_COLORBAR_ORIENT_RIGHT 2048 +#define PL_COLORBAR_ORIENT_TOP 4096 +#define PL_COLORBAR_ORIENT_LEFT 8192 +#define PL_COLORBAR_ORIENT_BOTTOM 16384 +#define PL_COLORBAR_NOEDGE 32768 +#define PL_COLORBAR_EDGE 65536 // Routine for drawing discrete line, symbol, or cmap0 legends PLDLLIMPEXP void Modified: trunk/include/plxwd.h =================================================================== --- trunk/include/plxwd.h 2011-05-12 20:24:26 UTC (rev 11748) +++ trunk/include/plxwd.h 2011-05-12 20:39:42 UTC (rev 11749) @@ -107,7 +107,7 @@ #ifdef PL_HAVE_PTHREAD pthread_t updater; // The X events updater thread id #endif - XColor bgcolor; // Background color + XColor bgcolor; // Background color } XwDev; #endif // __PLXWD_H__ Modified: trunk/src/plcore.c =================================================================== --- trunk/src/plcore.c 2011-05-12 20:24:26 UTC (rev 11748) +++ trunk/src/plcore.c 2011-05-12 20:39:42 UTC (rev 11749) @@ -2706,8 +2706,8 @@ // cmap 1 - plsc->icol1 = plsr->icol1; - plsc->ncol1 = plsr->ncol1; + plsc->icol1 = plsr->icol1; + plsc->ncol1 = plsr->ncol1; plsc->cmap1_min = plsr->cmap1_min; plsc->cmap1_max = plsr->cmap1_max; if ( plsc->cmap1 != NULL ) Modified: trunk/src/plimage.c =================================================================== --- trunk/src/plimage.c 2011-05-12 20:24:26 UTC (rev 11748) +++ trunk/src/plimage.c 2011-05-12 20:39:42 UTC (rev 11749) @@ -247,8 +247,8 @@ } // Calculate the size of the color range to use - color_min = plsc->cmap1_min; - color_max = plsc->cmap1_max; + color_min = plsc->cmap1_min; + color_max = plsc->cmap1_max; color_range = color_max - color_min; // Go through the image values and scale them to fit in Modified: trunk/src/pllegend.c =================================================================== --- trunk/src/pllegend.c 2011-05-12 20:24:26 UTC (rev 11748) +++ trunk/src/pllegend.c 2011-05-12 20:39:42 UTC (rev 11749) @@ -894,13 +894,13 @@ void static remove_characters( char *string, const char *characters ) { - size_t length = strlen(string); + size_t length = strlen( string ); size_t prefix_length = strcspn( string, characters ); if ( prefix_length < length ) { // Remove first matching character by shifting tail of string // (including null-terminator) down by one. - memmove( string+prefix_length, string+prefix_length+1, length - prefix_length ); + memmove( string + prefix_length, string + prefix_length + 1, length - prefix_length ); // Recurse to remove any remaining specified characters. remove_characters( string, characters ); } @@ -925,7 +925,7 @@ void static draw_cap( PLINT opt, PLINT orientation, PLFLT xmin, PLFLT xmax, - PLFLT ymin,PLFLT ymax, PLFLT color ) + PLFLT ymin, PLFLT ymax, PLFLT color ) { // Save current drawing color. PLINT col0_save = plsc->icol0; @@ -950,43 +950,43 @@ if ( orientation == PL_COLORBAR_ORIENT_RIGHT ) { - xs[0] = 0.; - ys[0] = 0.; - xs[1] = 1.; - ys[1] = 0.5; - xs[2] = 0.; - ys[2] = 1.; + xs[0] = 0.; + ys[0] = 0.; + xs[1] = 1.; + ys[1] = 0.5; + xs[2] = 0.; + ys[2] = 1.; } else if ( orientation == PL_COLORBAR_ORIENT_TOP ) { - xs[0] = 1.; - ys[0] = 0.; - xs[1] = 0.5; - ys[1] = 1.; - xs[2] = 0.; - ys[2] = 0.; + xs[0] = 1.; + ys[0] = 0.; + xs[1] = 0.5; + ys[1] = 1.; + xs[2] = 0.; + ys[2] = 0.; } else if ( orientation == PL_COLORBAR_ORIENT_LEFT ) { - xs[0] = 1.; - ys[0] = 1.; - xs[1] = 0.; - ys[1] = 0.5; - xs[2] = 1.; - ys[2] = 0.; + xs[0] = 1.; + ys[0] = 1.; + xs[1] = 0.; + ys[1] = 0.5; + xs[2] = 1.; + ys[2] = 0.; } else if ( orientation == PL_COLORBAR_ORIENT_BOTTOM ) { - xs[0] = 0.; - ys[0] = 1.; - xs[1] = 0.5; - ys[1] = 0.; - xs[2] = 1.; - ys[2] = 1.; + xs[0] = 0.; + ys[0] = 1.; + xs[1] = 0.5; + ys[1] = 0.; + xs[2] = 1.; + ys[2] = 1.; } else { - plexit( "draw_cap: internal error. Incorrect orientation"); + plexit( "draw_cap: internal error. Incorrect orientation" ); } plcol1( color ); @@ -995,7 +995,7 @@ plcol0( col0_save ); // Draw cap outline - if ( opt & PL_COLORBAR_EDGE) + if ( opt & PL_COLORBAR_EDGE ) plline( 3, xs, ys ); // Restore window and viewport @@ -1097,7 +1097,7 @@ PLFLT xwmin_save, xwmax_save, ywmin_save, ywmax_save; // Active attributes to be saved and restored afterward. - PLINT col0_save = plsc->icol0; + PLINT col0_save = plsc->icol0; // Position of the color bar in normalized viewport (= normalized subpage // coordinates). @@ -1118,8 +1118,8 @@ PLINT max_opts = 25; char opt_string[max_opts]; const char *tick_label_string, *edge_string; - size_t length_axis_opts = strlen(axis_opts); - char *local_axis_opts; + size_t length_axis_opts = strlen( axis_opts ); + char *local_axis_opts; // Draw a title char perp; @@ -1130,10 +1130,10 @@ opt & PL_COLORBAR_ORIENT_LEFT || opt & PL_COLORBAR_ORIENT_BOTTOM ) ) { - if ( position & PL_POSITION_LEFT || position & PL_POSITION_RIGHT ) - opt = opt | PL_COLORBAR_ORIENT_TOP; - else - opt = opt | PL_COLORBAR_ORIENT_RIGHT; + if ( position & PL_POSITION_LEFT || position & PL_POSITION_RIGHT ) + opt = opt | PL_COLORBAR_ORIENT_TOP; + else + opt = opt | PL_COLORBAR_ORIENT_RIGHT; } // Do not draw edges of color box and caps by default. @@ -1142,16 +1142,16 @@ // local_axis_opts is local version that can be modified from // const input version. - if ( ( local_axis_opts = (char *) malloc( (length_axis_opts + 1) * sizeof ( char ) ) ) == NULL ) + if ( ( local_axis_opts = (char *) malloc( ( length_axis_opts + 1 ) * sizeof ( char ) ) ) == NULL ) { plexit( "plcolorbar: Insufficient memory" ); } - strcpy(local_axis_opts, axis_opts); + strcpy( local_axis_opts, axis_opts ); - + // Sanity checking on local_axis_opts to remove all control characters // that are specified by other means inside this routine. - remove_characters(local_axis_opts, "BbCcMmNnUuWw"); + remove_characters( local_axis_opts, "BbCcMmNnUuWw" ); min_value = values[0]; max_value = values[ n_values - 1 ]; @@ -1213,7 +1213,7 @@ wy_min = 0.0; wy_max = 1.0; } - else if ( opt & PL_COLORBAR_ORIENT_BOTTOM) + else if ( opt & PL_COLORBAR_ORIENT_BOTTOM ) { wx_min = 0.0; wx_max = 1.0; @@ -1511,19 +1511,19 @@ // Draw a filled triangle (cap/arrow) at the low end of the scale if ( opt & PL_COLORBAR_ORIENT_RIGHT ) { - draw_cap( opt, PL_COLORBAR_ORIENT_LEFT, vx_min - cap_height, vx_min, vy_min, vy_max, low_cap_color ); + draw_cap( opt, PL_COLORBAR_ORIENT_LEFT, vx_min - cap_height, vx_min, vy_min, vy_max, low_cap_color ); } else if ( opt & PL_COLORBAR_ORIENT_TOP ) { - draw_cap( opt, PL_COLORBAR_ORIENT_BOTTOM, vx_min, vx_max, vy_min - cap_height, vy_min, low_cap_color ); + draw_cap( opt, PL_COLORBAR_ORIENT_BOTTOM, vx_min, vx_max, vy_min - cap_height, vy_min, low_cap_color ); } else if ( opt & PL_COLORBAR_ORIENT_LEFT ) { - draw_cap( opt, PL_COLORBAR_ORIENT_RIGHT, vx_max, vx_max + cap_height, vy_min, vy_max, low_cap_color ); + draw_cap( opt, PL_COLORBAR_ORIENT_RIGHT, vx_max, vx_max + cap_height, vy_min, vy_max, low_cap_color ); } else if ( opt & PL_COLORBAR_ORIENT_BOTTOM ) { - draw_cap( opt, PL_COLORBAR_ORIENT_TOP, vx_min, vx_max, vy_max, vy_max + cap_height, low_cap_color ); + draw_cap( opt, PL_COLORBAR_ORIENT_TOP, vx_min, vx_max, vy_max, vy_max + cap_height, low_cap_color ); } } if ( opt & PL_COLORBAR_CAP_HIGH ) @@ -1540,21 +1540,21 @@ // Draw a filled triangle (cap/arrow) at the high end of the scale if ( opt & PL_COLORBAR_ORIENT_RIGHT ) { - draw_cap( opt, PL_COLORBAR_ORIENT_RIGHT, vx_max, vx_max + cap_height, vy_min, vy_max, high_cap_color ); + draw_cap( opt, PL_COLORBAR_ORIENT_RIGHT, vx_max, vx_max + cap_height, vy_min, vy_max, high_cap_color ); } else if ( opt & PL_COLORBAR_ORIENT_TOP ) { - draw_cap( opt, PL_COLORBAR_ORIENT_TOP, vx_min, vx_max, vy_max, vy_max + cap_height, high_cap_color ); + draw_cap( opt, PL_COLORBAR_ORIENT_TOP, vx_min, vx_max, vy_max, vy_max + cap_height, high_cap_color ); } if ( opt & PL_COLORBAR_ORIENT_LEFT ) { - draw_cap( opt, PL_COLORBAR_ORIENT_LEFT, vx_min - cap_height, vx_min, vy_min, vy_max, high_cap_color ); + draw_cap( opt, PL_COLORBAR_ORIENT_LEFT, vx_min - cap_height, vx_min, vy_min, vy_max, high_cap_color ); } else if ( opt & PL_COLORBAR_ORIENT_BOTTOM ) { - draw_cap( opt, PL_COLORBAR_ORIENT_BOTTOM, vx_min, vx_max, vy_min - cap_height, vy_min, high_cap_color ); + draw_cap( opt, PL_COLORBAR_ORIENT_BOTTOM, vx_min, vx_max, vy_min - cap_height, vy_min, high_cap_color ); } - } + } // Write label. if ( opt & PL_COLORBAR_LABEL_LEFT ) @@ -1565,8 +1565,8 @@ label_offset += 4.0; else label_offset += 2.0; - perp = '\0'; - just = 0.5; + perp = '\0'; + just = 0.5; } else { @@ -1585,8 +1585,8 @@ label_offset += 4.0; else label_offset += 2.0; - perp = '\0'; - just = 0.5; + perp = '\0'; + just = 0.5; } else { @@ -1610,7 +1610,7 @@ label_offset += 4.0; else label_offset += 2.0; - perp = '\0'; + perp = '\0'; } snprintf( opt_string, max_opts, "t%c", perp ); plmtex( opt_string, label_offset, 0.5, 0.5, label ); @@ -1628,7 +1628,7 @@ label_offset += 4.0; else label_offset += 2.0; - perp = '\0'; + perp = '\0'; } snprintf( opt_string, max_opts, "b%c", perp ); plmtex( opt_string, label_offset, 0.5, 0.5, label ); @@ -1642,7 +1642,7 @@ { tick_label_string = "m"; } - + // Draw numerical labels and tick marks if this is a shade color bar // TODO: A better way to handle this would be to update the // internals of plbox to support custom tick and label positions @@ -1651,7 +1651,7 @@ if ( opt & PL_COLORBAR_SHADE && opt & PL_COLORBAR_SHADE_LABEL ) { snprintf( opt_string, max_opts, "%s%s", tick_label_string, local_axis_opts ); - if ( opt & PL_COLORBAR_ORIENT_RIGHT || opt & PL_COLORBAR_ORIENT_LEFT) + if ( opt & PL_COLORBAR_ORIENT_RIGHT || opt & PL_COLORBAR_ORIENT_LEFT ) label_box_custom( opt_string, n_values, values, "", 0, NULL ); else label_box_custom( "", 0, NULL, opt_string, n_values, values ); @@ -1660,7 +1660,7 @@ tick_label_string = ""; // Exclude ticks for plbox call below since those tick marks // have already been handled in a custom way above. - remove_characters(local_axis_opts, "TtXx"); + remove_characters( local_axis_opts, "TtXx" ); } // Draw the outline for the entire colorbar, tick marks, tick labels. @@ -1670,16 +1670,16 @@ else edge_string = "uw"; snprintf( opt_string, max_opts, "%s%s%s", edge_string, tick_label_string, local_axis_opts ); - if ( opt & PL_COLORBAR_ORIENT_TOP || opt & PL_COLORBAR_ORIENT_BOTTOM) + if ( opt & PL_COLORBAR_ORIENT_TOP || opt & PL_COLORBAR_ORIENT_BOTTOM ) { - plbox( edge_string , 0.0, 0, opt_string, ticks, sub_ticks ); + plbox( edge_string, 0.0, 0, opt_string, ticks, sub_ticks ); } - else + else { - plbox( opt_string, ticks, sub_ticks, edge_string, 0.0, 0 ); + plbox( opt_string, ticks, sub_ticks, edge_string, 0.0, 0 ); } - free(local_axis_opts); + free( local_axis_opts ); // Restore previous plot characteristics. plcol0( col0_save ); @@ -1896,7 +1896,7 @@ plgvpw( &xwmin_save, &xwmax_save, &ywmin_save, &ywmax_save ); // Active attributes to be saved and restored afterward. - PLINT col0_save = plsc->icol0; + PLINT col0_save = plsc->icol0; // Position of the color bar in normalized viewport (= normalized subpage // coordinates). @@ -2202,8 +2202,8 @@ label_offset += 4.0; else label_offset += 2.0; - perp = '\0'; - just = 0.5; + perp = '\0'; + just = 0.5; } else { @@ -2222,8 +2222,8 @@ label_offset += 4.0; else label_offset += 2.0; - perp = '\0'; - just = 0.5; + perp = '\0'; + just = 0.5; } else { @@ -2247,7 +2247,7 @@ label_offset += 4.0; else label_offset += 2.0; - perp = '\0'; + perp = '\0'; } snprintf( opt_string, max_opts, "t%c", perp ); plmtex( opt_string, label_offset, 0.5, 0.5, label ); @@ -2265,7 +2265,7 @@ label_offset += 4.0; else label_offset += 2.0; - perp = '\0'; + perp = '\0'; } snprintf( opt_string, max_opts, "b%c", perp ); plmtex( opt_string, label_offset, 0.5, 0.5, label ); Modified: trunk/src/plshade.c =================================================================== --- trunk/src/plshade.c 2011-05-12 20:24:26 UTC (rev 11748) +++ trunk/src/plshade.c 2011-05-12 20:39:42 UTC (rev 11749) @@ -251,8 +251,8 @@ PLFLT color_min, color_max, color_range; // Color range to use - color_min = plsc->cmap1_min; - color_max = plsc->cmap1_max; + color_min = plsc->cmap1_min; + color_max = plsc->cmap1_max; color_range = color_max - color_min; for ( i = 0; i < nlevel - 1; i++ ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |