SVG_plot - a data visualization library for C++
This library aims to help the user to easily plot data
that is stored in STL containers in order to display data
on a one-dimensional, two-dimensional plots and boxplots.
The plot is written to produce a Scalable Vector Graphic image in XML
(that can also be easily converted to other graph types,
for example, PNG http://en.wikipedia/org/wiki/Portable_Network_Graphics).
SVG graphics are tiny but very high quality
and do not change resolution when expanded or contracted.
The library is a collection of C++ header files
in Boost layout (there is no need to build a library).
You will need Boost libraries installed too
(but those that are used by SVG_plot are all header-only too).
To use, you must download visualization.zip,
and unzip to a location of your choice.
For example, you might unzip to folder or partition z:
so files are at z:/visualization,
containing sub-folder /boost and /libs and their contents.
You must ensure that the #included files
are visible to your build system.
For Microsoft Visual Studio, this means adding the location
z:/visualization to your VC++ Directories, Include files list,
or by adding to Additional Include Directories.
To use, you must get your data values
(and optionally uncertainty information)
into a STL container like vector (for 1D) or map (for 2D).
vector<double> a; // filled with your data.
svg_1d_plot my_plot; // Construct a plot. my_plot.legend_on(true)
// Set title and legend, and X-axis range and label.
// There are hundreds of other possible options here!
my_plot.write("./1d_simple.svg"); // Finally write the plot to a file.
You can then view the plot using any modern browser
(with Microsoft Internet Explorer <= 8,
you will need to install an Adobe plugin)
If all else fails, download and see the extensive PDF or HTML manual for details.
Paul A. Bristow
Version 1, 9 Nov 11