$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r51642 - in sandbox/SOC/2007/visualization/boost/svg_plot: . detail
From: pbristow_at_[hidden]
Date: 2009-03-07 13:46:32
Author: pbristow
Date: 2009-03-07 13:46:31 EST (Sat, 07 Mar 2009)
New Revision: 51642
URL: http://svn.boost.org/trac/boost/changeset/51642
Log:
1d and 2d improved and control of uncertainty font, color added.
Text files modified: 
   sandbox/SOC/2007/visualization/boost/svg_plot/detail/axis_plot_frame.hpp |    95 +++++++++++++++++++++++++++++---------- 
   sandbox/SOC/2007/visualization/boost/svg_plot/show_2d_settings.hpp       |     9 +++                                     
   sandbox/SOC/2007/visualization/boost/svg_plot/svg_2d_plot.hpp            |    56 ++++++++++++++++++++--                  
   sandbox/SOC/2007/visualization/boost/svg_plot/svg_style.hpp              |    50 ++++++++++++--------                    
   4 files changed, 156 insertions(+), 54 deletions(-)
Modified: sandbox/SOC/2007/visualization/boost/svg_plot/detail/axis_plot_frame.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/detail/axis_plot_frame.hpp	(original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/detail/axis_plot_frame.hpp	2009-03-07 13:46:31 EST (Sat, 07 Mar 2009)
@@ -48,6 +48,8 @@
     //    when they are in svg_2d_plot.hpp
 
     static const double sin45 = 0.707; //!< Use to calculate 'length' if axis value labels are sloping.
+    static const double reducer = 0.9; // To make uncertainty and df a bit smaller to distinguish from value.
+          // 0.8 reduced from value 12, to 9 which is a bit too small.
 
     // x_axis_position_ and y_axis_position_ use x_axis_intersect & y_axis_intersect
     enum x_axis_intersect
@@ -87,9 +89,8 @@
         */
         //protected:
       public:
-        // --------------------------------------------------------------------
         // We don't use the SVG coordinate transform because then text would
-        // be flipped. I'm considering using it to scale the image for resizes.
+        // be flipped. Might use it to scale the image for resizes.
 
         // protected member functions (defined below):
 
@@ -1125,10 +1126,9 @@
               rot = uphill;
              break;
             } // switch
-
-            text_element& t = g_ptr.text(x, y, stripped, val_style.values_text_style_, al, rot);  // X or Y value "1.23"
-            int f = static_cast<int>(val_style.values_text_style_.font_size() * 0.8); // Make uncertainty and df a bit smaller to distinguish from value.
-
+            text_element& t = g_ptr.text(x, y, stripped, val_style.values_text_style_, al, rot);  // X or Y value "1.23".
+            int udf_font = static_cast<int>(val_style.values_text_style_.font_size() * reducer);
+          
             std::string label_u; // Uncertainty or plusminus.
             std::string label_df; // Degrees of freedom estimate.
             std::string pm = " ±"; //! Unicode space plusminus glyph.
