Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cmake_minimum_required(VERSION 3.9)
project(plotpipe)

# set(CMAKE_CXX_STANDARD 11)

set(SOURCE_FILES
main.cpp)

add_executable(plotpipe ${SOURCE_FILES})
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ 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.
Right now it's just a simple header file **graph.h** 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.

Expand All @@ -28,3 +28,15 @@ Here's how it's used:
}

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

### Example

```bash
git clone https://github.com/jal278/plotpipe.git
cd plotpipe/
mkdir build
cd build
cmake ..
make
./plotpipe
```
17 changes: 17 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#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;
}