|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r55066 - in sandbox/SOC/2007/visualization: . boost/svg_plot boost/svg_plot/detail libs/svg_plot/doc/html libs/svg_plot/example
From: pbristow_at_[hidden]
Date: 2009-07-21 10:52:59
Author: pbristow
Date: 2009-07-21 10:52:57 EDT (Tue, 21 Jul 2009)
New Revision: 55066
URL: http://svn.boost.org/trac/boost/changeset/55066
Log:
Addition of color to tick values labels but names are in a muddle.
precision and ios_flags added too.
Added:
sandbox/SOC/2007/visualization/libs/svg_plot/example/1d_simple_style.svg (contents, props changed)
Text files modified:
sandbox/SOC/2007/visualization/Jamrules | 9 +-
sandbox/SOC/2007/visualization/boost/svg_plot/detail/auto_axes.hpp | 4
sandbox/SOC/2007/visualization/boost/svg_plot/detail/axis_plot_frame.hpp | 113 +++++++++++++++++++++++++++++----------
sandbox/SOC/2007/visualization/boost/svg_plot/detail/numeric_limits_handling.hpp | 12 ++++
sandbox/SOC/2007/visualization/boost/svg_plot/detail/svg_style_detail.hpp | 6 +
sandbox/SOC/2007/visualization/boost/svg_plot/svg_1d_plot.hpp | 2
sandbox/SOC/2007/visualization/boost/svg_plot/svg_2d_plot.hpp | 79 +++++++++++++++++++++++----
sandbox/SOC/2007/visualization/boost/svg_plot/svg_style.hpp | 14 +++-
sandbox/SOC/2007/visualization/libs/svg_plot/doc/html/index.html | 5 -
sandbox/SOC/2007/visualization/libs/svg_plot/example/auto_1d_containers.cpp | 4
sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_values.cpp | 4
sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_2d_autoscaling.cpp | 10 +-
sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_2d_values.cpp | 6 +-
sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_point_markers.cpp | 4
14 files changed, 198 insertions(+), 74 deletions(-)
Modified: sandbox/SOC/2007/visualization/Jamrules
==============================================================================
--- sandbox/SOC/2007/visualization/Jamrules (original)
+++ sandbox/SOC/2007/visualization/Jamrules 2009-07-21 10:52:57 EDT (Tue, 21 Jul 2009)
@@ -1,13 +1,14 @@
# Boost.Build top level Jamrules
# See tools/build/index.html for documentation.
-project boost ;
+# project boost ;
# Set some important global variables if they haven't already been set by the
-# user on the command-line or in the environment
+# user on the command-line or in the environment.
+
+# Establish this as the root of the boost installation.
+# Most targets will want $(BOOST_ROOT) in their #include path.
-# Establish this as the root of the boost installation. Most targets will want
-# $(BOOST_ROOT) in their #include path.
path-global BOOST_ROOT : . ;
# The current version of Boost.
Modified: sandbox/SOC/2007/visualization/boost/svg_plot/detail/auto_axes.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/detail/auto_axes.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/detail/auto_axes.hpp 2009-07-21 10:52:57 EDT (Tue, 21 Jul 2009)
@@ -252,7 +252,7 @@
double* axis_tick_increment,//!< Updated with
int* auto_ticks, //!< Updated with
bool check_limits, //!< Whether to check all values for infinity, NaN etc.
- double autoscale_plusminus = 3., //!< Multiplier of uncertainty or standard deviations to allow fo confidence ellipses.
+ double autoscale_plusminus = 3., //!< Multiplier of uncertainty or standard deviations to allow for confidence ellipses.
bool origin = false, //!< do not include the origin unless the range min_value <= 0 <= max_value.
double tight = 0., //!< tightest - fraction of 'overrun' allowed before another tick used.
//! for visual effect up to about 0.001 might suit a 1000 pixel wide image,
@@ -275,7 +275,7 @@
}
else
{ // It is necessary to inspect all values individually.
- //cout << container.size() << " values." << endl;
+ // cout << container.size() << " values." << endl;
// Work out min and max, ignoring non-finite, +-infinity, max & min, & NaN).
// If can't find a max and a min, then will throw exception.
int good = mnmx(container.begin(), container.end(), &x_min, &x_max);
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-07-21 10:52:57 EDT (Tue, 21 Jul 2009)
@@ -410,7 +410,7 @@
{ // External to plot window style bottom or top.
// Always want all values including "0", if labeling external to plot window.
// x_ticks_.ticks_on_window_or_axis_ == true != 0
- derived().image.g(detail::PLOT_VALUE_LABELS).text(
+ derived().image.g(detail::PLOT_X_TICK_VALUE_LABELS).text(
x,
y,
label.str(), derived().x_value_label_style_, alignment, derived().x_ticks_.label_rotation_);
@@ -419,7 +419,7 @@
{
if ((value != 0) && derived().x_axis_.axis_line_on_)
{ // Avoid a "0" below the X-axis if it would be cut through by any internal vertical Y-axis line.
- derived().image.g(detail::PLOT_VALUE_LABELS).text(
+ derived().image.g(detail::PLOT_X_TICK_VALUE_LABELS).text(
x,
y,
label.str(),
@@ -948,6 +948,11 @@
case round:
g_ptr.circle(x, y, (int)half_size);
break;
+
+ case point:
+ g_ptr.circle(x, y, 1); // Fixed size round.
+ break;
+
case square:
g_ptr.rect(x - half_size, y - half_size, size, size);
break;
@@ -957,7 +962,7 @@
case unc_ellipse:
{ // Uncertainty ellipses for one, two and three standard deviations.
- double xu = ux.uncertainty() + ux.value(); //
+ double xu = ux.uncertainty() + ux.value(); //
transform_x(xu);
double x_radius = abs(xu - x);
if (x_radius <= 0.)
@@ -1157,7 +1162,7 @@
} // switch
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.
@@ -1403,7 +1408,7 @@
{ // Move ready to put Y value on 'newline' below point marker.
// Problem here if orientation is changed? - Yes - doesn't line up :-(
if (y_sty.prefix_ != "")
- { //
+ { //
label_yv = y_sty.prefix_ + label_yv;
}
double dy = y_sty.values_text_style_.font_size() * 2.2; // "newline"
@@ -1488,7 +1493,7 @@
derived().image.g(PLOT_X_MINOR_TICKS).clear();
derived().image.g(PLOT_X_MAJOR_TICKS).clear();
derived().image.g(PLOT_X_LABEL).clear();
- derived().image.g(PLOT_VALUE_LABELS).clear();
+ derived().image.g(PLOT_X_TICK_VALUE_LABELS).clear();
}
void clear_y_axis()
@@ -1643,8 +1648,15 @@
const std::string& x_label_font_family();
Derived& x_axis_label_color(const svg_color& col);
svg_color x_axis_label_color();
- Derived& x_axis_value_color(const svg_color& col);
- svg_color x_axis_value_color();
+ // X-axis label values style.
+ Derived& x_axis_values_color(const svg_color& col);
+ svg_color x_axis_values_color();
+
+ Derived& x_axis_values_precision(int p);
+ int x_axis_values_precision();
+ Derived& x_axis_values_ioflags(std::ios_base::fmtflags f);
+ std::ios_base::fmtflags x_axis_values_ioflags();
+
Derived& x_ticks_on_window_or_axis(int cmd);
int x_ticks_on_window_or_axis();
Derived& x_label_units_on(bool cmd);
@@ -1851,15 +1863,15 @@
template <class Derived>
template <class T> // T an STL container: array, vector ...
- Derived& axis_plot_frame<Derived>::x_autoscale(const T& container) // Whole data series.
+ Derived& axis_plot_frame<Derived>::x_autoscale(const T& container) // Use whole 1D data series.
{ //! Data series (all values) to use to calculate autoscaled X-axis values.
- //scale_axis(container.begin(), container.end(), // All the container.
- scale_axis(container, // All the container.
- &derived().x_auto_min_value_, &derived().x_auto_max_value_, &derived().x_auto_tick_interval_, &derived().x_auto_ticks_,
- derived().autoscale_check_limits_, derived().autoscale_plusminus_,
- derived().x_include_zero_, derived().x_tight_, derived().x_min_ticks_, derived().x_steps_);
+ //scale_axis(container.begin(), container.end(), // All the container.
+ scale_axis(container, // All the container.
+ &derived().x_auto_min_value_, &derived().x_auto_max_value_, &derived().x_auto_tick_interval_, &derived().x_auto_ticks_,
+ derived().autoscale_check_limits_, derived().autoscale_plusminus_,
+ derived().x_include_zero_, derived().x_tight_, derived().x_min_ticks_, derived().x_steps_);
- derived().x_autoscale_ = true; // Default to use calculated values.
+ derived().x_autoscale_ = true; // Default is to use calculated values.
return derived();
} // x_autoscale(const T& container)
@@ -2140,8 +2152,10 @@
{ /*!
Set a title for plot.
The string may include Unicode for greek letter and symbols.
- For example a title that includes a greek omega:
- \verbatim my_plot.title("Plot of Ω function"); \endverbatim
+ For example a title that includes a greek omega and degree symbols:
+ \verbatim my_plot.title("Plot of Ω function (°C)"); \endverbatim
+
+ Unicode symbols are at http://unicode.org/charts/symbols.html .
*/
// Plot title. TODO
// new text parent code pushback
@@ -2413,7 +2427,7 @@
Derived& axis_plot_frame<Derived>::legend_header_font_size(int size)
{ //! Set legend header font size (svg units, default pixels).
derived().legend_header_.textstyle().font_size(size);
- return *this;
+ return derived();
}
template <class Derived>
@@ -2674,33 +2688,70 @@
{ //! Set X axis label color.
// Set BOTH stroke and fill to the same color.
derived().image.g(detail::PLOT_X_LABEL).style().fill_color(col);
- derived().image.g(detail::PLOT_X_LABEL).style().stroke_color(col);
- return *this;
+ //derived().image.g(detail::PLOT_X_LABEL).style().stroke_color(col);
+ // Setting the stroke color produces fuzzy characters :-(
+ return derived();
}
template <class Derived>
svg_color axis_plot_frame<Derived>::x_axis_label_color()
{ //! \return X axis label color.
- // But only return the stroke color.
- return derived().image.g(detail::PLOT_X_LABEL).style().stroke_color();
+ // But only return the fill color.
+ return derived().image.g(detail::PLOT_X_LABEL).style().fill_color();
}
+ // X-axis tick label style.
template <class Derived>
- Derived& axis_plot_frame<Derived>::x_axis_value_color(const svg_color& col)
+ Derived& axis_plot_frame<Derived>::x_axis_values_color(const svg_color& col)
{ //! Set X axis tick value label color.
// Set BOTH stroke and fill to the same color.
- derived().image.g(detail::PLOT_VALUE_LABELS).style().fill_color(col);
- derived().image.g(detail::PLOT_VALUE_LABELS).style().stroke_color(col);
- return *this;
+ derived().image.g(detail::PLOT_X_TICK_VALUE_LABELS).style().fill_color(col);
+ //derived().image.g(detail::PLOT_X_TICK_VALUE_LABELS).style().stroke_color(col);
+ // Setting the stroke color produces fuzzy characters :-(
+ //derived().x_ticks_.color_ = col;
+ return derived();
}
template <class Derived>
- svg_color axis_plot_frame<Derived>::x_axis_value_color()
+ svg_color axis_plot_frame<Derived>::x_axis_values_color()
{ //! \return X axis tick value label color.
- // But only return the stroke color.
- return derived().image.g(detail::PLOT_VALUE_LABELS).style().stroke_color();
+ // But only return the fill color.
+ return derived().image.g(detail::PLOT_X_TICK_VALUE_LABELS).style().fill_color();
+ //return x_ticks_.color_ ;
}
+ // ticks_labels_style x_ticks
+ template <class Derived>
+ Derived& axis_plot_frame<Derived>::x_axis_values_precision(int p)
+ { //! Set iostream decimal digits precision of data point X values near data points markers.
+ derived().x_ticks_.value_precision_ = p;
+ return derived();
+ }
+
+ template <class Derived>
+ int axis_plot_frame<Derived>::x_axis_values_precision()
+ { //! \return iostream decimal digits precision of data point X values near data points markers.
+ return derived().x_ticks_.value_precision_;
+ }
+
+ template <class Derived>
+ Derived& axis_plot_frame<Derived>::x_axis_values_ioflags(std::ios_base::fmtflags f)
+ { //! Set iostream format flags of data point X values near data points markers.
+ //! Useful to set hexadecimal, fixed and scientific, (std::ios::scientific).
+ derived().x_ticks_.value_ioflags_ = f;
+ return derived();
+ }
+
+ template <class Derived>
+ std::ios_base::fmtflags axis_plot_frame<Derived>::x_axis_values_ioflags()
+ { //! \return iostream format flags of data point X values near data points markers.
+ //! Might be used to set hexadecimal, fixed and scientific, (std::ios::scientific).
+ return derived().x_ticks_.value_ioflags_;
+ }
+
+
+
+
template <class Derived>
Derived& axis_plot_frame<Derived>::x_ticks_on_window_or_axis(int cmd)
{ /*! Set X ticks on window or axis
@@ -2930,7 +2981,7 @@
template <class Derived>
bool axis_plot_frame<Derived>::legend_box_fill_on()
{ //! \return true if legend box has a background fill color.
- return derived().legend_box_.fill_on();
+ return derived().legend_box_.fill_on();
}
template <class Derived>
@@ -3737,7 +3788,7 @@
template <class Derived>
double axis_plot_frame<Derived>::x_auto_tick_interval()
- { //! \return the X-axis major tick interal computed by autoscale.
+ { //! \return the X-axis major tick interval computed by autoscale.
return derived().x_auto_tick_interval_;
}
Modified: sandbox/SOC/2007/visualization/boost/svg_plot/detail/numeric_limits_handling.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/detail/numeric_limits_handling.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/detail/numeric_limits_handling.hpp 2009-07-21 10:52:57 EDT (Tue, 21 Jul 2009)
@@ -91,6 +91,18 @@
|| limit_max(a.second) || limit_min(a.second) || limit_NaN(a.second);
}
+inline bool pair_is_limit(std::pair<const int, double> a)
+{ //! Check on both x int and y double data points. Return false if either or both are at limit.
+ return limit_max(a.first) || limit_min(a.first) // || limit_NaN(a.first) - can't be NaN if int.
+ || limit_max(a.second) || limit_min(a.second) || limit_NaN(a.second);
+}
+
+inline bool pair_is_limit(std::pair<int, double> a)
+{ //! Check on both x int and y double data points. Return false if either or both are at limit.
+ return limit_max(a.first) || limit_min(a.first) // || limit_NaN(a.first) - can't be NaN if int.
+ || limit_max(a.second) || limit_min(a.second) || limit_NaN(a.second);
+}
+
inline bool pair_is_limit(std::pair<const unc, unc> a)
{ //! Check on values of both x and y unc data points.
// \return false if either or both are at limit.
Modified: sandbox/SOC/2007/visualization/boost/svg_plot/detail/svg_style_detail.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/detail/svg_style_detail.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/detail/svg_style_detail.hpp 2009-07-21 10:52:57 EDT (Tue, 21 Jul 2009)
@@ -48,7 +48,8 @@
PLOT_X_MINOR_TICKS, //! X minor ticks
PLOT_Y_MAJOR_TICKS, //! Y major ticks.
PLOT_X_MAJOR_TICKS, //! X major ticks.
- PLOT_VALUE_LABELS, //! tick values labels, for example 10, 20, 30 ...
+ PLOT_X_TICK_VALUE_LABELS, //! X-axis tick values labels, for example 10, 20, 30 ...
+ PLOT_Y_TICK_VALUE_LABELS, //! Y-axis tick values labels, for example 1, 2, 3 ...
PLOT_Y_LABEL, //! Y axis text labels "length (cm)".
PLOT_X_LABEL, //! X axis text labels "height (m)".
PLOT_DATA_LINES, //! Lines joining data points.
@@ -82,7 +83,8 @@
"xMinorTicks",
"yMajorTicks",
"xMajorTicks",
- "plotLabels", // TODO tickValueLabels better name???
+ "xTicksValueLabels", //! X-axis tick values labels, for example 10, 20, 30 ...
+ "yTicksValueLabels", //! Y-axis tick values labels, for example 1, 2, 3 ...
"yLabel",
"xLabel", // axis text labels "length (cm)"
"plotLines", // normal data point markers.
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 2009-07-21 10:52:57 EDT (Tue, 21 Jul 2009)
@@ -322,7 +322,7 @@
axis_line_style y_axis_; //!< style of Y axis line.
ticks_labels_style x_ticks_; //!< style of X axis tick value labels.
- ticks_labels_style y_ticks_; //!< style of Y axis tick value labels. ( Meaningless of 1D but added to permit shared code!)
+ ticks_labels_style y_ticks_; //!< style of Y axis tick value labels. (Meaningless for 1D but added to permit shared code!)
bool title_on_; //!< If true include a title for the whole plot.
bool legend_on_; //!< If true include a legend box.
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-07-21 10:52:57 EDT (Tue, 21 Jul 2009)
@@ -136,8 +136,8 @@
:
title_(title), //!< Title of a series of data values.
// plot_point_style(const svg_color& fill = blank, const svg_color& stroke = black,
- // int size = 10, point_shape shape = round, const std::string& symbols = "X")
- point_style_(black, white, 10, round), // Default point style (default fill white).
+ // int size = 5, point_shape shape = round, const std::string& symbols = "X")
+ point_style_(black, white, 5, round), // Default point style (default fill white).
limit_point_style_(grey, blank, 10, cone), // Default limit (infinity or NaN) point style.
line_style_(black, blank, 2, false, false), // Default line style, no fill, width 2, no line_on, no bezier.
bar_style_(black, blank, 3, no_bar), // Default black, no fill, stick width 3, no bar.
@@ -440,8 +440,8 @@
double x_auto_min_value_; //!< Values calculated by scale_axis (used only if x_autoscale == true).
double x_auto_max_value_; //!< Values calculated by scale_axis (used only if x_autoscale == true).
- double x_auto_tick_interval_; //!< tick major interval.
- int x_auto_ticks_; //!< Number of ticks.
+ double x_auto_tick_interval_; //!< X tick major interval.
+ int x_auto_ticks_; //!< Number of X ticks.
bool y_autoscale_; //!< true if to use any y_axis autoscale values.
bool y_include_zero_; //!< true if autoscale to include zero.
@@ -1263,7 +1263,7 @@
{ // External to plot window style left or right.
// Always want all values including "0", if labeling external to plot window.
// y_ticks_.ticks_on_window_or_axis_ == true != 0
- image.g(detail::PLOT_VALUE_LABELS).text(
+ image.g(detail::PLOT_Y_TICK_VALUE_LABELS).text(
x,
y,
label.str(), y_value_label_style_, alignment, y_ticks_.label_rotation_);
@@ -1272,7 +1272,7 @@
{ // ! y_ticks_.y_ticks_on_plot_window_ == 0 'Internal' - value labels either side of vertical Y-axis.
if ((value != 0) && y_axis_.axis_line_on_)
{ // Avoid a zero ON the Y-axis if it would be cut through by any horizontal X-axis line.
- image.g(detail::PLOT_VALUE_LABELS).text(
+ image.g(detail::PLOT_Y_TICK_VALUE_LABELS).text(
x,
y,
label.str(),
@@ -1978,6 +1978,16 @@
const std::string& y_label_weight();
svg_2d_plot& y_label_font_family(const std::string& family);
const std::string& y_label_font_family();
+
+ svg_2d_plot& y_axis_values_color(const svg_color& col);
+ svg_color y_axis_values_color();
+
+ svg_2d_plot& y_axis_values_precision(int p);
+ int y_axis_values_precision();
+
+ svg_2d_plot& y_axis_values_ioflags(std::ios_base::fmtflags f);
+ std::ios_base::fmtflags y_axis_values_ioflags();
+
svg_2d_plot& y_values_font_size(unsigned int i);
unsigned int y_values_font_size();
svg_2d_plot& y_values_font_family(const std::string& family);
@@ -2142,14 +2152,14 @@
svg_2d_plot& svg_2d_plot::y_axis_label_color(const svg_color& col)
{ //! Set stroke color.
- image.g(detail::PLOT_VALUE_LABELS).style().stroke_color(col);
+ image.g(detail::PLOT_Y_TICK_VALUE_LABELS).style().stroke_color(col);
return *this; //! \return reference to svg_2d_plot to make chainable.
}
svg_color svg_2d_plot::y_axis_label_color()
{ //! \return the y axis label stroke color.
// y_label_info_.style().stroke_color();
- return image.g(detail::PLOT_VALUE_LABELS).style().stroke_color();
+ return image.g(detail::PLOT_Y_TICK_VALUE_LABELS).style().stroke_color();
}
svg_2d_plot& svg_2d_plot::y_label_units_on(bool b)
@@ -2166,14 +2176,14 @@
svg_2d_plot& svg_2d_plot::y_axis_value_color(const svg_color& col)
{ //! Set color of Y axis value labels.
- image.g(detail::PLOT_VALUE_LABELS).style().stroke_color(col);
+ image.g(detail::PLOT_Y_TICK_VALUE_LABELS).style().stroke_color(col);
return *this; //! \return reference to svg_2d_plot to make chainable.
}
svg_color svg_2d_plot::y_axis_value_color()
- { //! \return color of Y axis value labels.
+ { //! \return color of Y-axis tick value labels.
// Only return the stroke color.
- return image.g(detail::PLOT_VALUE_LABELS).style().stroke_color();
+ return image.g(detail::PLOT_Y_TICK_VALUE_LABELS).style().stroke_color();
}
svg_2d_plot& svg_2d_plot::y_label_width(double width)
@@ -2701,6 +2711,51 @@
return y_axis_label_style_.font_family();
}
+ // Y-axis tick value labels style.
+
+ svg_2d_plot& svg_2d_plot::y_axis_values_color(const svg_color& col)
+ { //! Set color for Y_axis tick values.
+ // Function could set both fill (middle) and stroke (outside),
+ // but just setting fill if simplest,
+ // but does not allow separate inside & outside colors.
+ y_ticks_.values_color_ = col;
+ //image.g(detail::PLOT_Y_POINT_VALUES).style().fill_color(col);
+ //svg_2d_plot().image.g(PLOT_Y_POINT_VALUES).style().stroke_color(col);
+ return *this; //! \return reference to svg_2d_plot to make chainable.
+ }
+
+ svg_color svg_2d_plot::y_axis_values_color()
+ { //! \return color for Y-axis tick values.
+ // Function could get either fill and stroke,
+ // return svg_2d_plot().image.g(PLOT_Y_POINT_VALUES).style().stroke_color();
+ // return image.g(detail::PLOT_Y_POINT_VALUES).style().fill_color();
+ return y_ticks_.values_color_;
+ }
+
+ svg_2d_plot& svg_2d_plot::y_axis_values_precision(int p)
+ { //! Set iostream decimal digits precision of data point Y values near data points markers.
+ y_ticks_.value_precision_ = p;
+ return *this;
+ }
+
+ int svg_2d_plot::y_axis_values_precision()
+ { //! \return iostream decimal digits precision of data point Y values near data points markers.
+ return y_ticks_.value_precision_;
+ }
+
+ svg_2d_plot& svg_2d_plot::y_axis_values_ioflags(std::ios_base::fmtflags f)
+ { //! Set iostream format flags of data point Y values near data points markers.
+ //! Useful to set hexadecimal, fixed and scientific, (std::ios::scientific).
+ y_ticks_.value_ioflags_ = f;
+ return *this;
+ }
+
+ std::ios_base::fmtflags svg_2d_plot::y_axis_values_ioflags()
+ { //! \return iostream format flags of data point X values near data points markers.
+ //! Might be used to set hexadecimal, fixed and scientific, (std::ios::scientific).
+ return y_ticks_.value_ioflags_;
+ }
+
svg_2d_plot& svg_2d_plot::y_values_font_size(unsigned int i)
{ //! \return font size for Y axis values.
y_values_style_.values_text_style_.font_size(i);
@@ -2719,7 +2774,7 @@
}
const std::string& svg_2d_plot::y_values_font_family()
- { //! \return font family for Y axis valuess.
+ { //! \return font family for Y axis values.
return y_values_style_.values_text_style_.font_family();
}
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-07-21 10:52:57 EDT (Tue, 21 Jul 2009)
@@ -677,7 +677,7 @@
plot_point_style( //!< Constructor with all defaults.
const svg_color& stroke = black, const svg_color& fill = blank,
- int size = 10, point_shape shape = round, const std::string& symbols = "X");
+ int size = 5, point_shape shape = round, const std::string& symbols = "X");
plot_point_style& size(int i);
int size();
@@ -1072,9 +1072,9 @@
class ticks_labels_style
{ /*! \class boost::svg::ticks_labels_style
- \brief Style of the x and y axes ticks, grids and their value labels.
+ \brief Style of the X and Y axes ticks, grids and their tick value labels.
\details
- But NOT the x and y axes lines.
+ But NOT the X and Y axes lines.
These can be either on the axis lines or on the plot window edge(s),
(because different styles for x and y are possible).
*/
@@ -1111,7 +1111,8 @@
rotate_style label_rotation_; //!< Direction axis value labels written.
bool major_grid_on_; //!< Draw X grid at major ticks.
bool minor_grid_on_; //!< Draw X grid at minor ticks.
- int value_precision_; //!< precision for tick value labels, usually 3 will suffice.
+ svg_color values_color_; //!< Color of tick values labels.
+ int value_precision_; //!< Precision for tick value labels, usually 3 will suffice.
std::ios_base::fmtflags value_ioflags_; //!< IO formatting flags for the axis default std::ios::dec.
bool strip_e0s_; //!< If redundant zero, + and e are to be stripped.
double label_max_length_; //!< width (in SVG units) of longest value label text on axis.
@@ -1124,7 +1125,7 @@
ticks_labels_style( //! Constructor, providng defaults values for all member data.
dim d = X,
- const text_style& style = no_style,
+ const text_style& style = no_style, // Default style.
double max = 10., double min = -10.,
double major_interval = 2.,
unsigned int num_minor_ticks = 4)
@@ -1152,6 +1153,7 @@
minor_grid_color_(svg_color(200, 220, 255)),
major_grid_width_(1.), // pixels.
minor_grid_width_(0.5), // pixels.
+
up_ticks_on_(false), // Draw ticks up from horizontal X-axis line.
down_ticks_on_(true), // Draw ticks down from horizontal X-axis line.
left_ticks_on_(true), // Draw ticks left from vertical Y-axis line.
@@ -1162,7 +1164,9 @@
label_rotation_(horizontal), // Direction axis value labels written.
major_grid_on_(false), // Draw grid at major ticks.
minor_grid_on_(false),// Draw grid at minor ticks.
+ values_color_(black),
value_precision_(3), // precision for tick value labels, usually 3 will suffice.
+ // 4 might be better to permit thousands without using e format?
value_ioflags_(std::ios::dec), // IO formatting flags for the axis.
// Note that ALL the flags are set, overwriting any defaults, so std::dec is wise.
strip_e0s_(true), // strip superflous zeros and signs.
Modified: sandbox/SOC/2007/visualization/libs/svg_plot/doc/html/index.html
==============================================================================
--- sandbox/SOC/2007/visualization/libs/svg_plot/doc/html/index.html (original)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/doc/html/index.html 2009-07-21 10:52:57 EDT (Tue, 21 Jul 2009)
@@ -33,7 +33,7 @@
</div></div>
<div><p class="copyright">Copyright © 2007 to 2009 Jake Voytko and Paul A. Bristow</p></div>
<div><div class="legalnotice">
-<a name="id1085901"></a><p>
+<a name="id1075284"></a><p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
@@ -107,7 +107,6 @@
<dd><dl>
<dt><span class="section">Header <boost/svg_plot/detail/auto_axes.hpp></span></dt>
<dt><span class="section">Header <boost/svg_plot/detail/axis_plot_frame.hpp></span></dt>
-<dt><span class="section">Header <boost/svg_plot/detail/FP_compare.hpp></span></dt>
<dt><span class="section">Header <boost/svg_plot/detail/functors.hpp></span></dt>
<dt><span class="section">Header <boost/svg_plot/detail/numeric_limits_handling.hpp></span></dt>
<dt><span class="section">Header <boost/svg_plot/detail/pair.hpp></span></dt>
@@ -160,7 +159,7 @@
</table></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: March 27, 2009 at 12:11:01 GMT</small></p></td>
+<td align="left"><p><small>Last revised: April 07, 2009 at 11:56:16 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
Added: sandbox/SOC/2007/visualization/libs/svg_plot/example/1d_simple_style.svg
==============================================================================
Binary file. No diff available.
Modified: sandbox/SOC/2007/visualization/libs/svg_plot/example/auto_1d_containers.cpp
==============================================================================
--- sandbox/SOC/2007/visualization/libs/svg_plot/example/auto_1d_containers.cpp (original)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/example/auto_1d_containers.cpp 2009-07-21 10:52:57 EDT (Tue, 21 Jul 2009)
@@ -29,8 +29,8 @@
#include <boost/svg_plot/detail/auto_axes.hpp>
using boost::svg::show; // A single STL container.
using boost::svg::show_all; // Multiple STL containers.
- using boost::svg::range; // Find min and max of a STL container.
- using boost::svg::range_all;// Find min and max of multipler STL containers.
+ using boost::svg::range; // Find min and max of a single STL container.
+ using boost::svg::range_all;// Find min and max of multiple STL containers.
// Note neither of these check for 'limits' (infinite, NaN) values.
#include <boost/svg_plot/detail/pair.hpp>
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-07-21 10:52:57 EDT (Tue, 21 Jul 2009)
@@ -1,7 +1,7 @@
/*! \file demo_1d_values.cpp
\brief Demonstration of some simple 1D value formatting.
\details Quickbook markup to include in documentation.
- \date 11 Feb 2009
+ \date 19 Jul 2009
\author Paul A. Bristow
*/
@@ -118,7 +118,7 @@
*/
my_1d_plot.x_values_rotation(steepup); // Orientation for the X-axis value labels.
- my_1d_plot.x_decor("[ x = ", "", " sec]"); // Note the need for a Unicode space.
+ my_1d_plot.x_decor("[ x = ", "", " sec]"); // Note the need for a Unicode space A0.
/*`To use all these settings, finally write the plot to file.
*/
Modified: sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_2d_autoscaling.cpp
==============================================================================
--- sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_2d_autoscaling.cpp (original)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_2d_autoscaling.cpp 2009-07-21 10:52:57 EDT (Tue, 21 Jul 2009)
@@ -4,8 +4,8 @@
See also auto_2d_plot.cpp for a wider range of use.
\date 20 Mar 2009
- \author Paul A. Bristow
-*/
+ \author Paul A. Bristow
+*/
// Copyright Paul A Bristow 2009
// Use, modification and distribution are subject to the
@@ -56,7 +56,7 @@
my_data[5.47] = 5.3861;
try
- { // try'n'catch clocks are needed to ensure error messages from any exceptions are shown.
+ { // try'n'catch blocks are needed to ensure error messages from any exceptions are shown.
svg_2d_plot my_2d_plot; // Construct a plot with all the default constructor values.
my_2d_plot.title("Autoscaling 2d Values"); // Add a string title of the plot.
@@ -66,11 +66,11 @@
Or we can use autoscaling.
*/
- my_2d_plot.xy_autoscale(my_data); // Autoscale both x and Y axes.
+ my_2d_plot.xy_autoscale(my_data); // Autoscale both x and Y axes.
/*`This says use the entire STL container my_data to set both X and Y ranges.
(The data used to autoscale the range(s) does not have to be the same as the data being plotted.
-For example, if we have analysed a product and know that an attribute like strength can only decline as the product ages,
+For example, if we have analysed a product and know that an attribute like strength can only decline as the product ages,
it would make sense to use the reference 'as new' data to scale the plot for the 'aged' product samples).
The add the (one but could be more) data series, `my_data` and a description, and how the data points are to be marked,
Modified: sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_2d_values.cpp
==============================================================================
--- sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_2d_values.cpp (original)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_2d_values.cpp 2009-07-21 10:52:57 EDT (Tue, 21 Jul 2009)
@@ -3,8 +3,8 @@
\details Contains Quickbook Markup to be included in documentation.
\date 11 Feb 2009
- \author Jacob Voytko and Paul A. Bristow
-*/
+ \author Jacob Voytko and Paul A. Bristow
+*/
// Copyright Jacob Voytko 2007
// Copyright Paul A Bristow 2008
@@ -63,7 +63,7 @@
my_data[5.47] = 5.3861;
try
- { // try'n'catch clocks are needed to ensure error messages from any exceptions are shown.
+ { // try'n'catch blocks are needed to ensure error messages from any exceptions are shown.
svg_2d_plot my_2d_plot; // Construct a plot with all the default constructor values.
my_2d_plot.title("Default 2d Values Demo") // Add a string title of the plot.
Modified: sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_point_markers.cpp
==============================================================================
--- sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_point_markers.cpp (original)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_point_markers.cpp 2009-07-21 10:52:57 EDT (Tue, 21 Jul 2009)
@@ -1,7 +1,7 @@
/*! \file demo_point_markers.cpp
\brief Demonstration of some marking data point options.
\details Includes Quickbook markup.
- \author Paul A Bristow
+ \author Paul A Bristow
*/
// Copyright Jacob Voytko 2007
@@ -54,7 +54,7 @@
//[demo_point_markers_2
try
- { // try'n'catch clocks are needed to ensure error messages from any exceptions are shown.
+ { // try'n'catch blocks are needed to ensure error messages from any exceptions are shown.
svg_1d_plot my_1d_plot; // Construct a plot with all the default constructor values.
my_1d_plot.title("Demo point markers Demo") // Add a string title of the 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