@@ -1147,8 +1147,8 @@
               )
             {  // Uncertainty estimate usually 95% confidence interval + or - 2 standard deviation.
               label_u = sv(u, val_style, true); // stripped.
-              t.tspan(pm).fill_color(darkcyan);
-              t.tspan(label_u).fill_color(purple).font_size(f);
+              t.tspan(pm).fill_color(val_style.plusminus_color_);
+              t.tspan(label_u).fill_color(val_style.plusminus_color_).font_size(udf_font);
               // TODO Colors should not be hard coded.
             }
             if (val_style.df_on_ == true // Is wanted.
@@ -1161,13 +1161,14 @@
               label << " (" << df << ")"; // "123"
               // Explicit space " " seems necessary.
               label_df = label.str();
-              t.tspan(label_df).fill_color(brown).font_size(f);
+              t.tspan(label_df).fill_color(val_style.df_color_).font_size(udf_font);
             }
 
           } // void draw_plot_point_value(double x, double y, g_element& g_ptr, double value)
 
           std::string sv(double v, const value_style& sty, bool precise = false)
           { //! Strip from double value any unecessary e, +, & leading exponent zeros, reducing "1.200000" to "1.2" or "3.4e1"...
+            // TODO rename fo strip_value?
             std::stringstream label;
             // Precision of uncertainty is usually less than precision of value,
             // label.precision((unc) ? ((sty.value_precision_ > 3) ?  sty.value_precision_-2 : 1) : sty.value_precision_);
@@ -1276,10 +1277,10 @@
             // something that proves to be very effective at visually separating
             // value and uncertainty, and degrees of freedom estimate.
             // So the coding complexity is judged with it (even if it may not always work right yet ;-)
-
+            // prefix, separator and suffix are  all black at present.
             // Tasteless colors and font changes are purely proof of concept.
 
-            int fx = static_cast<int>(y_sty.values_text_style_.font_size() * 0.8);
+            int fx = static_cast<int>(x_sty.values_text_style_.font_size() * reducer);
             // Make uncertainty and df a bit smaller to distinguish from value by default (but make configurable).
             // X value (and optional uncertainty & df).
             text_element& t = x_g_ptr.text(x, y, label_xv, x_sty.values_text_style_, al, rot);
@@ -1294,8 +1295,10 @@
                 )
             {  // Uncertainty estimate usually 95% confidence interval + or - 2 standard deviation.
               label_xu = sv(ux, x_sty, true);
-              t.tspan(pm).fill_color(darkcyan);
-              t.tspan(label_xu).fill_color(darkcyan).font_weight("bold").font_size(fx);
+              //t.tspan(pm).fill_color(darkcyan);
+              // Should this be stroke_color?
+              t.tspan(pm).fill_color(x_sty.plusminus_color_);
+              t.tspan(label_xu).fill_color(x_sty.plusminus_color_).font_size(fx); // .font_weight("bold")
             }
             if (
                  (x_sty.df_on_ == true)  // Is wanted.
@@ -1309,14 +1312,14 @@
               label << " (" << dfx << ")"; // "123.5"
               // Explicit space " " seems necessary.
               label_xdf = label.str();
-              t.tspan(label_xdf).fill_color(brown).font_size(fx);
+              t.tspan(label_xdf).fill_color(x_sty.df_color_).font_size(fx);
             }
-            int fy = static_cast<int>(y_sty.values_text_style_.font_size() * 0.8);
+            int fy = static_cast<int>(y_sty.values_text_style_.font_size() * reducer);
            // If there is a separator, put values on the same line, else as below put below the marker.
             bool sameline = (x_sty.separator_ != ""); // Might add to value_style? to allow 1.2, with 3.4 on line below.
             if (sameline)
             { // On same line so no change in y.
-              t.tspan(x_sty.separator_).fill_color(brown).font_size(fx); // Separator like comma and leading space ", ".
+              t.tspan(x_sty.separator_).fill_color(black).font_size(fx); // Separator like comma and leading space ", ".
               t.tspan(label_yv, y_sty.values_text_style_); // Color?
               if (
                    (y_sty.plusminus_on_) // Is wanted.
@@ -1326,7 +1329,7 @@
                  // Precision of uncertainty is usually less than value,
                 label_yu = " " + sv(uy, y_sty, true);
                 t.tspan(pm).font_family("arial").font_size(fy).fill_color(green);
-                t.tspan(label_yu).fill_color(green).font_size(fy);
+                t.tspan(label_yu).fill_color(y_sty.plusminus_color_).font_size(fy);
               }
               if ((y_sty.df_on_ == true)
                 && (dfy != (std::numeric_limits<unsigned short int>::max)())
@@ -1337,7 +1340,7 @@
                 //label.flags(sty.value_ioflags_); // Leave at default.
                 label <<" (" << dfy << ")"; // "123.5"
                 label_ydf = label.str();
-                t.tspan(label_ydf).fill_color(lime).font_size(fy);
+                t.tspan(label_ydf).fill_color(y_sty.df_color_).font_size(fy);
               }
               if (y_sty.prefix_ != "")
               { // Want a suffix like "]" - with the Y values font size, not reduced for uncertainty info.
@@ -1357,8 +1360,8 @@
               {  // Uncertainty estimate usually 95% confidence interval + or - 2 standard deviation.
                  // Precision of uncertainty is usually less than value,
                 label_yu = " " + sv(uy, y_sty, true);
-                ty.tspan(pm).font_family("arial").font_size(fy).fill_color(green);
-                ty.tspan(label_yu).fill_color(green).font_size(fy);
+                ty.tspan(pm).font_family("arial").font_size(fy).fill_color(y_sty.plusminus_color_);
+                ty.tspan(label_yu).fill_color(y_sty.plusminus_color_).font_size(fy);
               }
               if ((y_sty.df_on_ == true)  // Is wanted.
                     && (dfy != (std::numeric_limits<unsigned short int>::max)()) // and deg_free is defined OK.
@@ -1369,11 +1372,11 @@
                 //label.flags(sty.value_ioflags_); // Leave at default.
                 label <<" (" << dfy << ")"; // "123.5"
                 label_ydf = label.str();
-                ty.tspan(label_ydf).fill_color(lime).font_size(fy);
+                ty.tspan(label_ydf).fill_color(y_sty.df_color_).font_size(fy);
               }
               if (y_sty.prefix_ != "")
               { // Want a suffix like "]"
-                ty.tspan(y_sty.suffix_).fill_color(lime).font_size(fy);
+                ty.tspan(y_sty.suffix_).fill_color(black).font_size(fy);
               }
             }
           } // void draw_plot_point_values(double x, double y, g_element& g_ptr, double value)
