diff --git a/doc/sf_and_dist/graphs/dist_graphs.cpp b/doc/sf_and_dist/graphs/dist_graphs.cpp index f4221af80..db609e3ba 100644 --- a/doc/sf_and_dist/graphs/dist_graphs.cpp +++ b/doc/sf_and_dist/graphs/dist_graphs.cpp @@ -3,15 +3,26 @@ // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#ifdef _MSC_VER +//# pragma warning (disable : 4800) // forcing value to bool 'true' or 'false' (performance warning) +# pragma warning (disable : 4180) // qualifier applied to function type has no meaning; ignored +# pragma warning (disable : 4503) // decorated name length exceeded, name was truncated +# pragma warning (disable : 4512) // assignment operator could not be generated +//# pragma warning (disable : 4172) // returning address of local variable or temporary TODO find cause of these. +# pragma warning (disable : 4224) // nonstandard extension used : formal parameter 'function_ptr' was previously defined as a type +#endif + #define BOOST_MATH_OVERFLOW_ERROR_POLICY ignore_error #include #include #include + #include #include #include + template struct value_finder { @@ -147,6 +158,7 @@ public: svg_2d_plot plot; plot.image_size(750, 400); + plot.coord_precision(4); // Avoids any visible steps. plot.title_font_size(20); plot.legend_title_font_size(15); plot.title(title); @@ -155,10 +167,13 @@ public: double x_delta = (m_max_x - m_min_x) / 10; double y_delta = (m_max_y - m_min_y) / 10; plot.x_range(m_min_x, m_max_x) - .y_range(m_min_y, m_max_y + y_delta); + .y_range(m_min_y, m_max_y + y_delta); plot.x_label_on(true).x_label("Random Variable"); plot.y_label_on(true).y_label("Probability"); - plot.plot_border_color(lightslategray).legend_border_color(lightslategray).background_border_color(lightslategray); + plot.plot_border_color(lightslategray) + .background_border_color(lightslategray) + .legend_border_color(lightslategray) + .legend_background_color(white); // // Work out axis tick intervals: // @@ -179,7 +194,7 @@ public: i != m_distributions.end(); ++i) { double x = m_min_x; - double interval = (m_max_x - m_min_x) / 1000; + double interval = (m_max_x - m_min_x) / 200; std::map data; while(x <= m_max_x) { @@ -189,7 +204,8 @@ public: plot.plot(data, i->first) .line_on(true) .line_color(colors[color_index]) - .line_width(0.5) + .line_width(1.) + //.bezier_on(true) // Can't cope with badly behaved like uniform & triangular. .shape(none); ++color_index; color_index = color_index % (sizeof(colors)/sizeof(colors[0])); diff --git a/doc/sf_and_dist/graphs/sf_graphs.cpp b/doc/sf_and_dist/graphs/sf_graphs.cpp index 7a29f0ba6..86f9e53aa 100644 --- a/doc/sf_and_dist/graphs/sf_graphs.cpp +++ b/doc/sf_and_dist/graphs/sf_graphs.cpp @@ -1,7 +1,22 @@ +// (C) Copyright John Maddock 2008. +// Use, modification and distribution are subject to 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) + +#ifdef _MSC_VER +//# pragma warning (disable : 4800) // forcing value to bool 'true' or 'false' (performance warning) +# pragma warning (disable : 4180) // qualifier applied to function type has no meaning; ignored +# pragma warning (disable : 4503) // decorated name length exceeded, name was truncated +# pragma warning (disable : 4512) // assignment operator could not be generated +//# pragma warning (disable : 4172) // returning address of local variable or temporary TODO find cause of these. +# pragma warning (disable : 4224) // nonstandard extension used : formal parameter 'function_ptr' was previously defined as a type +#endif + #include #include #include #include + #include #include #include @@ -109,7 +124,7 @@ public: svg_2d_plot plot; plot.image_size(600, 400); plot.copyright_holder("John Maddock").copyright_date("2008").boost_license_on(true); - plot.coord_precision(4); // Ciould be 3 for smaller plots. + plot.coord_precision(4); // Could be 3 for smaller plots? plot.title(title).title_font_size(20).title_on(true); plot.legend_on(m_has_legend); @@ -146,7 +161,7 @@ public: plot.plot(i->second, i->first) .line_on(true) .line_color(colors[color_index]) - .line_width(0.5) + .line_width(1.) .shape(none); if(i->first.size()) ++color_index;