Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r77132 - in sandbox/SOC/2007/visualization: . boost/svg_plot boost/svg_plot/detail libs/svg_plot/example
From: pbristow_at_[hidden]
Date: 2012-02-28 10:53:22


Author: pbristow
Date: 2012-02-28 10:53:20 EST (Tue, 28 Feb 2012)
New Revision: 77132
URL: http://svn.boost.org/trac/boost/changeset/77132

Log:
Change before trying to make containers more generic.
Text files modified:
   sandbox/SOC/2007/visualization/Jamrules | 2 +-
   sandbox/SOC/2007/visualization/boost/svg_plot/detail/axis_plot_frame.hpp | 35 +++++++++++++++++++----------------
   sandbox/SOC/2007/visualization/boost/svg_plot/svg_1d_plot.hpp | 5 +++--
   sandbox/SOC/2007/visualization/boost/svg_plot/svg_2d_plot.hpp | 18 ++++++------------
   sandbox/SOC/2007/visualization/libs/svg_plot/example/auto_1d_plot.cpp | 13 +++++++------
   sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_uncertainty.cpp | 9 +++++++--
   6 files changed, 43 insertions(+), 39 deletions(-)

Modified: sandbox/SOC/2007/visualization/Jamrules
==============================================================================
--- sandbox/SOC/2007/visualization/Jamrules (original)
+++ sandbox/SOC/2007/visualization/Jamrules 2012-02-28 10:53:20 EST (Tue, 28 Feb 2012)
@@ -12,5 +12,5 @@
 path-global BOOST_ROOT : . ;
 
 # The current version of Boost.
-BOOST_VERSION ?= 1.44.0 ;
+BOOST_VERSION ?= 1.47.0 ;
 

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 2012-02-28 10:53:20 EST (Tue, 28 Feb 2012)
@@ -1040,7 +1040,7 @@
                   sty.shape_ = unc_ellipse;
                 }
               }
-
+
               // Line markers are only really useful for 2-D lines and curves showing functions.
               if (derived().legend_lines_)
               { // Need to draw a short line to show color for that data series.
@@ -1080,7 +1080,7 @@
             g_element& g_ptr,
             plot_point_style& sty,
             unc ux, unc uy) // Default unc ux = 0.? and uy = 0.
