|
From: <hez...@us...> - 2011-01-02 00:44:20
|
Revision: 11420
http://plplot.svn.sourceforge.net/plplot/?rev=11420&view=rev
Author: hezekiahcarty
Date: 2011-01-02 00:44:14 +0000 (Sun, 02 Jan 2011)
Log Message:
-----------
Update C example 33 to illustrate some of the new plcolorbar features
Modified Paths:
--------------
trunk/examples/c/x33c.c
Modified: trunk/examples/c/x33c.c
===================================================================
--- trunk/examples/c/x33c.c 2011-01-02 00:43:35 UTC (rev 11419)
+++ trunk/examples/c/x33c.c 2011-01-02 00:44:14 UTC (rev 11420)
@@ -61,7 +61,7 @@
};
void
-plcolorbar_example_1( PLINT bar_type, PLINT n, PLFLT *values, const char *title )
+plcolorbar_example_1( PLINT bar_type, PLFLT ticks, PLINT sub_ticks, PLINT n, PLFLT *values, const char *title )
{
pladv( 0 );
// Setup color palette 1
@@ -80,29 +80,53 @@
opt = PL_COLORBAR_LEFT | 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 = "";
+ 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";
+ }
+ }
+
plcolorbar( opt, 0.1, 0.1, 0.5, 0.1,
- "tv", "Test label - Left, High Cap",
+ 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;
plcolorbar( opt, 0.1, 0.4, 0.5, 0.1,
- "tv", "Test label - Right, Low Cap",
+ 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;
plcolorbar( opt, 0.1, 0.1, 0.5, 0.1,
- "t", "Test label - Upper, High Cap",
+ 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;
plcolorbar( opt, 0.4, 0.1, 0.5, 0.1,
- "t", "Test label - Lower, Low Cap",
+ ticks, sub_ticks,
+ axis_opts_2, "Test label - Lower, Low Cap",
n, colors, values );
plvpor( 0.0, 1.0, 0.0, 1.0 );
@@ -111,7 +135,7 @@
}
void
-plcolorbar_example_2( PLINT bar_type, PLINT n, PLFLT *values, const char *title )
+plcolorbar_example_2( PLINT bar_type, PLFLT ticks, PLFLT sub_ticks, PLINT n, PLFLT *values, const char *title )
{
pladv( 0 );
// Setup color palette 1
@@ -130,29 +154,53 @@
opt = PL_COLORBAR_LEFT | 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 = "";
+ 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";
+ }
+ }
+
plcolorbar( opt, 0.1, 0.1, 0.5, 0.1,
- "tv", "Test label - Left, Low Cap",
+ 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;
plcolorbar( opt, 0.1, 0.4, 0.5, 0.1,
- "tv", "Test label - Right, High Cap",
+ 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;
plcolorbar( opt, 0.1, 0.1, 0.5, 0.1,
- "t", "Test label - Upper, Low Cap",
+ 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;
plcolorbar( opt, 0.4, 0.1, 0.5, 0.1,
- "t", "Test label - Lower, High Cap",
+ ticks, sub_ticks,
+ axis_opts_2, "Test label - Lower, High Cap",
n, colors, values );
plvpor( 0.0, 1.0, 0.0, 1.0 );
@@ -706,15 +754,15 @@
PLFLT values_small[2] = { 0.0, 1.0 };
PLFLT values_uneven[9] = { 0.0, 2.0, 2.5, 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, 2, values_small, "Image Color Bars" );
- plcolorbar_example_2( PL_COLORBAR_IMAGE, 2, values_small, "Image Color Bars" );
- plcolorbar_example_1( PL_COLORBAR_SHADE, 9, values_uneven,
+ 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,
"Shade Color Bars - Uneven Steps" );
- plcolorbar_example_2( PL_COLORBAR_SHADE, 9, values_even,
+ plcolorbar_example_2( PL_COLORBAR_SHADE, 3.0, 3, 9, values_even,
"Shade Color Bars - Even Steps" );
- plcolorbar_example_1( PL_COLORBAR_GRADIENT, 2, values_small,
+ plcolorbar_example_1( PL_COLORBAR_GRADIENT, 0.5, 5, 2, values_small,
"Gradient Color Bars" );
- plcolorbar_example_2( PL_COLORBAR_GRADIENT, 2, values_small,
+ plcolorbar_example_2( PL_COLORBAR_GRADIENT, 0.5, 5, 2, values_small,
"Gradient Color Bars" );
// Free space that contained legend text.
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:51
|
Revision: 11527
http://plplot.svn.sourceforge.net/plplot/?rev=11527&view=rev
Author: hezekiahcarty
Date: 2011-01-29 17:12:45 +0000 (Sat, 29 Jan 2011)
Log Message:
-----------
Update C example 33 to match plcolorbar position API change
Modified Paths:
--------------
trunk/examples/c/x33c.c
Modified: trunk/examples/c/x33c.c
===================================================================
--- trunk/examples/c/x33c.c 2011-01-29 17:12:25 UTC (rev 11526)
+++ trunk/examples/c/x33c.c 2011-01-29 17:12:45 UTC (rev 11527)
@@ -78,7 +78,7 @@
PLINT opt, opt_position;
opt = bar_type | PL_COLORBAR_LABEL_LEFT | PL_COLORBAR_CAP_HIGH;
- opt_position = PL_COLORBAR_LEFT;
+ opt_position = PL_POSITION_LEFT;
const char *axis_opts_1, *axis_opts_2;
if ( bar_type & PL_COLORBAR_SHADE_LABEL )
@@ -107,7 +107,7 @@
n, colors, values );
opt = bar_type | PL_COLORBAR_LABEL_RIGHT | PL_COLORBAR_CAP_LOW;
- opt_position = PL_COLORBAR_RIGHT;
+ opt_position = PL_POSITION_RIGHT;
plcolorbar( opt, opt_position, 0.1, 0.4, 0.5, 0.1,
cont_color, cont_width,
@@ -116,7 +116,7 @@
n, colors, values );
opt = bar_type | PL_COLORBAR_LABEL_UPPER | PL_COLORBAR_CAP_HIGH;
- opt_position = PL_COLORBAR_UPPER;
+ opt_position = PL_POSITION_UPPER;
plcolorbar( opt, opt_position, 0.1, 0.1, 0.5, 0.1,
cont_color, cont_width,
@@ -125,7 +125,7 @@
n, colors, values );
opt = bar_type | PL_COLORBAR_LABEL_LOWER | PL_COLORBAR_CAP_LOW;
- opt_position = PL_COLORBAR_LOWER;
+ opt_position = PL_POSITION_LOWER;
plcolorbar( opt, opt_position, 0.4, 0.1, 0.5, 0.1,
cont_color, cont_width,
@@ -168,7 +168,7 @@
PLINT opt, opt_position;
opt = bar_type | PL_COLORBAR_LABEL_LEFT | PL_COLORBAR_CAP_LOW;
- opt_position = PL_COLORBAR_LEFT;
+ opt_position = PL_POSITION_LEFT;
const char *axis_opts_1, *axis_opts_2;
if ( bar_type == PL_COLORBAR_SHADE_LABEL )
@@ -197,7 +197,7 @@
n, colors, values );
opt = bar_type | PL_COLORBAR_LABEL_RIGHT | PL_COLORBAR_CAP_HIGH;
- opt_position = PL_COLORBAR_RIGHT;
+ opt_position = PL_POSITION_RIGHT;
plcolorbar( opt, opt_position, 0.1, 0.4, 0.5, 0.1,
cont_color, cont_width,
@@ -206,7 +206,7 @@
n, colors, values );
opt = bar_type | PL_COLORBAR_LABEL_UPPER | PL_COLORBAR_CAP_LOW;
- opt_position = PL_COLORBAR_UPPER;
+ opt_position = PL_POSITION_UPPER;
plcolorbar( opt, opt_position, 0.1, 0.1, 0.5, 0.1,
cont_color, cont_width,
@@ -215,7 +215,7 @@
n, colors, values );
opt = bar_type | PL_COLORBAR_LABEL_LOWER | PL_COLORBAR_CAP_HIGH;
- opt_position = PL_COLORBAR_LOWER;
+ opt_position = PL_POSITION_LOWER;
plcolorbar( opt, opt_position, 0.4, 0.1, 0.5, 0.1,
cont_color, cont_width,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2011-01-30 20:03:04
|
Revision: 11535
http://plplot.svn.sourceforge.net/plplot/?rev=11535&view=rev
Author: airwin
Date: 2011-01-30 20:02:57 +0000 (Sun, 30 Jan 2011)
Log Message:
-----------
Change plcolorbar labels to be consistent with name of option.
Upper => Top
Lower => Bottom
Modified Paths:
--------------
trunk/examples/c/x33c.c
Modified: trunk/examples/c/x33c.c
===================================================================
--- trunk/examples/c/x33c.c 2011-01-29 23:45:49 UTC (rev 11534)
+++ trunk/examples/c/x33c.c 2011-01-30 20:02:57 UTC (rev 11535)
@@ -121,7 +121,7 @@
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",
+ axis_opts_2, "Test label - Top, High Cap",
n, colors, values );
position = PL_POSITION_BOTTOM;
@@ -130,7 +130,7 @@
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",
+ axis_opts_2, "Test label - Bottom, Low Cap",
n, colors, values );
plvpor( 0.0, 1.0, 0.0, 1.0 );
@@ -211,7 +211,7 @@
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",
+ axis_opts_2, "Test label - Top, Low Cap",
n, colors, values );
position = PL_POSITION_BOTTOM;
@@ -220,7 +220,7 @@
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",
+ axis_opts_2, "Test label - Bottom, High Cap",
n, colors, values );
plvpor( 0.0, 1.0, 0.0, 1.0 );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hez...@us...> - 2011-04-17 22:01:59
|
Revision: 11711
http://plplot.svn.sourceforge.net/plplot/?rev=11711&view=rev
Author: hezekiahcarty
Date: 2011-04-17 22:01:53 +0000 (Sun, 17 Apr 2011)
Log Message:
-----------
Add a large number of plcolorbar example pages to C example 33
These pages should exercise plcolorbar pretty heavily and are hopefully
simple to extend.
The plcolorbar API is still a work in progress, so these pages should not
be propagated to other languages at this time.
Modified Paths:
--------------
trunk/examples/c/x33c.c
Modified: trunk/examples/c/x33c.c
===================================================================
--- trunk/examples/c/x33c.c 2011-04-17 22:01:24 UTC (rev 11710)
+++ trunk/examples/c/x33c.c 2011-04-17 22:01:53 UTC (rev 11711)
@@ -60,6 +60,66 @@
"✦"
};
+// plcolorbar options
+
+// Colorbar type options
+#define COLORBAR_KINDS 4
+static PLINT colorbar_option_kinds[COLORBAR_KINDS] = {
+ PL_COLORBAR_SHADE,
+ PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL,
+ PL_COLORBAR_IMAGE,
+ PL_COLORBAR_GRADIENT
+};
+static const char *colorbar_option_kind_labels[COLORBAR_KINDS] = {
+ "Shade colorbars",
+ "Shade colorbars with custom labels",
+ "Image colorbars",
+ "Gradient colorbars"
+};
+
+// Which side of the page are we positioned relative to?
+#define COLORBAR_POSITIONS 4
+static PLINT colorbar_position_options[COLORBAR_POSITIONS] = {
+ PL_POSITION_LEFT,
+ PL_POSITION_RIGHT,
+ PL_POSITION_TOP,
+ PL_POSITION_BOTTOM
+};
+static const char *colorbar_position_option_labels[COLORBAR_POSITIONS] = {
+ "Left",
+ "Right",
+ "Top",
+ "Bottom"
+};
+
+// Colorbar label positioning options
+#define COLORBAR_LABELS 4
+static PLINT colorbar_label_options[COLORBAR_LABELS] = {
+ PL_COLORBAR_LABEL_LEFT,
+ PL_COLORBAR_LABEL_RIGHT,
+ PL_COLORBAR_LABEL_TOP,
+ PL_COLORBAR_LABEL_BOTTOM
+};
+static const char *colorbar_label_option_labels[COLORBAR_LABELS] = {
+ "Label left",
+ "Label right",
+ "Label top",
+ "Label bottom"
+};
+
+// Colorbar cap options
+#define COLORBAR_CAPS 3
+static PLINT colorbar_cap_options[COLORBAR_CAPS] = {
+ 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] = {
+ "Low cap",
+ "High cap",
+ "Low and high caps"
+};
+
static int colorbar = 0; // By default do not plot plcolorbar pages
// for now while we are working out the API.
static PLOptionTable options[] = {
@@ -86,171 +146,119 @@
const char *notes[] = { "Make sure you get it right!", NULL };
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 )
+plcolorbar_example_page( int kind_i, int label_i, int cap_i, PLINT cont_color, PLINT cont_width, PLINT n_values, PLFLT *values )
{
- PLFLT colors[n];
- int i;
- PLFLT color_step, color_offset;
- PLINT position, opt;
- const char *axis_opts_1, *axis_opts_2;
+ // Parameters for the colorbars on this page
+ PLINT position_i, position, opt;
+ PLFLT x, y, length, width;
+ PLFLT ticks;
+ PLINT sub_ticks;
+ PLFLT low_cap_color, high_cap_color;
+ PLINT vertical;
+ const char *axis_opts;
+ char label[200];
+ char title[200];
+
+ length = 0.5;
+ width = 0.05;
+
+ ticks = 0.0;
+ sub_ticks = 0;
+
+ low_cap_color = 0.0;
+ high_cap_color = 1.0;
+
+ // Start a new page
pladv( 0 );
- // Setup color palette 1
- plspal1( "cmap1_blue_red.pal", 1 );
- color_step = 1.0 / (PLFLT) ( n - 1 );
- for ( i = 0; i < n; i++ )
+ // Draw one colorbar relative to each side of the page
+ for ( position_i = 0; position_i < COLORBAR_POSITIONS; position_i ++ )
{
- colors[i] = color_offset + color_step * (PLFLT) ( i );
- }
+ position = colorbar_position_options[position_i];
+ opt =
+ colorbar_option_kinds[kind_i] |
+ colorbar_label_options[label_i] |
+ colorbar_cap_options[cap_i];
- position = PL_POSITION_LEFT;
- opt = bar_type | PL_COLORBAR_LABEL_LEFT | PL_COLORBAR_CAP_HIGH;
+ vertical = position & PL_POSITION_LEFT || position & PL_POSITION_RIGHT;
- if ( bar_type & PL_COLORBAR_SHADE_LABEL )
- {
- axis_opts_1 = "iv";
- axis_opts_2 = "i";
- }
- else
- {
- if ( sub_ticks != 0 )
+ // Set the offset position on the page
+ if ( vertical )
{
- axis_opts_1 = "stv";
- axis_opts_2 = "st";
+ x = 0.1;
+ y = 0.25;
}
else
{
- axis_opts_1 = "tv";
- axis_opts_2 = "t";
+ x = 0.25;
+ y = 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 );
+ // Set appropriate labeling options
+ if ( opt & PL_COLORBAR_SHADE_LABEL )
+ {
+ if ( vertical )
+ axis_opts = "iv";
+ else
+ axis_opts = "i";
+ }
+ else
+ {
+ if ( sub_ticks != 0 )
+ {
+ if ( vertical )
+ axis_opts = "stv";
+ else
+ axis_opts = "st";
+ }
+ else
+ {
+ if ( vertical )
+ axis_opts = "tv";
+ else
+ axis_opts = "t";
+ }
+ }
- position = PL_POSITION_RIGHT;
- opt = bar_type | PL_COLORBAR_LABEL_RIGHT | PL_COLORBAR_CAP_LOW;
+ sprintf( label, "%s, %s",
+ colorbar_position_option_labels[position_i],
+ colorbar_label_option_labels[label_i] );
- 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 );
+ plcolorbar( position, opt,
+ x, y, length, width,
+ low_cap_color, high_cap_color,
+ cont_color, cont_width,
+ ticks, sub_ticks,
+ axis_opts, label,
+ n_values, values );
+ }
- position = PL_POSITION_TOP;
- opt = bar_type | PL_COLORBAR_LABEL_TOP | PL_COLORBAR_CAP_HIGH;
-
- plcolorbar( position, opt, 0.1, 0.1, 0.5, 0.1,
- cont_color, cont_width,
- ticks, sub_ticks,
- axis_opts_2, "Test label - Top, High Cap",
- n, colors, values );
-
- position = PL_POSITION_BOTTOM;
- opt = bar_type | PL_COLORBAR_LABEL_BOTTOM | PL_COLORBAR_CAP_LOW;
-
- plcolorbar( position, opt, 0.4, 0.1, 0.5, 0.1,
- cont_color, cont_width,
- ticks, sub_ticks,
- axis_opts_2, "Test label - Bottom, Low Cap",
- n, colors, values );
-
+ // Draw a page title
+ sprintf( title, "%s - %s",
+ 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 );
}
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 )
+plcolorbar_example( const char *palette, int kind_i, PLINT cont_color, PLINT cont_width, PLINT n_values, PLFLT *values )
{
- 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 );
+ int label_i, cap_i;
- color_step = 1.0 / (PLFLT) ( n - 1 );
- for ( i = 0; i < n; 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 );
- }
+ // Load the color palette
+ plspal1( palette, 1 );
- position = PL_POSITION_LEFT;
- opt = bar_type | PL_COLORBAR_LABEL_LEFT | PL_COLORBAR_CAP_LOW;
-
- if ( bar_type == PL_COLORBAR_SHADE_LABEL )
+ for ( label_i = 0; label_i < COLORBAR_LABELS; label_i++ )
{
- axis_opts_1 = "";
- axis_opts_2 = "";
- }
- else
- {
- if ( sub_ticks != 0 )
+ for ( cap_i = 0; cap_i < COLORBAR_CAPS; cap_i++ )
{
- axis_opts_1 = "stv";
- axis_opts_2 = "st";
+ plcolorbar_example_page( kind_i, label_i, cap_i,
+ cont_color, cont_width,
+ n_values, values );
}
- else
- {
- axis_opts_1 = "tv";
- axis_opts_2 = "t";
- }
}
-
- plcolorbar( position, opt, 0.1, 0.1, 0.5, 0.1,
- cont_color, cont_width,
- ticks, sub_ticks,
- axis_opts_1, "Test label - Left, Low Cap",
- n, colors, values );
-
- position = PL_POSITION_RIGHT;
- opt = bar_type | PL_COLORBAR_LABEL_RIGHT | PL_COLORBAR_CAP_HIGH;
-
- plcolorbar( position, opt, 0.1, 0.4, 0.5, 0.1,
- cont_color, cont_width,
- ticks, sub_ticks,
- axis_opts_1, "Test label - Right, High Cap",
- n, colors, values );
-
- position = PL_POSITION_TOP;
- opt = bar_type | PL_COLORBAR_LABEL_TOP | PL_COLORBAR_CAP_LOW;
-
- plcolorbar( position, opt, 0.1, 0.1, 0.5, 0.1,
- cont_color, cont_width,
- ticks, sub_ticks,
- axis_opts_2, "Test label - Top, Low Cap",
- n, colors, values );
-
- position = PL_POSITION_BOTTOM;
- opt = bar_type | PL_COLORBAR_LABEL_BOTTOM | PL_COLORBAR_CAP_HIGH;
-
- plcolorbar( position, opt, 0.4, 0.1, 0.5, 0.1,
- cont_color, cont_width,
- ticks, sub_ticks,
- axis_opts_2, "Test label - Bottom, High Cap",
- n, colors, values );
-
- plvpor( 0.0, 1.0, 0.0, 1.0 );
- plwind( 0.0, 1.0, 0.0, 1.0 );
- plptex( 0.5, 0.5, 0.0, 0.0, 0.5, title );
}
//--------------------------------------------------------------------------
@@ -817,20 +825,25 @@
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.0, 0, 2, values_small, "Image Color Bars" );
- plcolorbar_example_2( PL_COLORBAR_IMAGE, 0, 0, 0.0, 0, 2, values_small, "Image Color Bars" );
- plcolorbar_example_1( PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0, 0, 0.0, 0, 9, values_uneven,
- "Shade Color Bars - Uneven Steps" );
- plcolorbar_example_2( PL_COLORBAR_SHADE, 0, 0, 3.0, 3, 9, values_even,
- "Shade Color Bars - Even Steps" );
- plcolorbar_example_1( PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 2, 1, 0.0, 0, 9, values_uneven,
- "Shade Color Bars - Uneven Steps, Contours" );
- plcolorbar_example_2( PL_COLORBAR_SHADE, 2, 3, 3.0, 3, 9, values_even,
- "Shade Color Bars - Even Steps, Contours" );
- plcolorbar_example_1( PL_COLORBAR_GRADIENT, 0, 0, 0.5, 5, 2, values_small,
- "Gradient Color Bars" );
- plcolorbar_example_2( PL_COLORBAR_GRADIENT, 0, 0, 0.5, 5, 2, values_small,
- "Gradient Color Bars" );
+
+ // Cut out the greatest and smallest bits of the color spectrum to
+ // leave colors for the end caps.
+ 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 ++ )
+ {
+ plcolorbar_example( "cmap1_blue_yellow.pal", i, 0, 0, 2, values_small );
+ }
+ // Test shade colorbars with larger arrays
+ for ( i = 0; i < 2; i++ )
+ {
+ plcolorbar_example( "cmap1_blue_yellow.pal", i, 0, 0, 9, values_even );
+ }
+ for ( i = 0; i < 2; i++ )
+ {
+ plcolorbar_example( "cmap1_blue_yellow.pal", i, 0, 0, 9, values_uneven );
+ }
}
plend();
exit( 0 );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hez...@us...> - 2011-04-17 22:02:54
|
Revision: 11713
http://plplot.svn.sourceforge.net/plplot/?rev=11713&view=rev
Author: hezekiahcarty
Date: 2011-04-17 22:02:48 +0000 (Sun, 17 Apr 2011)
Log Message:
-----------
Show colorbar shade contours in one set of example pages in C example 33
Modified Paths:
--------------
trunk/examples/c/x33c.c
Modified: trunk/examples/c/x33c.c
===================================================================
--- trunk/examples/c/x33c.c 2011-04-17 22:02:25 UTC (rev 11712)
+++ trunk/examples/c/x33c.c 2011-04-17 22:02:48 UTC (rev 11713)
@@ -849,7 +849,7 @@
// Test shade colorbars with larger arrays
for ( i = 0; i < 2; i++ )
{
- plcolorbar_example( "cmap1_blue_yellow.pal", i, 0, 0, 9, values_even );
+ plcolorbar_example( "cmap1_blue_yellow.pal", i, 4, 2, 9, values_even );
}
for ( i = 0; i < 2; i++ )
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2011-05-01 19:33:00
|
Revision: 11740
http://plplot.svn.sourceforge.net/plplot/?rev=11740&view=rev
Author: airwin
Date: 2011-05-01 19:32:54 +0000 (Sun, 01 May 2011)
Log Message:
-----------
Use different cmap1 color scheme that does not have max or min colour
equal to the background. This gets rid of the "empty" cap case (where
cap colour is the same as the background colour) that looks like an
error.
Modified Paths:
--------------
trunk/examples/c/x33c.c
Modified: trunk/examples/c/x33c.c
===================================================================
--- trunk/examples/c/x33c.c 2011-05-01 19:27:20 UTC (rev 11739)
+++ trunk/examples/c/x33c.c 2011-05-01 19:32:54 UTC (rev 11740)
@@ -848,16 +848,16 @@
// We can only test image and gradient colorbars with two element arrays
for ( i = 2; i < COLORBAR_KINDS; i ++ )
{
- plcolorbar_example( "cmap1_blue_yellow.pal", i, 0, 0, 2, values_small );
+ plcolorbar_example( "cmap1_blue_red.pal", i, 0, 0, 2, values_small );
}
// Test shade colorbars with larger arrays
for ( i = 0; i < 2; i++ )
{
- plcolorbar_example( "cmap1_blue_yellow.pal", i, 4, 2, 9, values_even );
+ plcolorbar_example( "cmap1_blue_red.pal", i, 4, 2, 9, values_even );
}
for ( i = 0; i < 2; i++ )
{
- plcolorbar_example( "cmap1_blue_yellow.pal", i, 0, 0, 9, values_uneven );
+ plcolorbar_example( "cmap1_blue_red.pal", i, 0, 0, 9, values_uneven );
}
}
plend();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2011-05-02 00:59:12
|
Revision: 11742
http://plplot.svn.sourceforge.net/plplot/?rev=11742&view=rev
Author: airwin
Date: 2011-05-02 00:59:06 +0000 (Mon, 02 May 2011)
Log Message:
-----------
Move back to cmap1_blue_red.pal since that cmap1 shows interesting
abrupt changes for the end cap colours. Since one of those end cap
colours is black, change the background of the -colorbar pages to
an unsaturated green to contrast with that black colour.
Modified Paths:
--------------
trunk/examples/c/x33c.c
Modified: trunk/examples/c/x33c.c
===================================================================
--- trunk/examples/c/x33c.c 2011-05-01 20:08:03 UTC (rev 11741)
+++ trunk/examples/c/x33c.c 2011-05-02 00:59:06 UTC (rev 11742)
@@ -836,6 +836,8 @@
if ( colorbar )
{
+ // Use unsaturated green background colour to contrast with black caps.
+ 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 };
@@ -848,16 +850,16 @@
// We can only test image and gradient colorbars with two element arrays
for ( i = 2; i < COLORBAR_KINDS; i ++ )
{
- plcolorbar_example( "cmap1_blue_red.pal", i, 0, 0, 2, values_small );
+ plcolorbar_example( "cmap1_blue_yellow.pal", i, 0, 0, 2, values_small );
}
// Test shade colorbars with larger arrays
for ( i = 0; i < 2; i++ )
{
- plcolorbar_example( "cmap1_blue_red.pal", i, 4, 2, 9, values_even );
+ plcolorbar_example( "cmap1_blue_yellow.pal", i, 4, 2, 9, values_even );
}
for ( i = 0; i < 2; i++ )
{
- plcolorbar_example( "cmap1_blue_red.pal", i, 0, 0, 9, values_uneven );
+ plcolorbar_example( "cmap1_blue_yellow.pal", i, 0, 0, 9, values_uneven );
}
}
plend();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2011-06-14 06:17:44
|
Revision: 11769
http://plplot.svn.sourceforge.net/plplot/?rev=11769&view=rev
Author: airwin
Date: 2011-06-14 06:17:38 +0000 (Tue, 14 Jun 2011)
Log Message:
-----------
Plot both background and edge of colorbar bounding box to help
diagnose any colorbar bounding box or positioning issues. For
example, this plot currently demonstrates there are no such issues
associated with the caps, but there continues to be the well-known
issues where the numerical labeling of tick marks and the labels are
currently ignored for bounding box size and position.
Modified Paths:
--------------
trunk/examples/c/x33c.c
Modified: trunk/examples/c/x33c.c
===================================================================
--- trunk/examples/c/x33c.c 2011-06-14 06:13:31 UTC (rev 11768)
+++ trunk/examples/c/x33c.c 2011-06-14 06:17:38 UTC (rev 11769)
@@ -235,10 +235,12 @@
plvpor( 0.1, 0.9, 0.1, 0.9 );
plwind( 0.0, 1.0, 0.0, 1.0 );
+ // Set interesting background colour.
+ plscol0a( 15, 0, 0, 0, 0.20 );
plcolorbar( &colorbar_width, &colorbar_height,
- opt, position,
+ opt|PL_COLORBAR_BOUNDING_BOX|PL_COLORBAR_BACKGROUND, position,
x, y, x_length, y_length,
- 0, 1, 1,
+ 15, 1, 1,
low_cap_color, high_cap_color,
cont_color, cont_width,
ticks, sub_ticks,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2011-06-15 16:55:24
|
Revision: 11770
http://plplot.svn.sourceforge.net/plplot/?rev=11770&view=rev
Author: airwin
Date: 2011-06-15 16:55:17 +0000 (Wed, 15 Jun 2011)
Log Message:
-----------
Adjust positions of colorbars so that text doesn't get clipped.
Modified Paths:
--------------
trunk/examples/c/x33c.c
Modified: trunk/examples/c/x33c.c
===================================================================
--- trunk/examples/c/x33c.c 2011-06-14 06:17:38 UTC (rev 11769)
+++ trunk/examples/c/x33c.c 2011-06-15 16:55:17 UTC (rev 11770)
@@ -233,7 +233,7 @@
plsmaj( 0.0, 0.5 );
plsmin( 0.0, 0.5 );
- plvpor( 0.1, 0.9, 0.1, 0.9 );
+ plvpor( 0.15, 0.85, 0.15, 0.85 );
plwind( 0.0, 1.0, 0.0, 1.0 );
// Set interesting background colour.
plscol0a( 15, 0, 0, 0, 0.20 );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2011-07-11 21:33:18
|
Revision: 11805
http://plplot.svn.sourceforge.net/plplot/?rev=11805&view=rev
Author: airwin
Date: 2011-07-11 21:33:12 +0000 (Mon, 11 Jul 2011)
Log Message:
-----------
Show how to test parallel axis labels for vertical axis of colorbars,
but comment out (now that I have finished that test).
Modified Paths:
--------------
trunk/examples/c/x33c.c
Modified: trunk/examples/c/x33c.c
===================================================================
--- trunk/examples/c/x33c.c 2011-07-10 17:27:00 UTC (rev 11804)
+++ trunk/examples/c/x33c.c 2011-07-11 21:33:12 UTC (rev 11805)
@@ -205,10 +205,12 @@
if ( cont_color == 0 || cont_width == 0 )
{
axis_opts = "uwtivn";
+ //axis_opts = "uwtin";
}
else
{
axis_opts = "uwxvn";
+ //axis_opts = "uwxn";
}
}
else
@@ -216,10 +218,12 @@
if ( cont_color == 0 || cont_width == 0 )
{
axis_opts = "uwtivm";
+ //axis_opts = "uwtim";
}
else
{
axis_opts = "uwxvm";
+ //axis_opts = "uwxm";
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2011-07-11 22:03:21
|
Revision: 11806
http://plplot.svn.sourceforge.net/plplot/?rev=11806&view=rev
Author: airwin
Date: 2011-07-11 22:03:15 +0000 (Mon, 11 Jul 2011)
Log Message:
-----------
Use negative numbers in range to make sure bounding-box calculation is
still good for that. (It was.)
Modified Paths:
--------------
trunk/examples/c/x33c.c
Modified: trunk/examples/c/x33c.c
===================================================================
--- trunk/examples/c/x33c.c 2011-07-11 21:33:12 UTC (rev 11805)
+++ trunk/examples/c/x33c.c 2011-07-11 22:03:15 UTC (rev 11806)
@@ -845,13 +845,13 @@
if ( colorbar )
{
+ // Color bar examples
+ PLFLT values_small[2] = { -1.0e-200, 1.0e-200 };
+ PLFLT values_uneven[9] = { -1.0e-200, 2.0e-200, 2.6e-200, 3.4e-200, 6.0e-200, 7.0e-200, 8.0e-200, 9.0e-200, 10.0e-200 };
+ PLFLT values_even[9] = { -2.0e-200, -1.0e-200, 0.0e-200, 1.0e-200, 2.0e-200, 3.0e-200, 4.0e-200, 5.0e-200, 6.0e-200 };
+
// Use unsaturated green background colour to contrast with black caps.
plscolbg( 70, 185, 70 );
- // Color bar examples
- PLFLT values_small[2] = { 0.0e-200, 1.0e-200 };
- PLFLT values_uneven[9] = { 0.0e-200, 2.0e-200, 2.6e-200, 3.4e-200, 6.0e-200, 7.0e-200, 8.0e-200, 9.0e-200, 10.0e-200 };
- PLFLT values_even[9] = { 0.0e-200, 1.0e-200, 2.0e-200, 3.0e-200, 4.0e-200, 5.0e-200, 6.0e-200, 7.0e-200, 8.0e-200 };
-
// Cut out the greatest and smallest bits of the color spectrum to
// leave colors for the end caps.
plscmap1_range( 0.01, 0.99 );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2011-07-14 16:38:04
|
Revision: 11816
http://plplot.svn.sourceforge.net/plplot/?rev=11816&view=rev
Author: airwin
Date: 2011-07-14 16:37:58 +0000 (Thu, 14 Jul 2011)
Log Message:
-----------
Decrease size of overall viewport so there is room to display labelled
and decorated colorbar.
Modified Paths:
--------------
trunk/examples/c/x33c.c
Modified: trunk/examples/c/x33c.c
===================================================================
--- trunk/examples/c/x33c.c 2011-07-14 16:36:01 UTC (rev 11815)
+++ trunk/examples/c/x33c.c 2011-07-14 16:37:58 UTC (rev 11816)
@@ -237,7 +237,7 @@
plsmaj( 0.0, 0.5 );
plsmin( 0.0, 0.5 );
- plvpor( 0.15, 0.85, 0.15, 0.85 );
+ plvpor( 0.20, 0.80, 0.20, 0.80 );
plwind( 0.0, 1.0, 0.0, 1.0 );
// Set interesting background colour.
plscol0a( 15, 0, 0, 0, 0.20 );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2013-05-22 22:41:00
|
Revision: 12345
http://sourceforge.net/p/plplot/code/12345
Author: andrewross
Date: 2013-05-22 22:40:57 +0000 (Wed, 22 May 2013)
Log Message:
-----------
Enable colorbar tests in example 33 by default.
Modified Paths:
--------------
trunk/examples/c/x33c.c
Modified: trunk/examples/c/x33c.c
===================================================================
--- trunk/examples/c/x33c.c 2013-05-22 22:39:26 UTC (rev 12344)
+++ trunk/examples/c/x33c.c 2013-05-22 22:40:57 UTC (rev 12345)
@@ -125,7 +125,7 @@
"Low and high caps"
};
-static int colorbar = 0; // By default do not plot plcolorbar pages
+static int colorbar = 1; // By default do not plot plcolorbar pages
// for now while we are working out the API.
static PLOptionTable options[] = {
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2013-10-26 02:45:26
|
Revision: 12631
http://sourceforge.net/p/plplot/code/12631
Author: airwin
Date: 2013-10-26 02:45:20 +0000 (Sat, 26 Oct 2013)
Log Message:
-----------
Fix minor memory leak in example.
Modified Paths:
--------------
trunk/examples/c/x33c.c
Modified: trunk/examples/c/x33c.c
===================================================================
--- trunk/examples/c/x33c.c 2013-10-26 01:00:43 UTC (rev 12630)
+++ trunk/examples/c/x33c.c 2013-10-26 02:45:20 UTC (rev 12631)
@@ -275,6 +275,7 @@
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 );
+ free( label );
}
void
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|