Skip to content

Simple C++ class for quick & easy real-time plotting via a pipe to gnuplot

Notifications You must be signed in to change notification settings

jal278/plotpipe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

plotpipe

Simple C++ class for quick & dirty real-time plotting via a pipe to gnuplot

Right now it's just a simple header file that allows plotting a vector of one-d or two-d data that can refresh as your program runs. I designed it for scientific computing in mind, but it might be useful in many contexts.

Note: right now it depends on linux (not familiar with windows pipe commands), and requires an installation of gnuplot.

Here's how it's used:

#include <vector>
#include "graph.h"
using namespace std;

int main(int argc,char **argv) {
	plot p;
	for(int a=0;a<100;a++) {
		vector<float> x,y;
		for(int k=a;k<a+200;k++) {
			x.push_back(k);
			y.push_back(k*k);
		}
		p.plot_data(x,y);
	}
	return 0;
}

This example will just plot a quadratic function, and scroll over time with a moving window over the function.

About

Simple C++ class for quick & easy real-time plotting via a pipe to gnuplot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages