https://github.com/mandarancio/plotty
C++/GTK3 simple plot and math library
https://github.com/mandarancio/plotty
eigen fft gtk images math matrix plot
Last synced: about 2 months ago
JSON representation
C++/GTK3 simple plot and math library
- Host: GitHub
- URL: https://github.com/mandarancio/plotty
- Owner: Mandarancio
- License: gpl-3.0
- Created: 2017-09-11T14:30:47.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-14T12:01:28.000Z (almost 9 years ago)
- Last Synced: 2025-03-15T00:14:01.798Z (over 1 year ago)
- Topics: eigen, fft, gtk, images, math, matrix, plot
- Language: C++
- Size: 622 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: NEWS
- Contributing: CONTRIBUTING.md
- License: COPYING
Awesome Lists containing this project
README
# Plotty: a simple C++/GTK3 plot and math lib
Author: Martino Ferrari
## Features
Current fetures includes:
- Simple plot with color, line and point style customization
- Simple matrix viewer with different color map useful for images
- Scale, label, grid customization, multiple figure
- Export in PNG and PDF (vectorial)
- Integration with Eigen3 C++ library, for fast matrix operations
- Basic mathematics operation and function supported
- FFT/IFFT and FFT2/IFFT implementation using FFTW3 library
- Support of many image formats using CImg library
## Build the library
To build the library simply type:
```bash
cmake .
make
```
The dependencies are: gtkmm, cairomm, eigen, fftw, cimg.
## Examples
To compute and plot a simple signal is quite simple:
```c++
#include "plotty.h"
#include "math.h"
#include
#include
int main(int argc, char** argv)
{
auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
// create linear space to use as x vector
Eigen::VectorXd x = m::linspace(-1, 1, 100);
// compute a gaussian
Eigen::VectorXd gauss = m::exp(-(m::pow(x,2)));
// create the window figure
Figure f;
// plot the data
f.plt.plot(x, gauss, GREEN, 1.5, LS_DOTS_KEY, PS_DIAMOND, "gauss");
// show the legend
f.plt.legend();
return app->run(f);
}
```
Few more examples are located in the folder examples of the project.
## Screenshots
A simple plot:

2D Image:

Magnetude of the 2D fft of the image:
