Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51705 - sandbox/SOC/2007/visualization/libs/svg_plot/example
From: pbristow_at_[hidden]
Date: 2009-03-11 11:46:25


Author: pbristow
Date: 2009-03-11 11:46:25 EDT (Wed, 11 Mar 2009)
New Revision: 51705
URL: http://svn.boost.org/trac/boost/changeset/51705

Log:
Improved examples.
Text files modified:
   sandbox/SOC/2007/visualization/libs/svg_plot/example/2d_simple.cpp | 5 +----
   sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_autoscaling.cpp | 7 +++----
   sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_values.cpp | 14 +++++++++-----
   3 files changed, 13 insertions(+), 13 deletions(-)

Modified: sandbox/SOC/2007/visualization/libs/svg_plot/example/2d_simple.cpp
==============================================================================
--- sandbox/SOC/2007/visualization/libs/svg_plot/example/2d_simple.cpp (original)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/example/2d_simple.cpp 2009-03-11 11:46:25 EDT (Wed, 11 Mar 2009)
@@ -1,9 +1,6 @@
 /*! \file 2d_simple.cpp
-
   \brief Simple 2D plot.
-
   \author Jacob Voytko
-
   \date 2007
 */
 
@@ -40,6 +37,6 @@
   my_plot.plot(map1, "Series 1").stroke_color(blue);
   my_plot.plot(map2, "Series 2").stroke_color(orange);
 
- my_plot.write("./simple_2d.svg");
+ my_plot.write("./2d_simple.svg");
   return 0;
 } // int main()

Modified: sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_autoscaling.cpp
==============================================================================
--- sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_autoscaling.cpp (original)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_autoscaling.cpp 2009-03-11 11:46:25 EDT (Wed, 11 Mar 2009)
@@ -1,7 +1,6 @@
 /*! \file demo_1d_autoscaling.cpp
-
     \brief An example to demonstrate simple 1D settings, including auto-scaling.
- \details
+ \details
       See auto_1d_containers.cpp for an example autoscaling with multiple data series.
       See also demo_1d_plot.cpp for a wider range of use.
     \author Paul A Bristow
@@ -138,7 +137,7 @@
     << my_1d_plot.x_tight() << " tightness." << endl; // 0.001
 
   /*`Purely to show the possibilities with autoscale, we don't use the whole container,
- but use the two-iterators version of autoscale to *not use the first and last values* for autoscaling.
+ but use the two-iterators version of autoscale to *not use the first nor the last values* for autoscaling.
   (Remember values in set are sorted).
   */
   my_1d_plot.x_autoscale(++my_set.begin(),--my_set.end());
@@ -155,7 +154,7 @@
   because it is now outside the plot window.
   This is as if we had only written part of the data series.
   */
- my_1d_plot.plot(++my_set.begin(),--my_set.end(), "Auto 1D my_set"); // Add whole data series from my_set.
+ my_1d_plot.plot(++my_set.begin(),--my_set.end(), "Auto 1D my_set"); // Add 'top and tailed' data series from my_set.
  //my_1d_plot.plot(my_set, "Auto 1D my_set"); // Add whole data series from my_set.
   my_1d_plot.write("demo_1d_autoscaling.svg"); // Write the plot to file.
   

Modified: sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_values.cpp
==============================================================================
--- sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_values.cpp (original)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_values.cpp 2009-03-11 11:46:25 EDT (Wed, 11 Mar 2009)
@@ -2,7 +2,6 @@
     \brief Demonstration of some simple 1D value formatting.
     \details Quickbook markup to include in documentation.
     \date 11 Feb 2009
-
     \author Paul A. Bristow
 */
 
@@ -78,7 +77,8 @@
 
 /*`If the default size and color are not to your taste, set more options, like:
 */
- my_1d_plot.x_values_font_size(14) // Change font size for the X-axis value labels.
+ my_1d_plot.size(500, 350) // Change from default size
+ .x_values_font_size(14) // Change font size for the X-axis value labels.
       .x_values_font_family("Times New Roman") // Change font for the X-axis value labels.
       .x_values_color(red); // Change color from default black to red.
 
@@ -118,18 +118,22 @@
 */
    my_1d_plot.x_values_rotation(steepup); // Orientation for the X-axis value labels.
 
- my_1d_plot.x_decor("[ x = ", ", y=", "]");
+ my_1d_plot.x_decor("[ x = ", "", "&#x00A0;sec]"); // Note the need for a Unicode space.
 
 /*`To use all these settings, finally write the plot to file.
 */
     my_1d_plot.write("demo_1d_values.svg");
 
-/*`If chosen settings do not have the expected effect, is may be helpful to display them.
+/*`If chosen settings do not have the effect that you expect, it may be helpful to display them.
 
 (All the myriad settings can be displayed with `show_1d_plot_settings(my_1d_plot)`.)
 */
- show_1d_plot_settings(my_1d_plot);
+ //show_1d_plot_settings(my_1d_plot);
 
+ cout << "my_1d_plot.image_size() " << my_1d_plot.image_size() << endl;
+ cout << "my_1d_plot.image_x_size() " << my_1d_plot.image_x_size() << endl;
+ cout << "my_1d_plot.image_y_size() " << my_1d_plot.image_y_size() << endl;
+ //cout << "my_1d_plot.image_size() " << my_1d_plot.image_size() << endl;
     cout << "my_1d_plot.x_values_font_size() " << my_1d_plot.x_values_font_size() << endl;
     cout << "my_1d_plot.x_values_font_family() " << my_1d_plot.x_values_font_family() << endl;
     cout << "my_1d_plot.x_values_color() " << my_1d_plot.x_values_color() << endl;


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