Are there any C\C++ libraries what will allow me to plot in real time?

If any explanation is needed the perfect example I saw of this was for a API, Swarm, that is used for simulating large numbers of agents. In my program with it a bunch of workers basically went around doing work and at each time step the amount of work that wasn't done was recorded. At each time step the amount of unfinished work over the history of the simulation was plotted.

I have really looked back on Swarm with admiration because I've found nothing else like this. I just gave the program my data points and it plotted everything in a window fitted to show all the data and I could see the history of the program as it ran. I suppose having a plot at the end is all I need but I guess I really liked watching the graph grow while the program ran:p. I've played with plplot but that only seems to show me the plot after I have all the data plotted, unless I do something like destroy and make a new window each time I have a new point. I've also tried embedding python so I can use matplotlib but that was extremely slow.

Recommended Answers

All 2 Replies

Lets say I were to write something on my own, I'd probably try to use wxwidgets. In wxwidgets I assume the IMPLEMENT_APP macro creates the main function. Is there an alternative to this so I could make my own main function and make a plotting library based on wxwidgets that I would use like matlab or pylab? For example,

#include "wxplot.h"

int main()
wxplot *plot = new wxplot();

int *x = {1, 2, 3}, *y = {1, 2, 3};

plot->plot(x, y);

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.