GithubHelp home page GithubHelp logo

guthmanny / gnuplot_i Goto Github PK

View Code? Open in Web Editor NEW

This project forked from longradix/gnuplot_i

0.0 0.0 0.0 765 KB

A gnuplot interface library written in C.

Home Page: http://www.robert-bradley.co.uk/gnuplot/

License: GNU General Public License v3.0

C 100.00%

gnuplot_i's Introduction

gnuplot C interface library

Overview

The gnuplot_i interface library enables developers to create gnuplots directly from their C programs.

The program works by creating a UNIX pipe through which gnuplot commands are sent and then executed.

The central data structure is the gnuplot control handle, which holds the gnuplot commands as well as technical internal information, such as terminal type, amount of open windows and such.

The plot can be displayed in its own window or otherwise saved as an image file to disk.

Example of a minimal program structure:

#include "gnuplot_i.h"

gnuplot_ctrl *handle = gnuplot_init();
gnuplot_setterm (handle, "wxt", 600, 400);
gnuplot_plot_equation (handle, "sin(x)", "Sine wave");
gnuplot_close (handle);

Provenance

This program was originally developed by Nicolas Devillard (2000) who also placed it in the public domain. Other authors have contributed to this library:

  • Peter Maresh (2010): compile and run on MS-Windows 7/64 using mingw64.
  • Robert Bradley (2004-2006): functional enhancements, see next section.
  • longradix (2023): refactoring, error handling, stylistic improvements, documentation updates.

Enhancements

This interface library features the following enhancements from the original program:

  • 3D plots, using gnuplot_splot (handle, x, y, z, n, "title").
  • Setting z-axis labels with gnuplot_set_axislabel (handle, "z-axis label", "z").
  • Production of colour PostScript files with gnuplot_hardcopy (handle, "graph.ps").
  • Windows support.
  • On OS X, if DISPLAY environment variable is not set or USE_AQUA=1, then aqua is used instead of x11.
  • Plotting of complex structures through the use of callbacks, see gnuplot_plot_obj_xy and gnuplot_splot_obj.
  • Contour plotting with gnuplot_setstyle (handle, "lines") and gnuplot_contour_plot (handle, x, y, z, nx, ny, "title").

If you have any questions or comments, these can be sent to [email protected], or via the website.

Examples

This library comes with the following examples:

  • example.c: a garden variety of gnuplot_i function calls to demonstrate general usage and capabilities.
  • animation.c: a brief animation of a run-time generated sine wave.
  • sinepng.c: a demonstration of how gnuplot_i can be used to store its output as a file.

Compilation instructions are included in each of these examples.

Documentation

A tutorial is available in tutorial.md.

Documentation of macros, includes, functions and prototypes can be straightforwardly generated using doxygen and/or the doxywizard. A Doxyfile is provided for this purpose.

Licensing

This library has been licensed under the GPL, same as all other GNU software, and is therefore less strict than the gnuplot license itself.

gnuplot_i's People

Contributors

longradix avatar rb12345 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.