Coder Social home page Coder Social logo

gnuplot's Introduction

Gnuplot extension for Sphinx

Author: Vadim Gubergrits <[email protected]>

About

This extensions allows rendering of plots using the gnuplot language.

This extensions adds the gnuplot directive that will replace the gnuplot commands with the image of the plot.

Quick Example

This source:

.. gnuplot::
    :title: The sine function

    plot sin(x)

is rendered as:

.. gnuplot::
    :title: The sine function

    plot sin(x)



Requirements

Gnuplot should be installed and be in the system's path.

Installing from sphinx-contrib checkout

Checkout sphinx-contrib:

$ hg clone https://bitbucket.org/birkenfeld/sphinx-contrib/

Change into the gnuplot directory:

$ cd sphinx-contrib/gnuplot

Install the module:

$ python setup.py install

Enabling the extension in Sphinx

Just add sphinxcontrib.gnuplot to the list of extensions in the conf.py file. For example:

extensions = ['sphinxcontrib.gnuplot']

Usage

Options

size: X,Y
Width and height of the resulting plot.
title: <TITLE>
set the plot title to TITLE. Equivalent to "set title TITLE".

Configuration

For now one optional configuration is added to Sphinx. It can be set in conf.py file:

gnuplot_fromat <dict>:

image format used for the different builders. latex and html fromats are supported.

For example:

gnuplot_format = dict(latex='png', html='png')

These are the actual defaults.

Plotting data files

Gnuplot is instructed to change its working directory to the document base directory. When referencing data files in gnuplot they must be relative to the document.

To provide a link to the data source you can use Sphinx standard download role:

.. gnuplot::

   plot 'data.dat' using 1:2

The source is :download:`here <data.dat>`.

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.