
Jake Voytko started this library during a 2007 GSoC and I have now expanded it quite a bit, and begun to use it for my own purposes (including preparing the plot for the Boost.Math library functions and statistical distributions). Before I do any more work on it, I'd appreciate feedback from Boosters on how useful they think it might be, perhaps as a Boost library? Although it still has plenty of wrinklies (the calculation of positioning of titles, legends, axes labels and ticks labels is intricate - to say the least). And there are not-a-few nasty warts (this may be the 1st version to throw away?), so it is in no way review-ready. But I believe it is working well enough for you to try to use it - and to give me feedback. There are of course hundreds of programs for plotting. What is special about *this* library is that it is in C++ and it has a Boost license. It allows you to add just a few lines of code to the end of your C++ program to take data from any STL container (all or part) and produce a plot as a Scale Vector Graph (.svg) file. (No need to export data to a file and suck into Excel ;-) Applause!) .svg files can be displayed by all good Internet Browsers (and even by IE8 with an Adobe add-in). They are very small but high quality, highly zip compressible, and equally suitable for printing to viewing on mobiles (only the features of Tiny SVG are used.). It takes as little code as svg_2d_plot my_plot; my_plot .plot(map1, "Series 1").stroke_color(blue) .plot(map2, "Series 2").stroke_color(red") .autoscale(map1); my_plot.write("./2d_simple.svg"); but you can have hours of fun trying out hundreds of options to produce some rather fancy plots. For your amusement, attached are a few (mostly contrived) examples (with tasteless garish colors just to highlight the possible options). There are also lots and lots of other examples. (Note that the 20 plots occupy a mere 30 kb when zipped). Unusually, there is lots (too much? - 6Mbyte hyperlinked and indexed PDF!) of documentation, produced using the C++ in QuickBook with Doxygen reference info and John Maddock's auto-indexing. But there are hundreds of options, so you will need all the help you can get from tutorials, examples and indexes. A novel feature is the built-in handling of an 'uncertain' type (based on Evan Marshal Manning, C/C++ Users Journal, March 1996 page 29 to 38) including a double 'most likely' value, an 'uncertainty' estimate, roughly standard deviation, and an estimate of 'degrees of freedom'. This can be used to display confidence ellipses and label values "1.23 +-0.01 (21)", for example. (Of course, you can make much better confidence estimates using the Boost.Math library). You can view and can get code from the Boost sandbox https://svn.boost.org/svn/boost/sandbox/SOC/2007/visualization Docs are available to build as html and pre-built as pdf (patience - 6 Mbyte!) https://svn.boost.org/svn/boost/sandbox/SOC/2007/visualization/libs/svg_plot /doc/pdf/svg_plot.pdf or http://tinyurl.com/coqlbg (or ask if you want zips instead). Paul PS Thanks to all those who have offered support, especially John Maddock of course. It has stress-tested the Quickbook - Doxygen indexing system ;-) I haven't managed to make the index work perfectly yet and I'm sure it can be improved. PPS If I were doing this again, I would not use 'derived' trick to permit re-use of functions by 1D, 2D and boxplots - it causes the Intellisense of MS VisualStudio IDE 'Intelligence Circuits' to melt (and sometimes crash - workaround - delete the .ncb file) making the nice 'goto definition' feature ineffective and makes debugging difficult (as does the use of set and get functions). I suspect it makes compile times longer too. There must be a better way - suggestions welcome. But I *would* use the chaining feature - I think it makes a very nice syntax for the user - but tell me what you think. --- Paul A. Bristow Prizet Farmhouse Kendal, UK LA8 8AB +44 1539 561830, mobile +44 7714330204 pbristow@hetp.u-net.com

On Wed, Jul 29, 2009 at 10:06 AM, Paul A. Bristow<pbristow@hetp.u-net.com> wrote:
Jake Voytko started this library during a 2007 GSoC and I have now expanded it quite a bit, and begun to use it for my own purposes (including preparing the plot for the Boost.Math library functions and statistical distributions).
Before I do any more work on it, I'd appreciate feedback from Boosters on how useful they think it might be, perhaps as a Boost library?
Paul (and Jake), thanks for doing this. I think it will be very useful for what I'm working on right now. I have an automated testing framework that needs to output multiple histograms and I'm currently using gnuplot for this. I have to output a data file and a script file from my program, then start the gnuplot process programmatically, which is quite cumbersome. Having histogram outputting capabilities in pure C++ sounds great! One quick question from perusing the docs. Why does the data require a 0 at the end of the sequence to mark the end, rather than just an end iterator? A sentinel value seems a little odd, but I admit I haven't made it very far into the documentation. I will definitely report back to you once I use this library, --Michael Fawcett

-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Michael Fawcett Sent: 29 July 2009 18:31 To: boost@lists.boost.org Subject: Re: [boost] Boost.Plot? - Scalable Vector Graphics
One quick question from perusing the docs. Why does the data require a 0 at the end of the sequence to mark the end, rather than just an end iterator? A sentinel value seems a little odd, but I admit I haven't made it very far into the documentation.
The data does not require a sentinel - just an STL container. I've tried to provide functions so that you can feed a whole container, or use iterators to pick out a sub-range. And also handle the autoscaling so you can do the same - and also (a common) case want the range to cover the 'minimum of the minimums and the maximum of the maximums'.
I will definitely report back to you once I use this library,
Please do. Eating is the 'proof of the pudding' ;-) Paul --- Paul A. Bristow Prizet Farmhouse Kendal, UK LA8 8AB +44 1539 561830, mobile +44 7714330204 pbristow@hetp.u-net.com