- { /*! Draw a plot data point marker shape
+ { /*! Draw a plot data point marker shape
               whose size and stroke and fill colors are specified in plot_point_style.
             */
             /*
@@ -1122,14 +1122,14 @@
 
             case unc_ellipse:
               { // Uncertainty horizontal (and, for 2D, vertical) ellipses for one, two and three standard deviations.
- double xu = ux.value(); //
+ double xu = ux.value(); //
                 if (ux.uncertainty() > 0)
                 { // uncertainty is meaningful.
                   xu += ux.uncertainty();
                 }
                 transform_x(xu); // To SVG coordinates.
                 double x_radius = abs(xu - x);
- if (x_radius <= 0.)
+ if (x_radius <= 0.)
                 { // Make sure something is visible.
                   x_radius = 1.; // Or size?
                 }
@@ -1178,7 +1178,7 @@
               g_ptr.text(x, y + half_size, sty.symbols(), sty.style(), center_align, horizontal); // symbol(s), size and centre.
 
               // Unicode symbols that work on most browsers are listed at
- // boost\math_toolkit\libs\math\doc\sf_and_dist\html4_symbols.qbk,
+ // boost\math\libs\math\doc\sf_and_dist\html4_symbols.qbk,
               // http://www.htmlhelp.com/reference/html40/entities/symbols.html
               // and http://www.alanwood.net/demos/ent4_frame.html
               // The Unicode value in decimal 9830 or hex x2666 must be prefixed with & and terminated with ;
@@ -1232,9 +1232,13 @@
           } // void draw_plot_point
 
           void draw_plot_point_value(double x, double y, g_element& g_ptr, value_style& val_style, plot_point_style& point_style, unc uvalue)
- { /*! Write one data point (X or Y) value as a string, for example "1.23e-2", near the data point marker.
- Unecessary e, +, \& leading exponent zeros may optionally be stripped, and the position and rotation controlled.
- Uncertainty estimate, typically standard deviation (half conventional 95% confidence 'plus or minus') may be optionally be appended.
+ { /*!
+ Write one data point (X or Y) value as a string, for example "1.23e-2",
+ near the data point marker.
+ Unecessary e, +, \& leading exponent zeros may optionally be stripped,
+ and the position and rotation controlled.
+ Uncertainty estimate, typically standard deviation
+ (half conventional 95% confidence 'plus or minus') may be optionally be appended.
              Degrees of freedom estimate (number of replicates) may optionally be appended.
              For example: "3.45 +-0.1(10)"\n
              The precision and format (scientific, fixed), and color and font type and size can be controlled too.
@@ -1900,20 +1904,19 @@
           Derived& x_ticks_values_font_size(unsigned int i); //!< Set X ticks value label font size (svg units, default pixels).
           unsigned int x_ticks_values_font_size(); //!< Set X ticks value label font size (svg units, default pixels).
 
- Derived& x_ticks_on_window_or_axis(int cmd); /*!< Set position of X ticks on window or axis.
- \arg \c cmd -1 X ticks on bottom of plot window,
- \arg \c cmd 0 X ticks on X axis horizontal line.
- \arg \c cmd +1 X ticks top of plot window.
+ Derived& x_ticks_on_window_or_axis(int side);
+ /*!< Set position of X ticks on window or axis.
+ \param side -1 X ticks on bottom of plot window,
+ 0 X ticks on X-axis horizontal line,
+ +1 X ticks top of plot window.
             */
           int x_ticks_on_window_or_axis(); //!< \return true if X axis ticks wanted on the window (rather than on axis).\n
             //!< -1 bottom of plot window, 0 on horiztonal X axis , +1 top of plot window.
           Derived& x_label_units_on(bool cmd); //!< Set true if want X axis label to include units (as well as label like "length").
             //!< \see x_label_units which also sets true.
           bool x_label_units_on(); //!< Set true if want X axis label to include units (as well as label like "length").
- Derived& x_major_labels_side(int cmd); /*!< Position of labels for X major ticks on horizontal X axis line.
- \arg \c cmd place > 0 X tick value labels to left of Y axis line (default),
- \arg \c cmd place = 0 (false) no major X tick value labels on Y axis.
- \arg \c cmd place > 0 X tick labels to right of Y axis line.
+ Derived& x_major_labels_side(int side); /*!< Position of labels for X major ticks on horizontal X axis line.
+ \param side > 0 X tick value labels to left of Y axis line (default), 0 (false) no major X tick value labels on Y axis, 0 X tick labels to right of Y axis line.
             */
           int x_major_labels_side(); //!< \return the side for X ticks major value labels.
           Derived& x_major_label_rotation(rotate_style rot); /*!< Set rotation for X ticks major value labels. (Default horizontal).

Modified: sandbox/SOC/2007/visualization/boost/svg_plot/svg_1d_plot.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/svg_1d_plot.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/svg_1d_plot.hpp 2012-02-28 10:53:20 EST (Tue, 28 Feb 2012)
@@ -132,9 +132,10 @@
 line_style_(black, blank, 2, false, false) // Default line style, black, no fill, width, line_on, bezier_on false
 {
   for(T i = begin; i != end; ++i)
- { // No defaults for begin and end?
+ { // Might be useful to have defaults for begin and end? But unclear how.
     unc temp = *i; // Assumes unc type.
- // TODO This should be a template typename built-in vector<double>, or vector<unc> or vector<named>
+ // TODO This unc could be a template typename of the data type, double for built-in vector<double>,
+ // or unc for vector<unc> or named for vector<named>?
     if(detail::is_limit(temp.value()))
     {
       series_limits_.push_back(temp.value()); // 'limit' values: too big, too small or NaN.

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 2012-02-28 10:53:20 EST (Tue, 28 Feb 2012)
@@ -2822,9 +2822,7 @@
 
       svg_2d_plot& svg_2d_plot::x_ticks_on_window_or_axis(int side)
       { // Set if ticks on the plot window or on the X axis.
- //! \param side -1 ticks downward.
- //! \param side 0 no ticks.
- //! \param side +1 ticks upward.
+ //! \param side -1 ticks downward, 0 no ticks, +1 ticks upward.
         x_ticks_.ticks_on_window_or_on_axis_ = side;
         return *this; //! \return reference to svg_2d_plot to make chainable.
       }
@@ -2835,10 +2833,8 @@
       }
 
       svg_2d_plot& svg_2d_plot::x_major_labels_side(int side)
- { /*! Side for major ticks label values:
- \param side -1 labels downward.
- \param side 0 no labels.
- \param side +1 labels upward.
+ { /*! Set which side (up, down or none) for major ticks label values:
+ \param side -1 labels downward, 0 no labels, +1 labels upward.
         */
         x_ticks_.major_value_labels_side_ = side;
         return *this; //! \return reference to svg_2d_plot to make chainable.
@@ -2850,11 +2846,9 @@
       }
 
       svg_2d_plot& svg_2d_plot::y_ticks_on_window_or_axis(int cmd)