@@ -1658,6 +1661,7 @@
           Derived& x_values_font_family(const std::string& family);
           const std::string& x_values_font_family();
           Derived& x_major_interval(double inter);
+
           Derived& x_values_color(const svg_color& col);
           svg_color x_values_color();
           Derived& x_values_rotation(rotate_style rotate);
@@ -1668,8 +1672,12 @@
           std::ios_base::fmtflags x_values_ioflags();
           Derived& x_plusminus_on(bool b);
           bool x_plusminus_on();
+          Derived& x_plusminus_color(const svg_color& col);
+          svg_color x_plusminus_color();
           Derived& x_df_on(bool b);
           bool x_df_on();
+          Derived& x_df_color(const svg_color& col);
+          svg_color x_df_color();
           double x_major_interval();
           Derived& x_major_tick_length(double length);
           double x_major_tick_length();
@@ -3124,7 +3132,14 @@
 
           template <class Derived>
           Derived& axis_plot_frame<Derived>::x_values_on(bool b)
-          { //! If set true, show data point values near data points markers.
+          { //! \return true if values of X data points are shown (for example: 1.23).
+            // (Want override xy_values_on that would otherwise cause overwriting).
+            // So the last values_on setting will prevail.
+            // But this is only defined in 2D
+            //if(derived().xy_values_on())
+            //{ // Would be overwritten by XY pair.
+            //  derived().xy_values_on(false);
+            //}
             derived().x_values_on_ = b;
             return derived();
           }
@@ -3178,10 +3193,12 @@
           Derived& axis_plot_frame<Derived>::x_values_color(const svg_color& col)
           { //! Set the color of data point X values near data points markers.
             // Function could set both fill (middle) and stroke (outside),
-            // but just setting fill if simplest,
+            // but just setting fill is simplest,
             // but does not allow separate inside & outside colors.
+            // Might be better to set in x_values_style
             derived().image.g(PLOT_X_POINT_VALUES).style().fill_color(col);
             //derived().image.g(PLOT_X_POINT_VALUES).style().stroke_color(col);
+
             return derived();
           }
 
@@ -3251,8 +3268,21 @@
           }
 
           template <class Derived>