On Thu, Jul 30, 2009 at 10:02 AM, Paul A. Bristow<pbristow@hetp.u-net.com> wrote:
The data does not require a sentinel - just an STL container.
I've tried to provide functions so that you can feed a whole container, or use iterators to pick out a sub-range.
Good to know. I got confused by this example: https://svn.boost.org/svn/boost/sandbox/SOC/2007/visualization/libs/svg_plot... or: http://tinyurl.com/nxwhuf Thanks again...off to make some histograms... --Michael Fawcett

Paul and all other, how complicated might it be to spit out a gil image from the plot rather than a svg file? Is it possible to templatize svg_2d_plot to 2d_plot< svg > and then 2d_plot< gil::image >. I'm sure it's possible but how much work would it be? I could see myself writing the gil portion. Thanks Paul for this library. Christian

It could be of interest the following library: http://www.antigrain.com/svg/index.html I believe that the author of antigrain was in contact with the boost people. - Enrique On Thu, Jul 30, 2009 at 12:28 PM, Christian Henning<chhenning@gmail.com> wrote:
Paul and all other,
how complicated might it be to spit out a gil image from the plot rather than a svg file? Is it possible to templatize svg_2d_plot to 2d_plot< svg > and then 2d_plot< gil::image >. I'm sure it's possible but how much work would it be? I could see myself writing the gil portion.
Thanks Paul for this library.
Christian _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

AFAIK AGG development has not been active since the license was switched to GPL in v2.5 about the same time Maxim joined a company working in the same field. The future status of the library was questionable in 2007 when this happened, and now googling back it seems like what everyone feared happened. In hindsight it looks like the Mozilla crew made the right decision when they decided to use Cairo instead of AGG. --> Mika Heiskanen Enrique Nieloud wrote:
It could be of interest the following library:
http://www.antigrain.com/svg/index.html
I believe that the author of antigrain was in contact with the boost people.
- Enrique On Thu, Jul 30, 2009 at 12:28 PM, Christian Henning<chhenning@gmail.com> wrote:
Paul and all other,
how complicated might it be to spit out a gil image from the plot rather than a svg file? Is it possible to templatize svg_2d_plot to 2d_plot< svg > and then 2d_plot< gil::image >. I'm sure it's possible but how much work would it be? I could see myself writing the gil portion.
Thanks Paul for this library.
Christian _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Christian Henning Sent: 30 July 2009 16:28 To: boost@lists.boost.org Subject: Re: [boost] Boost.Plot? - Scalable Vector Graphics
Paul and all other,
how complicated might it be to spit out a gil image from the plot rather than a svg file? Is it possible to templatize svg_2d_plot to 2d_plot< svg > and then 2d_plot< gil::image >. I'm sure it's possible but how much work would it be? I could see myself writing the gil portion.
Would it be possible to use the SVG text from an ostream or an array of bytes to convert to gil_image? This might be much simpler to implement. All the functions are geared to outputting SVG commands and it would require a complete duplication of the exceedingly many functions. Another Booster pointed me to Qt Widgets as a renderer " QSvgWidget::QSvgWidget ( const QString & file, QWidget * parent = 0 ) Constructs a new SVG display widget with the given parent and loads the contents of the specified file. " Seems promising - is there a similar svg to gil_image converter? But then I'm entirely ignorant of gil_images :-) Paul --- Paul A. Bristow Prizet Farmhouse Kendal, UK LA8 8AB +44 1539 561830, mobile +44 7714330204 pbristow@hetp.u-net.com

Paul, I have a gil extension using OpenCV to draw primitives into a gil image. Without looking at your code. How easy is to get the max coordinate which would serve as image dimensions? Do you have scaling or other transformations implemented? Ahh, yes, what drawing primitives are you using? Line segments only? Questions over questions. I guess I should have a look at your code. ;-) Christian On Thu, Jul 30, 2009 at 1:14 PM, Paul A. Bristow<pbristow@hetp.u-net.com> wrote:
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Christian Henning Sent: 30 July 2009 16:28 To: boost@lists.boost.org Subject: Re: [boost] Boost.Plot? - Scalable Vector Graphics
Paul and all other,
how complicated might it be to spit out a gil image from the plot rather than a svg file? Is it possible to templatize svg_2d_plot to 2d_plot< svg > and then 2d_plot< gil::image >. I'm sure it's possible but how much work would it be? I could see myself writing the gil portion.
Would it be possible to use the SVG text from an ostream or an array of bytes to convert to gil_image?
This might be much simpler to implement. All the functions are geared to outputting SVG commands and it would require a complete duplication of the exceedingly many functions.
Another Booster pointed me to Qt Widgets as a renderer
" QSvgWidget::QSvgWidget ( const QString & file, QWidget * parent = 0 )
Constructs a new SVG display widget with the given parent and loads the contents of the specified file. "
Seems promising - is there a similar svg to gil_image converter?
But then I'm entirely ignorant of gil_images :-)
Paul
--- Paul A. Bristow Prizet Farmhouse Kendal, UK LA8 8AB +44 1539 561830, mobile +44 7714330204 pbristow@hetp.u-net.com
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Christian Henning Sent: 30 July 2009 18:40 To: boost@lists.boost.org Subject: Re: [boost] Boost.Plot? - Scalable Vector Graphics
Paul, I have a gil extension using OpenCV to draw primitives into a gil image. Without looking at your code. How easy is to get the max coordinate which would serve as image dimensions? Do you have scaling or other transformations implemented? Ahh, yes, what drawing primitives are you using? Line segments only?
Questions over questions. I guess I should have a look at your code. ;-)
I suggest first looking at some of the .svg file sources I provided - using your favourite browser, and View, Page Source. Anything you see there is easily available. For a start it includes the image size. And the svg graphics specification http://www.w3.org/TR/SVG11/ to get a flavour. Inkscape is a nice SVG editor and viewer (renderer) and allows conversion to other formats (png, ps... ) - but not gil_image. Paul --- Paul A. Bristow Prizet Farmhouse Kendal, UK LA8 8AB +44 1539 561830, mobile +44 7714330204 pbristow@hetp.u-net.com

