|
From: <arj...@us...> - 2013-07-15 06:45:32
|
Revision: 12422
http://sourceforge.net/p/plplot/code/12422
Author: arjenmarkus
Date: 2013-07-15 06:45:29 +0000 (Mon, 15 Jul 2013)
Log Message:
-----------
First shot at implementing plcolorbar. The result is not quite like the C
example yet - also only one plot has any colorbar sofar. More tweaking required.
Modified Paths:
--------------
trunk/examples/tcl/x16.tcl
Modified: trunk/examples/tcl/x16.tcl
===================================================================
--- trunk/examples/tcl/x16.tcl 2013-07-15 06:44:11 UTC (rev 12421)
+++ trunk/examples/tcl/x16.tcl 2013-07-15 06:45:29 UTC (rev 12422)
@@ -21,6 +21,14 @@
matrix zz f $nx $ny
matrix ww f $nx $ny
+# Colorbar - note: single values, as we have only one bar
+ set n_axis_opts 1
+ set axis_opts "bcvtm"
+ set axis_ticks 0.0
+ set axis_subticks 0
+ set label_opts $::PLPLOT::PL_COLORBAR_LABEL_BOTTOM
+ set labels "Magnitude"
+
# Set up data array
for {set i 0} {$i < $nx} {incr i} {
@@ -91,6 +99,31 @@
shedge $fill_width $cont_color $cont_width \
1 "NULL"
+
+ # Colorbar:
+ # We draw only one bar, so use single values, not lists
+ #
+ # Smaller text
+ $w cmd plschr 0.0 0.75
+ # Small ticks on the vertical axis
+ $w cmd plsmaj 0.0 0.5
+ $w cmd plsmin 0.0 0.5
+
+ $w cmd plcolorbar \
+ [expr {$::PLPLOT::PL_COLORBAR_SHADE | $::PLPLOT::PL_COLORBAR_SHADE_LABEL}] 0 \
+ 0.005 0.0 0.0375 0.875 0 1 1 0.0 0.0 \
+ $cont_color $cont_width \
+ $label_opts $labels \
+ $axis_opts \
+ $axis_ticks $axis_subticks \
+ shedge
+
+ # Reset text and tick sizes
+ $w cmd plschr 0.0 1.0
+ $w cmd plsmaj 0.0 1.0
+ $w cmd plsmin 0.0 1.0
+
+
$w cmd plcol0 1
$w cmd plbox "bcnst" 0.0 0 "bcnstv" 0.0 0
$w cmd plcol0 2
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|