+          Derived& axis_plot_frame<Derived>::x_plusminus_color(const svg_color& col)
+          { //! Set the color of X uncertainty of value, for example, the color of 0.02 in "1.23 +-0.02 (9)".
+            derived().x_values_style_.plusminus_color_ = col;
+            return derived();
+          }
+
+          template <class Derived>
+          svg_color axis_plot_frame<Derived>::x_plusminus_color()
+          { //! Get the color of X uncertainty of value, for example, the color of 0.02 in "1.23 +-0.02 (9)".
+            return derived().x_values_style_.plusminus_color_;
+          }
+
+           template <class Derived>
           Derived& axis_plot_frame<Derived>::x_df_on(bool b)
-          { //! Set if to append a degrees of freedom estimate to data point X values near data points markers.
+          { //! Set true if to append a degrees of freedom estimate to data point X values near data points markers.
             //! (May not be implemented yet).
             derived().x_values_style_.df_on_ = b;
             return derived();
@@ -3260,11 +3290,24 @@
 
           template <class Derived>
           bool axis_plot_frame<Derived>::x_df_on()
-          { //! \return  if to append a degrees of freedom estimate to data point X values near data points markers.
+          { //! \return true if to append a degrees of freedom estimate to data point X values near data points markers.
             //! (May not be implemented yet).
             return derived().x_values_style_.df_on_;
           }
 
+         template <class Derived>
+          Derived& axis_plot_frame<Derived>::x_df_color(const svg_color& col)
+          { //! Set the color of X degrees of freedom, for example, the color of 9 in "1.23 +-0.02 (9)".
+            derived().x_values_style_.df_color_ = col;
+            return derived();
+          }
+
+          template <class Derived>
+          svg_color axis_plot_frame<Derived>::x_df_color()
+          { //! Get the color of X degrees of freedom, for example, the color of 9 in "1.23 +-0.02 (9)".
+            return derived().x_values_style_.df_color_;
+          }
+
           template <class Derived>
           Derived& axis_plot_frame<Derived>::x_major_tick_length(double length)
           { //! Set length of X major ticks.
Modified: sandbox/SOC/2007/visualization/boost/svg_plot/show_2d_settings.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/show_2d_settings.hpp	(original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/show_2d_settings.hpp	2009-03-07 13:46:31 EST (Sat, 07 Mar 2009)
@@ -191,6 +191,9 @@
   //cout << "title_font_width " << plot.title_font_width() << endl;
   // Not useful at present, so not longer implemented.
   cout << "x_values_on "  << plot.x_values_on() << endl;
+  cout << "x_values_font_size "  << plot.x_values_font_size() << endl;
+  cout << "x_values_font_family "  << plot.x_values_font_family() << endl;
+
   cout << "x_value_precision " << plot.x_value_precision() << endl;
   cout << "x_value_ioflags " << hex << plot.x_value_ioflags() << dec << ' ';
   outFmtFlags(plot.x_value_ioflags(), cout,  ".\n");
@@ -243,7 +246,9 @@
   cout << "y_axis_position " << plot.y_axis_position() << endl;
   cout << "x_axis_position " << plot.x_axis_position() << endl;
   cout << "x_plusminus_on " << plot.x_plusminus_on() << endl;
+  cout << "x_plusminus_color " << plot.x_plusminus_color() << endl;
   cout << "x_df_on " << plot.x_df_on() << endl;
+  cout << "x_df_color " << plot.x_df_color() << endl;
   cout << "xy_values_on "  << plot.xy_values_on() << endl;
   cout << "y_label_on " << plot.y_label_on() << endl;
   cout << "y_label_axis " << plot.y_label_axis() << endl;
@@ -285,9 +290,11 @@
   cout << "y_ticks_on_window_or_axis " << l_or_r(plot.y_ticks_on_window_or_axis()) << endl;
   cout << "y_max " << plot.y_max() << endl;
   cout << "y_min " << plot.y_min() << endl;
-  cout << "y_values_on "  << plot.y_values_on() << endl;
+  //cout << "y_values_on "  << plot.y_values_on() << endl;
   cout << "y_plusminus_on " << plot.y_plusminus_on() << endl;
+  cout << "y_plusminus_color " << plot.y_plusminus_color() << endl;
   cout << "y_df_on " << plot.y_df_on() << endl;
+  cout << "y_df_color " << plot.y_df_color() << endl;
 
   cout << "data lines width " << plot.data_lines_width() << endl;
 
Modified: sandbox/SOC/2007/visualization/boost/svg_plot/svg_2d_plot.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/svg_2d_plot.hpp	(original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/svg_2d_plot.hpp	2009-03-07 13:46:31 EST (Sat, 07 Mar 2009)
@@ -516,8 +516,8 @@
         title_on_(true),
         plot_window_on_(true),
         // Can have either or both X and Y value shown.
-        x_values_on_(false), // If X values of data are shown.
-        y_values_on_(false), // If Y values of data are shown.
+        x_values_on_(false), // If X values of data points are shown.
+        y_values_on_(false), // If Y values of data points are shown.
         xy_values_on_(false), // If X & Y values of data are shown as a pair.
         x_values_style_(horizontal, 3, std::ios::dec, true, value_style_, black, black, false, false),
         y_values_style_(downward, 3, std::ios::dec, true, value_style_, black, black, false, false),
@@ -1903,8 +1903,13 @@
       svg_2d_plot& xy_values_on(bool b);
       bool y_plusminus_on();
       svg_2d_plot& y_plusminus_on(bool b);
+      svg_2d_plot& y_plusminus_color(const svg_color& col);
+      const svg_color y_plusminus_color();
       bool y_df_on();
       svg_2d_plot& y_df_on(bool b);
+      svg_2d_plot& y_df_color(const svg_color& col);
+      const svg_color y_df_color();
+
       svg_2d_plot& y_autoscale(double first, double second);
       svg_2d_plot& y_autoscale(std::pair<double, double> p);
       template <class T> // T an STL container: array, vector ...
@@ -2277,24 +2282,39 @@
         return *this; //! \return reference to svg_2d_plot to make chainable.
       }
 
-      bool  svg_2d_plot::y_values_on()
-      { //! \return true if values of Y data points are shown (as 1.23).
+      bool svg_2d_plot::y_values_on()
+      { //! \return true if values of Y data points are shown (for example: 1.23).
+        //! (Will override xy_values_on that would otherwise cause overwriting).
+        //! So the last values_on setting will prevail.
         return y_values_on_;
       }
 
       svg_2d_plot&  svg_2d_plot::y_values_on(bool b)
-      { //! Set true if values of Y data points are shown (as 1.23).
+      { //! Set true if values of Y data points are shown (for example: 1.23).
+        if(xy_values_on() == true)
+        { // Would be overwritten by XY pair.
+          xy_values_on(false);
+        }
         y_values_on_ = b;
         return *this; //! \return reference to svg_2d_plot to make chainable.
       }
 
-      bool  svg_2d_plot::xy_values_on()
-      { //! \return true if values of X and Y data points are shown (as 1.23).
+      bool svg_2d_plot::xy_values_on()
+      { //! \return true if values of X and Y data points are shown (for example: 1.23).
         return xy_values_on_;
       }
 
       svg_2d_plot&  svg_2d_plot::xy_values_on(bool b)
       { //! Set true if values of X and Y data points are shown (as 1.23).
+        //! (Will override x_values_on and/or y_values_on that would otherwise cause overwriting).
+        if(x_values_on())
+        { // Would be overwritten by XY pair.
+          x_values_on(false);
+        }
+        if(y_values_on())
+        { // Would be overwritten by XY pair.
+          y_values_on(false);
+        }
         xy_values_on_ = b;
         return *this; //! \return reference to svg_2d_plot to make chainable.
       }
@@ -2310,6 +2330,17 @@
         return *this;
       } //! \return reference to svg_2d_plot to make chainable.
 
+      svg_2d_plot& svg_2d_plot::y_plusminus_color(const svg_color& col)
+      {  //! Set color of Y uncertainty of value.
+        y_values_style_.plusminus_color_ = col;
+        return *this; //! \return reference to svg_2d_plot to make chainable.
+      }
+
+      const svg_color svg_2d_plot::y_plusminus_color()
+      { //! \return color of Y uncertainty of value.
+        return y_values_style_.plusminus_color_;
+      }
+
       bool svg_2d_plot::y_df_on()
       { //! \return true if values of Y data points are to include degrees of freedom estimates.
         return svg_2d_plot::y_values_style_.df_on_;
@@ -2321,6 +2352,17 @@
         return *this; //! \return reference to svg_2d_plot to make chainable.
       }
 
+      svg_2d_plot& svg_2d_plot::y_df_color(const svg_color& col)
+      {  //! Set color of Y degrees of freedom.
+        y_values_style_.df_color_ = col;
+        return *this; //! \return reference to svg_2d_plot to make chainable.
+      }
+
+      const svg_color svg_2d_plot::y_df_color()
+      { //! \return color of Y degrees of freedom.
+        return y_values_style_.df_color_;
+      }
+
       svg_2d_plot& svg_2d_plot::y_autoscale(double minimum, double maximum)
       { //! Set Y min & max values to use to autoscale.
         // Does this assume first is min and second is max?
Modified: sandbox/SOC/2007/visualization/boost/svg_plot/svg_style.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/svg_style.hpp	(original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/svg_style.hpp	2009-03-07 13:46:31 EST (Sat, 07 Mar 2009)
@@ -55,12 +55,14 @@
 enum rotate_style
 { //! \enum rotate_style Rotation in degrees clockwise from horizontal.
   horizontal = 0, //!< normal horizontal left to right, centered.
-  uphill = -45, //!< slope up.
+  //uphill = -45, //!< slope up. seems bit steep
+  uphill = -30, //!< slope up.
   upward = -90, //!< vertical writing up.
   backup = -135, //!< slope up backwards - upside down!
   leftward= -180, //!< horizontal to left.
   rightward = 360, //!< horizontal to right.
-  downhill = 45, //!< slope down.
+  // downhill = 45, //!< slope down.
+  downhill = 30, //!< slope down.
   downward = 90,  //!< vertical writing down.
   backdown = 135, //!< slope down backwards.
   upsidedown = 180 //!< upside down!  (== -180)
@@ -308,7 +310,7 @@
 
 public:
   text_style(
-    int size = 12,
+    int size = 12, // Default font size.
     const std::string& font = "", // Examples: "Arial", "Times New Roman", "Verdana", "Lucida Sans Unicode"
     const std::string& style = "", // font-style: normal | bold | italic | oblique
     const std::string& weight = "", // Examples: "bold", "normal"
@@ -526,11 +528,11 @@
 { /*! \class boost::svg::value_style
      \brief Data series point value label information, text, color, orientation, (uncertainty & df).
      \details For example, to output: 5.123 +- 0.01 (19).
-     Uncertainty and degrees of freedom estimate not yet implemented.
-     Prefix, separator and suffix allow X and Y values to be together on one line like
-     [1.23+- 0.01 (3), 4.56 +-0.2 (10)]
-     Used in draw_plot_point_values (note plural) where X value_style is used
-     to provide the prefix and separator, and Y value_style to provide the suffix.
+     Uncertainty and degrees of freedom estimate.
+     Prefix, separator and suffix allow X and Y values to be together on one line, for example\n
+     \t[1.23+- 0.01 (3), 4.56 +-0.2 (10)]\n
+     Used in draw_plot_point_values (note plural - not used in draw_plot_point_value)
+     where X value_style is used to provide the prefix and separator, and Y value_style to provide the suffix.
      Prefix, separator and suffix are ignored when X or Y are shown separately using draw_plot_point_value.
   */
 public:
@@ -538,16 +540,18 @@
   rotate_style value_label_rotation_; //< Direction point value labels written.
   int value_precision_; //!< Decimal digits of precision of value.
   std::ios_base::fmtflags value_ioflags_; //!< Control of scientific, fixed, hex etc.
-  bool strip_e0s_; //!< If true, then unnecessary zeros will be stripped to reduce length.
+  bool strip_e0s_; //!< If true, then unnecessary zeros and + sign will be stripped to reduce length.
   text_style values_text_style_; //!< Font etc used for data point value marking.
   // svg_style
-  svg_color fill_color_; //!< Fill color.
-  svg_color stroke_color_; //!< Stroke color.
+  svg_color fill_color_; //!< Fill color for value.
+  svg_color stroke_color_; //!< Stroke color for value.
   bool plusminus_on_; //!< If an uncertainty estimate is to be appended (as + or - value).
     /* \details See \n
       http://en.wikipedia.org/wiki/Plus-minus_sign
     */
+  svg_color plusminus_color_; //!< Color for uncertainty, for example: 0.02 in "1.23 +-0.02".
   bool df_on_; //!< If a degrees of freedom estimate is to be appended.
+  svg_color df_color_; //!< Color for degrees for freedom, for example: 99 in "1.23 +-0.02 (99)".
   std::string prefix_; //!< Prefix to data point value, default none, but typically "[".
   std::string separator_; //!< Separator between x and y values, if both on same line (none if only X or only Y, or Y below X).
   std::string suffix_; //!< Suffix to data point value, default none, but typically "]".
@@ -564,30 +568,36 @@
 // class value_style Member Functions definitions.
 // Constructor.
 
-value_style::value_style() //! Default data point value label style.
+value_style::value_style() //! Data point value label style (provides default color and font).
     :
     value_label_rotation_(horizontal), //!< Label orientation, default horizontal.
-    value_precision_(3), //!< Reduced from default of 6 which is usually too long.
-    value_ioflags_(std::ios::dec), //!< Any std::ios::ioflags, for example hex, fixed, scientific.
+    value_precision_(4), //!< Reduced from default of 6 which is usually too long.
+    value_ioflags_(std::ios::dec), //!< Any std::ios::ioflags, for example, hex, fixed, scientific.
     strip_e0s_(true), //!< If true, then unnecessary zeros will be stripped to reduce length.
     values_text_style_(no_style),  //!< All defaults, black etc.
     stroke_color_(black), //!< == black.
     fill_color_(svg_color(0, 0, 0)), //!< no fill.
     // TODO should be
     //     fill_color_(false), //!< no fill.
-    plusminus_on_(false), //! If uncertainty estimate to be appended.
-    df_on_(false) //!< If a degrees of freedom estimate to be appended.
+    plusminus_on_(false), //!< If uncertainty estimate to be appended.
+    plusminus_color_(black), //! Default color for uncertainty of value.
+    df_on_(false), //!< If a degrees of freedom estimate to be appended.
+    df_color_(black) //!< Default color for degrees of freedom.
     { // Default constructor initialises all private data.
     }
 
     value_style::value_style(rotate_style r, int p,  std::ios_base::fmtflags f, bool s,
       text_style ts, const svg_color& scol = black, svg_color fcol = black, bool pm = false, bool df = false,
-      std::string pre = "[",
-      std::string sep  = ", ", // If put ", " the trailing space seems to be ignored, so add explicit space.
+      // Separators [,] provide, for example: [1.23+-0.01 (3), 4.56 +-0.2 (10)]
+      // default color black.
+      // TODO provide access to these.
+      std::string pre = "[", 
+      std::string sep  = ", ", // If put ", " the trailing space seems to be ignored, so add Unicode explicit space.
       std::string suf  = "]")
     :
     value_label_rotation_(r), value_precision_(p), value_ioflags_(f), strip_e0s_(s),
-    values_text_style_(ts), stroke_color_(scol), fill_color_(fcol), plusminus_on_(pm), df_on_(df),
+    values_text_style_(ts), stroke_color_(scol), fill_color_(fcol),
+    plusminus_on_(pm),plusminus_color_(blue), df_on_(df), df_color_(blue),
     prefix_(pre), separator_(sep), suffix_(suf)
     { // Constructor.
     }
@@ -638,7 +648,7 @@
   friend std::ostream& operator<< (std::ostream&, plot_point_style);
 
 public:
-  svg_color fill_color_; //!< Color of the centre of the shape.
+  svg_color fill_color_; //!< Fill color of the centre of the shape.
   svg_color stroke_color_; //!< Color of circumference of shape.
   int size_; //!< Diameter of circle, height of square, font_size  ...
   point_shape shape_; //!< shape: round, square, point...