Paul, I've been looking at your code for some time. The mass of code you and Jake is mind boggling. Can you tell me a simple way of iterating through the svg's primitives? Is that possible? I need to have access to primitives, like text, lines, polylines, circles, etc. Once that is done I can start writing my drawing functions. Thanks, Christian On Thu, Jul 30, 2009 at 1:47 PM, Paul A. Bristow<pbristow@hetp.u-net.com> wrote:
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Christian Henning Sent: 30 July 2009 18:40 To: boost@lists.boost.org Subject: Re: [boost] Boost.Plot? - Scalable Vector Graphics
Paul, I have a gil extension using OpenCV to draw primitives into a gil image. Without looking at your code. How easy is to get the max coordinate which would serve as image dimensions? Do you have scaling or other transformations implemented? Ahh, yes, what drawing primitives are you using? Line segments only?
Questions over questions. I guess I should have a look at your code. ;-)
I suggest first looking at some of the .svg file sources I provided - using your favourite browser, and View, Page Source.
Anything you see there is easily available. For a start it includes the image size.
And the svg graphics specification http://www.w3.org/TR/SVG11/ to get a flavour.
Inkscape is a nice SVG editor and viewer (renderer) and allows conversion to other formats (png, ps... ) - but not gil_image.
Paul
--- Paul A. Bristow Prizet Farmhouse Kendal, UK LA8 8AB +44 1539 561830, mobile +44 7714330204 pbristow@hetp.u-net.com
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Christian Henning Sent: 01 August 2009 20:09 To: boost@lists.boost.org Subject: Re: [boost] Boost.Plot? - Scalable Vector Graphics
I've been looking at your code for some time. The mass of code you and Jake is mind boggling. Can you tell me a simple way of iterating through the svg's primitives? Is that possible? I need to have access to primitives, like text, lines, polylines, circles, etc. Once that is done I can start writing my drawing functions.
You might like to look at boost-sandbox\SOC\2007\visualization\libs\svg_plot\example\demo_svg.cpp This is a disgusting hodgepodge of various misc experiments that really should not be on public view :-( But it may give you some ideas on how to start to write something useful to you. I'll try to expand some of the documentation of these primitive svg functions - so far we have regarded them as implementation details, but there is no reason why they can't be used on their own. They are listed in the overall index, but you may have trouble seeing the wood for the trees. You do need to understand the use of groups - effectively layers - that control what writes over what. The plot program uses dozens of layers, but you may need only one - I'd start with just one until you need more! Have fun! Paul --- Paul A. Bristow Prizet Farmhouse Kendal, UK LA8 8AB +44 1539 561830, mobile +44 7714330204 pbristow@hetp.u-net.com

Hi Paul, I have seen some trees in woods and wrote some code for traversing a g_element. Pretty simple composite pattern it seems to me. But before I can continue there is some functionality I need to be added. 1. I cannot access the private members of all svg_elements. Like a line's start and end coordinates. 2. Can you make the member "image" accessible from svg_1d_plot, etc.? To draw correctly, the current attributes like "fill" and "stroke", etc, are handed down the tree, I suppose. For instance if a group defines red as the stroke color then all the childs would inherit it. Except they have their own definition. Am I right here? Regards, Christian

On 29 Jul 2009, at 13:08, John Maddock wrote:
Jake Voytko started this library during a 2007 GSoC and I have now expanded it quite a bit, and begun to use it for my own purposes (including preparing the plot for the Boost.Math library functions and statistical distributions).
Before I do any more work on it, I'd appreciate feedback from Boosters on how useful they think it might be, perhaps as a Boost library?
[...] I think that a graphics library would be a welcome addition. The obvious sticking point is scope (3D - 2D - OpenGL?) etc. That said, are you aware of ROOT? http://root.cern.ch/drupal/image it uses a C++ interpreter (CINT) as the front end and has quite decent graphics production. -ed ------------------------------------------------ "No more boom and bust." -- Dr. J. G. Brown, 1997

-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Paul A. Bristow Sent: Wednesday, July 29, 2009 10:07 PM To: boost@lists.boost.org Subject: [boost] Boost.Plot? - Scalable Vector Graphics
Jake Voytko started this library during a 2007 GSoC and I have now expanded it quite a bit, and begun to use it for my own purposes (including
plot for the Boost.Math library functions and statistical distributions).
Before I do any more work on it, I'd appreciate feedback from Boosters on how useful they think it might be, perhaps as a Boost library?
Although it still has plenty of wrinklies (the calculation of positioning of titles, legends, axes labels and ticks labels is intricate - to say the least).
And there are not-a-few nasty warts (this may be the 1st version to throw away?), so it is in no way review-ready.
But I believe it is working well enough for you to try to use it - and to give me feedback.
There are of course hundreds of programs for plotting.
What is special about *this* library is that it is in C++ and it has a Boost license.
It allows you to add just a few lines of code to the end of your C++
Thank you Paul. I think I will definitely make use of your lib. I have had a look at your demo plots - they are very cool. B/Rgds Max preparing the program to
take data from any STL container (all or part) and produce a plot as a Scale Vector Graph (.svg) file. (No need to export data to a file and suck into Excel ;-) Applause!)
.svg files can be displayed by all good Internet Browsers (and even by IE8 with an Adobe add-in). They are very small but high quality, highly zip compressible, and equally suitable for printing to viewing on mobiles (only the features of Tiny SVG are used.).
It takes as little code as
svg_2d_plot my_plot; my_plot .plot(map1, "Series 1").stroke_color(blue) .plot(map2, "Series 2").stroke_color(red") .autoscale(map1); my_plot.write("./2d_simple.svg");
but you can have hours of fun trying out hundreds of options to produce some rather fancy plots.
For your amusement, attached are a few (mostly contrived) examples (with tasteless garish colors just to highlight the possible options). There are also lots and lots of other examples. (Note that the 20 plots occupy a mere 30 kb when zipped).
Unusually, there is lots (too much? - 6Mbyte hyperlinked and indexed PDF!) of documentation, produced using the C++ in QuickBook with Doxygen reference info and John Maddock's auto-indexing. But there are hundreds of options, so you will need all the help you can get from tutorials, examples and indexes.
A novel feature is the built-in handling of an 'uncertain' type (based on Evan Marshal Manning, C/C++ Users Journal, March 1996 page 29 to 38) including a double 'most likely' value, an 'uncertainty' estimate, roughly standard deviation, and an estimate of 'degrees of freedom'. This can be used to display confidence ellipses and label values "1.23 +-0.01 (21)", for example. (Of course, you can make much better confidence estimates using the Boost.Math library).
You can view and can get code from the Boost sandbox
https://svn.boost.org/svn/boost/sandbox/SOC/2007/visualization
Docs are available to build as html and pre-built as pdf (patience - 6 Mbyte!)
https://svn.boost.org/svn/boost/sandbox/SOC/2007/visualization/libs/svg_pl ot /doc/pdf/svg_plot.pdf
(or ask if you want zips instead).
Paul
PS Thanks to all those who have offered support, especially John Maddock of course. It has stress-tested the Quickbook - Doxygen indexing system ;-) I haven't managed to make the index work perfectly yet and I'm sure it can be improved.
PPS If I were doing this again, I would not use 'derived' trick to permit re-use of functions by 1D, 2D and boxplots - it causes the Intellisense of MS VisualStudio IDE 'Intelligence Circuits' to melt (and sometimes crash - workaround - delete the .ncb file) making the nice 'goto definition' feature ineffective and makes debugging difficult (as does the use of set and get functions). I suspect it makes compile times longer too. There must be a better way - suggestions welcome.
But I *would* use the chaining feature - I think it makes a very nice syntax for the user - but tell me what you think.
--- Paul A. Bristow Prizet Farmhouse Kendal, UK LA8 8AB +44 1539 561830, mobile +44 7714330204 pbristow@hetp.u-net.com

