views:

4498

answers:

8

Does anyone know any (preferably FOSS) C++ libraries that can draw basic graphs?

I'm looking for something rather simplistic. Everything I could find through Googling involved complex, scientific-oriented 3D graphs. MathGL seemed like a good choice but I'm afraid it might be way too complex for our project.

Thanks in advance!


See also:

and possible:

And at least a few other specific to other languages.

+6  A: 

There's gnuplot++, but I've never used it, so I can't vouch for or against it.

You'll probably find that most plotting libraries are more complex than you'd think at first, but that's because the general case of plotting data is pretty complex.

Scottie T
"the general case of plotting data is pretty complex"---You could say that.
dmckee
Yeah, but we need to integrate a very very basic plotting functionality with our app. However, gnuplot seems like it would do the trick. Thanks!
Lucas Cardoso
+1  A: 

You may just want to popen("gnuplot","w"). You can pass data inline with plot "-" ... followed by the data and an 'e'.

Mr.Ree
+4  A: 

Related question: http://stackoverflow.com/questions/215110/scatter-plots-in-c

Has several links to C++ graphing resources/libraries.

Adam Davis
+2  A: 

I think you can use GraphViz in combination with the boost graph library

rboorgapally
+1  A: 

PyChart produces nice (nicer than gnuplot IMHO) charts from Python and is pretty easy to drive. Don't know how easy it'd be to wrap for C++ with SWIG or Boost.Python (just going through an intermediate csv file or popen call works for me).

timday
A: 

You can use R to draw really nice graphs. See here for examples.

+1  A: 

QT offers lots of drawing options 2D and 3D.

lothar