[klick for more plot examples]
With MultiPlot, you can easily plot simple graphs like line- and scatter plots in C++. It is a single - header library with zero dependencies under win32.
For other platforms, the small, lightweight and statically linkable FLTK toolkit (www.FLTK.org) is used to create an OpenGL Window. It uses www.opengl.org for plotting.
Simply include multiplot.h and start plotting. Add points with their coordinates (x,y) and optionally their colors (r,g,b) and MULTIPLOT does the rest for you. It scales automatically such that the whole graph fits to the window.
here is a minimal C++ example:
#include "multiplot.h" using namespace multiplot; void main() { // create a multiplot Window at position (x,y)=(50,50) and width=640, height=480 Multiplot m(50, 50, 640, 480); m.show(); // and plot a sine wave for(int x=0; x<10000; x++) { m.plot(x, sin(0.1 * x) ); m.redraw(); m.check(); // event propagation } }
PLEASE drop me a note if you have questions or something doesnt work: post@andre-krause.net
back to homepage