Paul A. Bristow wrote:
Jake Voytko started this library during a 2007 GSoC and I have now expanded it quite a bit, and begun to use it for my own purposes (including preparing the plot for the Boost.Math library functions and statistical distributions).
Before I do any more work on it, I'd appreciate feedback from Boosters on how useful they think it might be, perhaps as a Boost library?
I think that a library to create plots is in general very useful, and I did not find any convenient solution last time I needed this. Plotting to SVG is also very good idea. It means that the library will be immediately useful to many GUI and non-GUI application, without requiring binding to existing GUI toolkits to be written. And the examples look very nice, too! - Volodya

Hi Paul, Very interesting library indeed. Recently I had to plot some series of data with a logarithmic scale on the screen, and I remember the code got quite messy when it came to automate a few autoscaling stuff relatively to the display area and the data available. Would this kind of library have been helpful in my case? I mean: does it propose logarithmic scaling features, and is it sufficiently generic to easily change the output type (e.g. an OpenGL framebuffer)? Regards Bruno

-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Bruno Lalande Sent: 30 July 2009 09:24 To: boost@lists.boost.org Subject: Re: [boost] Boost.Plot? - Scalable Vector Graphics
Recently I had to plot some series of data with a logarithmic scale on the screen, and I remember the code got quite messy when it came to automate a few autoscaling stuff relatively to the display area and the data available. Would this kind of library have been helpful in my case?
You will see if you look at the docs (and, god forbid, the code) that the autoscaling is quite tricky. I've tried quite hard to get it to pick 'nice' axes limits - a thing that has annoyed me about using Excel to plot graphs for example. But you may still need to provide some guidance parameters to make it suit your taste.
I mean: does it propose logarithmic scaling features,
So far I have completely ducked the log scaling - it looked completely different from linear - and a bit scary. So to plot things on a log scale, you will have to take logs first, and then plot them.
and is it sufficiently generic to easily change the output type (e.g. an OpenGL framebuffer)?
Well the output is plain readable text - use your browser View, Page Source to see it. You can send this text to a ostream or a file. I'm afraid how you get it rendered is your problem :-( But it might be possible - the SVG is entirely Standard. Paul --- Paul A. Bristow Prizet Farmhouse Kendal, UK LA8 8AB +44 1539 561830, mobile +44 7714330204 pbristow@hetp.u-net.com

Hi,
I mean: does it propose logarithmic scaling features,
So far I have completely ducked the log scaling - it looked completely different from linear - and a bit scary.
So to plot things on a log scale, you will have to take logs first, and then plot them.
It would only be a half solution since I expect from that kind of scale that the x axis be also scaled logarithmically, with exponential graduations in order to finally render regular intervals (e.g. for a sound bandwith: 20, 200, 2000, 20000 Hz).
and is it sufficiently generic to easily change the output type (e.g. an OpenGL framebuffer)?
Well the output is plain readable text - use your browser View, Page Source to see it.
You can send this text to a ostream or a file.
I'm afraid how you get it rendered is your problem :-(
But it might be possible - the SVG is entirely Standard.
Yes indeed... hadn't even realized that SVG is not a way to render but a way to express information. BTW a quick googling shew me that there apparently exist some SVG to OpenGL libs. Regards Bruno

-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Paul A. Bristow Sent: Wednesday, July 29, 2009 10:07 PM To: boost@lists.boost.org Subject: [boost] Boost.Plot? - Scalable Vector Graphics
Jake Voytko started this library during a 2007 GSoC and I have now expanded it quite a bit, and begun to use it for my own purposes (including
plot for the Boost.Math library functions and statistical distributions).
Before I do any more work on it, I'd appreciate feedback from Boosters on how useful they think it might be, perhaps as a Boost library?
Although it still has plenty of wrinklies (the calculation of positioning of titles, legends, axes labels and ticks labels is intricate - to say the least).
And there are not-a-few nasty warts (this may be the 1st version to throw away?), so it is in no way review-ready.
But I believe it is working well enough for you to try to use it - and to give me feedback.
There are of course hundreds of programs for plotting.
What is special about *this* library is that it is in C++ and it has a Boost license.
It allows you to add just a few lines of code to the end of your C++
One Simple question. I've never used svg format before. We know it's quite easy to show an SVG file in IE or so by drag-n-drop, how can we visualize SVG file by our own, that means how to show the plots in my program not using a browser? Thanks B/Rgds Max preparing the program to
take data from any STL container (all or part) and produce a plot as a Scale Vector Graph (.svg) file. (No need to export data to a file and suck into Excel ;-) Applause!)
.svg files can be displayed by all good Internet Browsers (and even by IE8 with an Adobe add-in). They are very small but high quality, highly zip compressible, and equally suitable for printing to viewing on mobiles (only the features of Tiny SVG are used.).
It takes as little code as
svg_2d_plot my_plot; my_plot .plot(map1, "Series 1").stroke_color(blue) .plot(map2, "Series 2").stroke_color(red") .autoscale(map1); my_plot.write("./2d_simple.svg");
but you can have hours of fun trying out hundreds of options to produce some rather fancy plots.
For your amusement, attached are a few (mostly contrived) examples (with tasteless garish colors just to highlight the possible options). There are also lots and lots of other examples. (Note that the 20 plots occupy a mere 30 kb when zipped).
Unusually, there is lots (too much? - 6Mbyte hyperlinked and indexed PDF!) of documentation, produced using the C++ in QuickBook with Doxygen reference info and John Maddock's auto-indexing. But there are hundreds of options, so you will need all the help you can get from tutorials, examples and indexes.
A novel feature is the built-in handling of an 'uncertain' type (based on Evan Marshal Manning, C/C++ Users Journal, March 1996 page 29 to 38) including a double 'most likely' value, an 'uncertainty' estimate, roughly standard deviation, and an estimate of 'degrees of freedom'. This can be used to display confidence ellipses and label values "1.23 +-0.01 (21)", for example. (Of course, you can make much better confidence estimates using the Boost.Math library).
You can view and can get code from the Boost sandbox
https://svn.boost.org/svn/boost/sandbox/SOC/2007/visualization
Docs are available to build as html and pre-built as pdf (patience - 6 Mbyte!)
https://svn.boost.org/svn/boost/sandbox/SOC/2007/visualization/libs/svg_pl ot /doc/pdf/svg_plot.pdf
(or ask if you want zips instead).
Paul
PS Thanks to all those who have offered support, especially John Maddock of course. It has stress-tested the Quickbook - Doxygen indexing system ;-) I haven't managed to make the index work perfectly yet and I'm sure it can be improved.
PPS If I were doing this again, I would not use 'derived' trick to permit re-use of functions by 1D, 2D and boxplots - it causes the Intellisense of MS VisualStudio IDE 'Intelligence Circuits' to melt (and sometimes crash - workaround - delete the .ncb file) making the nice 'goto definition' feature ineffective and makes debugging difficult (as does the use of set and get functions). I suspect it makes compile times longer too. There must be a better way - suggestions welcome.
But I *would* use the chaining feature - I think it makes a very nice syntax for the user - but tell me what you think.
--- Paul A. Bristow Prizet Farmhouse Kendal, UK LA8 8AB +44 1539 561830, mobile +44 7714330204 pbristow@hetp.u-net.com

-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Max Sent: 30 July 2009 09:28 To: boost@lists.boost.org Subject: Re: [boost] Boost.Plot? - Scalable Vector Graphics
One Simple question.
I've never used svg format before. We know it's quite easy to show an SVG file in IE or so by drag-n-drop, how can we visualize SVG file by our own, that means how to show the plots in my program not using a browser?
Well you can also add them to html and pdf (as is shown in the SVG plot docs) and other document files, but otherwise your program has to have a way to render the files, perhaps by invoking a browser or a viewer like Inkscape (free open source). (You can view the SVG source with any editor - it's plain readable text - and you can even edit it to change things). HTH Paul --- Paul A. Bristow Prizet Farmhouse Kendal, UK LA8 8AB +44 1539 561830, mobile +44 7714330204 pbristow@hetp.u-net.com

Thank you Paul.
One Simple question.
I've never used svg format before. We know it's quite easy to show an SVG file in IE or so by drag-n-drop, how can we visualize SVG file by our own, that means how to show the plots in my program not using a browser?
Well you can also add them to html and pdf (as is shown in the SVG plot docs) and other document files, but otherwise your program has to have a way to render the files, perhaps by invoking a browser or a viewer like Inkscape (free open source).
What I need is to render the SVG files in my program without relying on a browser like IE. Inkscape seems to be a standalone vector graphics editor. Is there any vector rendering lib with a simple interface visualizing a vector graphics file, like SVG? I believe the combinition of your plot lib + any svg rendering lib will greaty make life easier and happier. :-) Thank you.
(You can view the SVG source with any editor - it's plain readable text - and you can even edit it to change things).
Yes. Thanks for pointing out this.
HTH
Paul
--- Paul A. Bristow Prizet Farmhouse Kendal, UK LA8 8AB +44 1539 561830, mobile +44 7714330204 pbristow@hetp.u-net.com
B/Rgds Max

Max wrote:
Thank you Paul.
One Simple question.
I've never used svg format before. We know it's quite easy to show an SVG file in IE or so by drag-n-drop, how can we visualize SVG file by our own, that means how to show the plots in my program not using a browser?
Well you can also add them to html and pdf (as is shown in the SVG plot docs) and other document files, but otherwise your program has to have a way to render the files, perhaps by invoking a browser or a viewer like Inkscape (free open source).
What I need is to render the SVG files in my program without relying on a browser like IE. Inkscape seems to be a standalone vector graphics editor. Is there any vector rendering lib with a simple interface visualizing a vector graphics file, like SVG?
Yes, Qt. - Volodya

-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Vladimir Prus Sent: Friday, July 31, 2009 1:22 PM To: boost@lists.boost.org Subject: Re: [boost] Boost.Plot? - Scalable Vector Graphics
Max wrote:
Thank you Paul.
One Simple question.
I've never used svg format before. We know it's quite easy to show an SVG file in IE or so by drag-n-drop, how can we visualize SVG file by our own, that means how to show the plots in my program not using a browser?
Well you can also add them to html and pdf (as is shown in the SVG plot docs) and other document files, but otherwise your program has to have a way to render the files, perhaps by invoking a browser or a viewer like Inkscape (free open source).
What I need is to render the SVG files in my program without relying on a browser like IE. Inkscape seems to be a standalone vector graphics editor. Is
Thank you Volodya. I know of the Qt collection but never make used of it before. One more quick questions for boosters that are familiar with Qt: It seems that I should use the basic Qt frameworks if I want to play with QtSVG. Is that Right? Is there any other alternatives that imposes a looser license? Thanks B/Rgds Max there
any vector rendering lib with a simple interface visualizing a vector graphics file, like SVG?
Yes, Qt.
- Volodya
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Max wrote:
Thank you Volodya. I know of the Qt collection but never make used of it before.
One more quick questions for boosters that are familiar with Qt:
It seems that I should use the basic Qt frameworks if I want to play with QtSVG. Is that Right? Is there any other alternatives that imposes a looser license?
What do you mean by "looser license"? The Qt licensing options are certainly not meant to be restrictive, so you can choose between a "commercial" license, a "GNU LGPL v. 2.1" license and a "GNU GPL v. 3.0" license. Citing from http://www.qtsoftware.com/products/licensing : "Our aim with Qt is to make it available to as many developers as possible while helping it evolve and grow. We have chosen three licensing options that directly or indirectly help us continue to evolve Qt." Is there anything fundamentally wrong with the GNU licenses??? And even if, what makes Qt different in this respect from gcc and it's libraries, that are also distributed under GNU licenses? Regards, Thomas

Max wrote:
Thank you Volodya. I know of the Qt collection but never make used of it before.
One more quick questions for boosters that are familiar with Qt:
It seems that I should use the basic Qt frameworks if I want to play with QtSVG. Is that Right? Is there any other alternatives that imposes a looser license?
Looser than LGPL? I think only for-fee commercial license, but seems like LGPL should be more than enough for all purposes. - Volodya

-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Max Sent: 31 July 2009 03:10 To: boost@lists.boost.org Subject: Re: [boost] Boost.Plot? - Scalable Vector Graphics
We know it's quite easy to show an SVG
file in IE or so by drag-n-drop, how can we visualize SVG file by our own, that means how to show the plots in my program not using a browser?
What I need is to render the SVG files in my program without relying on a browser like IE. Inkscape seems to be a standalone vector graphics editor. Is there any vector rendering lib with a simple interface visualizing a vector graphics file, like SVG?
Would InkView (which can be command line driven - including slideshows) Meet your needs? See http://wiki.inkscape.org/wiki/index.php/Inkview Paul --- Paul A. Bristow Prizet Farmhouse Kendal, UK LA8 8AB +44 1539 561830, mobile +44 7714330204 pbristow@hetp.u-net.com

-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Paul A. Bristow Sent: 31 July 2009 09:50 To: boost@lists.boost.org Subject: Re: [boost] Boost.Plot? - Scalable Vector Graphics
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Max Sent: 31 July 2009 03:10 To: boost@lists.boost.org Subject: Re: [boost] Boost.Plot? - Scalable Vector Graphics
We know it's quite easy to show an SVG
file in IE or so by drag-n-drop, how can we visualize SVG file by our own, that means how to show the plots in my program not using a browser?
What I need is to render the SVG files in my program without relying on a browser like IE. Inkscape seems to be a standalone vector graphics editor. Is there any vector rendering lib with a simple interface visualizing a vector graphics file, like SVG?
Would InkView (which can be command line driven - including slideshows)
Meet your needs?
Sorry to reply-to-self but may it help to add that I have just confirmed that this provides a nice way to view one or more svg files. If you download and install the Inkscape package www.inkscape.org/download/ The inkview.exe is included at program files\inkscape. You need it in your PATH of course. Inkview.exe *.svg sets up a slideshow - and you can expand or contract the windows neatly showing the Scaleableness. HTH Paul

Thank you so much for your kind help and further information. B/Rgds Max
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Paul A. Bristow Sent: Friday, July 31, 2009 5:21 PM To: boost@lists.boost.org Subject: Re: [boost] Boost.Plot? - Scalable Vector Graphics
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Paul A. Bristow Sent: 31 July 2009 09:50 To: boost@lists.boost.org Subject: Re: [boost] Boost.Plot? - Scalable Vector Graphics
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Max Sent: 31 July 2009 03:10 To: boost@lists.boost.org Subject: Re: [boost] Boost.Plot? - Scalable Vector Graphics
We know it's quite easy to show an SVG
file in IE or so by drag-n-drop, how can we visualize SVG file by our own, that means how to show the plots in my program not using a browser?
What I need is to render the SVG files in my program without relying on a browser like IE. Inkscape seems to be a standalone vector graphics editor. Is there any vector rendering lib with a simple interface visualizing a vector graphics file, like SVG?
Would InkView (which can be command line driven - including slideshows)
Meet your needs?
Sorry to reply-to-self but may it help to add that I have just confirmed that this provides a nice way to view one or more svg files.
If you download and install the Inkscape package www.inkscape.org/download/
The inkview.exe is included at program files\inkscape. You need it in your PATH of course.
Inkview.exe *.svg
sets up a slideshow - and you can expand or contract the windows neatly showing the Scaleableness.
HTH
Paul
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Thank you Paul for your information. I'll have a look. B/Rgds Max
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Paul A. Bristow Sent: Friday, July 31, 2009 4:50 PM To: boost@lists.boost.org Subject: Re: [boost] Boost.Plot? - Scalable Vector Graphics
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Max Sent: 31 July 2009 03:10 To: boost@lists.boost.org Subject: Re: [boost] Boost.Plot? - Scalable Vector Graphics
We know it's quite easy to show an SVG
file in IE or so by drag-n-drop, how can we visualize SVG file by our own, that means how to show the plots in my program not using a browser?
What I need is to render the SVG files in my program without relying on a browser like IE. Inkscape seems to be a standalone vector graphics editor. Is there any vector rendering lib with a simple interface visualizing a vector graphics file, like SVG?
Would InkView (which can be command line driven - including slideshows)
Meet your needs?
See http://wiki.inkscape.org/wiki/index.php/Inkview
Paul
--- Paul A. Bristow Prizet Farmhouse Kendal, UK LA8 8AB +44 1539 561830, mobile +44 7714330204 pbristow@hetp.u-net.com
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

2009/7/30 Max <more4less@sina.com>:
One Simple question.
I've never used svg format before. We know it's quite easy to show an SVG file in IE or so by drag-n-drop, how can we visualize SVG file by our own, that means how to show the plots in my program not using a browser?
If you're writing a GUI application, you should look at Qt SVG http://doc.trolltech.com/4.4/qtsvg.html The doc says that "Qt supports the static features of SVG 1.2 Tiny." I don't know if it is sufficient to display the images produced by Boost.plot. Manuel Fiorelli

-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Manuel Fiorelli Sent: 30 July 2009 13:16 To: boost@lists.boost.org Subject: Re: [boost] Boost.Plot? - Scalable Vector Graphics
2009/7/30 Max <more4less@sina.com>:
One Simple question.
I've never used svg format before. We know it's quite easy to show an SVG file in IE or so by drag-n-drop, how can we visualize SVG file by our own, that means how to show the plots in my program not using a browser?
If you're writing a GUI application, you should look at Qt SVG
http://doc.trolltech.com/4.4/qtsvg.html
The doc says that "Qt supports the static features of SVG 1.2 Tiny."
I don't know if it is sufficient to display the images produced by Boost.plot.
Should be OK - SVG plot only uses features of SVG 1.2 Tiny. " http://doc.trolltech.com/4.4/qsvgwidget.html#load says " Void QSvgWidget::load ( const QString & file ) [slot] Loads the contents of the specified SVG file and updates the widget. " Looks promising (and write to ostream version should avoid need to use a file provided one can write to a QByteArray?) Paul --- Paul A. Bristow Prizet Farmhouse Kendal, UK LA8 8AB +44 1539 561830, mobile +44 7714330204 pbristow@hetp.u-net.com

Paul A. Bristow skrev:
Jake Voytko started this library during a 2007 GSoC and I have now expanded it quite a bit, and begun to use it for my own purposes (including preparing the plot for the Boost.Math library functions and statistical distributions).
Before I do any more work on it, I'd appreciate feedback from Boosters on how useful they think it might be, perhaps as a Boost library?
No feedback, but very impressive! :-) -Thorsten

