I'm looking for something like:
std::vector<double> X = some_math_function( );
somenamespace :: plot( Wrapper( X ) ); // pop-up and display a graph of X on y-axis, 1 to X.size() on x-axis.
Obviously there are heavier-weight methods like setting up gnu-plot or whatever, and I've used the stuff in VTK charts. I just want a stupid, ghetto, plot to appear. This is for coarse debug checking things like "is the vector even changing? does it suddenly jerk when I move the camera?" and so on.
If this is for debugging why not just output the vector to a delimited file and plot in excel or gnuplot or something as a separate step?
so something like
//untested
ofstream myfilestream("myfile");
std::copy(X.begin(), X.end(), std::ostream_iterator<double>(myfilestream, '\n');
then just plot the file in what ever tool you like e.g.
gnuplot
plot "myfile" with lines
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With