Git Product home page Git Product logo

yapl's Introduction

logo

Yet Another Plot Library

This is my attempt to create simple plot library for C++. Especially one that is willing to work on Raspberry Pi devices on arm64 OS.

Note

This library will not display any plots. It can only save them to .png

But Why?

Why to choose this library when you can use python and all it goodness like matplotlib?

Well.. I also do not know. But maybe when writing somethig that need to work without any other programs like amazing gnuplot, running on constrained hardware resources system maybe it is worth checking out on this something.

Example

#include "yapl.hpp"
#include <iostream>

int main() {
    try {
        yapl::Plot plot;
        plot.addData({10, 50, 30, 10}, {10, 90, 50, 90});
        plot.addData({80, 120, 160, 140, 100}, {10, 90, 10, 50, 50});
        plot.addData({190, 190, 240, 240, 190}, {10, 90, 90, 50, 50});
        plot.addData({270, 270, 320}, {90, 10, 10});
        plot.grid(true);
        plot.xLabel("X value");
        plot.yLabel("Y value");
        plot.title("Yet Another Plot Library");
        plot.setLabelMaker([](double val) -> std::string {
            return "X: " + std::to_string((int)val);
        });
        plot.save("/YAPL/img/test/example_plot.png", 800, 600);
    }
    catch (const yapl::Exception& e) {
        std::cout << "Caught error during plot generation" << std::endl;
    }
    return 0;
}

output

Documentation

To run documentation just use:

cd docs && mkdocs serve

Dependencies

License

This software is released under GPLv2+ license.

yapl's People

Contributors

szymon423 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.