Paul A. Bristow skrev: Jake Voytko started this library during a 2007 GSoC and I have now expanded it quite a bit, and begun to use it for my own purposes (including preparing the plot for the Boost.Math library functions and statistical distributions).
usefull, but limited for my purpuse. I would like it to use for technical drawings (electrical schematics, pcb; rectangles, circles, line with/without arrows etc), not even plots only. The focus was on ploting math functions of this library. Olaf

-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Olaf Peter Sent: 30 July 2009 10:42 To: boost@lists.boost.org Subject: Re: [boost] Boost.Plot? - Scalable Vector Graphics
Paul A. Bristow skrev: Jake Voytko started this library during a 2007 GSoC and I have now expanded it quite a bit, and begun to use it for my own purposes (including preparing the plot for the Boost.Math library functions and statistical distributions).
usefull, but limited for my purpuse. I would like it to use for technical drawings (electrical schematics, pcb; rectangles, circles, line with/without arrows etc), not even plots only. The focus was on ploting math functions of this library.
Well the basic line and text drawing features are there - but our focus was on visualising data. But plotting uses these basic functions. This is thinly documented, but you might find the code a useful starting point. I might encourage Jake to document the functions a bit better. Paul --- Paul A. Bristow Prizet Farmhouse Kendal, UK LA8 8AB +44 1539 561830, mobile +44 7714330204 pbristow@hetp.u-net.com

-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Thorsten Ottosen Sent: 30 July 2009 09:39 To: boost@lists.boost.org Subject: Re: [boost] Boost.Plot? - Scalable Vector Graphics
Paul A. Bristow skrev:
Jake Voytko started this library during a 2007 GSoC and I have now expanded it quite a bit, and begun to use it for my own purposes (including
preparing
the plot for the Boost.Math library functions and statistical distributions).
Before I do any more work on it, I'd appreciate feedback from Boosters on how useful they think it might be, perhaps as a Boost library?
No feedback, but very impressive! :-)
You obviously haven't spotted the warts - yet ;-) Paul --- Paul A. Bristow Prizet Farmhouse Kendal, UK LA8 8AB +44 1539 561830, mobile +44 7714330204 pbristow@hetp.u-net.com

On Wednesday 29 July 2009 10:06:54 Paul A. Bristow wrote:
Unusually, there is lots (too much? - 6Mbyte hyperlinked and indexed PDF!) of documentation, produced using the C++ in QuickBook with Doxygen reference info and John Maddock's auto-indexing. But there are hundreds of options, so you will need all the help you can get from tutorials, examples and indexes.
[snip]
PS Thanks to all those who have offered support, especially John Maddock of course. It has stress-tested the Quickbook - Doxygen indexing system ;-) I haven't managed to make the index work perfectly yet and I'm sure it can be improved.
The library is already proving useful for me but the documentation is even better than the library for some purposes. As a real software masochist, I have been using quickbook+boostbook for documentation generation at work and have run into some problems which you seem to have solved. Here are some questions and some comments on the boostbook + quickbook toolchain: 0. Is the indexing system available somewhere? 1. Occasionally, on some template classes, the generated doxygen documentation in PDF (HTML is fine) has extra hyphen characters after the class name. Your documentation does not; is some special magic required? 2. You do not have any SVGs embedded in the class reference even though examples may be very useful there. Is that intentional? 3. Which version of fop did you use? 0.95.x seems to have problems with inline attributes. I ended up using an SVN version from a few weeks ago. 4. Is there any way of convincing boostbook to actually list the following? - Template parameters to functions (using doxygen \tparam) - Bug list (doxygen \bug) and todo list (doxygen \todo) - private members of classes which have doxygen documentation - an equivalent of doxygen \see The required changes to doxygen2boostbook.xsl seem straightforward but boostbook itself might need to be modified to support this. 5. When applying doxygen2boostbook.xsl, unless my code is in a subdirectory of a directory called boost, passing in a value for boost.doxygen.header.prefix generates incorrect links (if the value passed in is x, links go to x/x/foo.h instead of x/foo.h). Do you avoid this by virtue of using the file layout in the sandbox? 6. I also had to get rid of the HTML navbar by setting the layout to none and replacing the image with a 1px transparent gif, though the pages don't look as nice then. 7. LaTeX equations in doxygen documentation which are transformed to PNGs look extremely ugly in the generated boostbook PDF documentation. I looked at Eric's support logic in boostbook but much more work is required to get Doxygen to produce PDFs which can then be directly used. For reference, the docbook dtd and stylesheets are those than come with Fedora 11. Regards, Ravi
participants (14)
-
Bruno Lalande
-
Christian Henning
-
Edward Grace
-
Enrique Nieloud
-
Manuel Fiorelli
-
Max
-
Michael Fawcett
-
Mika Heiskanen
-
Olaf Peter
-
Paul A. Bristow
-
Ravi
-
Thomas Klimpel
-
Thorsten Ottosen
-
Vladimir Prus