- { /*! Set Y ticks on window or axis
- \arg cmd -1 left of plot window,
- \arg cmd 0 on Y axis.
- \arg cmd +1 right of plot window.
- */
+ { /*! Set Y ticks on window or axis
+ \param cmd -1 left of plot window, 0 on Y axis, +1 right of plot window.
+ */
         y_ticks_.ticks_on_window_or_on_axis_ = cmd;
         return *this; //! \return reference to svg_2d_plot to make chainable.
       }

Modified: sandbox/SOC/2007/visualization/libs/svg_plot/example/auto_1d_plot.cpp
==============================================================================
--- sandbox/SOC/2007/visualization/libs/svg_plot/example/auto_1d_plot.cpp (original)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/example/auto_1d_plot.cpp 2012-02-28 10:53:20 EST (Tue, 28 Feb 2012)
@@ -182,8 +182,9 @@
   double axis_tick_increment;
   int axis_ticks;
 
-/*` The values of
-`min_value` and `max_value` could be provided by the user program:
+/*`
+The values of `min_value` and `max_value`
+could be provided by the user program:
 but usually these values are derived in some way from the user data.
 Several examples follow: */
 
@@ -231,7 +232,7 @@
 However autoscaling may go wrong if the data could contain values that are outside normal limits.
 Infinity (+ and -), and maximum value, and NaN (Not A Number),
 are separated by the plot program to allow them to be shown
-but separate from 'normal' values. These values similarly can distort automatic scaling:
+but separate from 'normal' values. These values similarly can distort automatic scaling:
 a single infinity would result in useless scaling!
 When the plot range is set, the maximum and minimum values are checked,
 and if not normal then an exception will be thrown, and no plot will be produced.
@@ -241,7 +242,7 @@
 it will be much quicker to use `std::min_max_element` which can take advantange of knowledge of the container.
 
 The function `autoscale_check_limits(bool)` is provided to control this.
-If set true, all values will be checked, and those at 'limits' will be ignored in autoscaling.
+If set true, all values will be checked, and those 'at limits' will be ignored in autoscaling.
 The default is true, to check all values.
 
 If we had many very known normal values to plot and want to autoscale,
@@ -262,7 +263,7 @@
 /*`There are also some parameters which can fine-tune the autoscaling
 to produce more aesthetically pleasing ranges. One can:
 
-# enforce the inclusion of zero on the plot.
+# Enforce the inclusion of zero on the plot.
 # Specify a minimum number of major ticks.
 # Specify the steps between major ticks, default 0, or 2 for 2, 4, 6, 8, 10, 5 for 1, 5, 10, or 10 (2, 5, 10).
 # Avoid values that are a tiny amount over the minimum or maximum from causing
@@ -305,7 +306,7 @@
     << ", interval " << my_1d_plot.x_auto_tick_interval() << endl; // Autoscaled min 1, max 5.5, interval 0.5
 
   //my_1d_plot.x_autoscale(true); // Ensure autoscale values are used for the plot.
- // This is also automatically set true by any call of `x_autoscale(some_data);
+ // This is also automatically set true by any call of x_autoscale(some_data);
 
 /*`The actual addition of data values to the plot is, of course, quite separate from any autoscaling.
 */

Modified: sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_uncertainty.cpp
==============================================================================
--- sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_uncertainty.cpp (original)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_uncertainty.cpp 2012-02-28 10:53:20 EST (Tue, 28 Feb 2012)
@@ -127,8 +127,13 @@
 /*`
 Finally, we can write the SVG to a file of our choice.
 */
- //my_plot.write("./demo_1d_uncertainty.svg");
- my_plot.write("./demo_1d_uncertainty_legend.svg");
+
+ std::string svg_file = (my_plot.legend_on() == true) ?
+ "./demo_1d_uncertainty_legend.svg" : "./demo_1d_uncertainty.svg";
+
+ my_plot.write(svg_file);
+
+ cout <<"Plot written to file " << svg_file << endl;
 
 //] [/demo_1d_uncertainty_2]
   // show_1d_plot_settings(my_plot);


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk