Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Render and include figures in Pandoc documents using your plotting toolkit of choice

License

NotificationsYou must be signed in to change notification settings

LaurentRDC/pandoc-plot

Repository files navigation

A Pandoc filter to generate figures from code blocks in documents

license

pandoc-plot turns code blocks present in your documents (Markdown, LaTeX, etc.) into embedded figures, using your plotting toolkit of choice, including Matplotlib, ggplot2, MATLAB, Mathematica, and more.

Overview

This program is aPandoc filter. It can thereforebe used in the middle of conversion from input format to output format,replacing code blocks with figures.

The filter recognizes code blocks with classes that match plottingtoolkits. For example, using thematplotlib toolkit:

#My documentThis is a paragraph.```{.matplotlib}import matplotlib.pyplot as pltplt.figure()plt.plot([0,1,2,3,4], [1,2,3,4,5])plt.title('This is an example figure')```

Putting the above ininput.md, we can then generate the plot and embedit in an HTML page:

pandoc --filter pandoc-plot input.md --output output.html

The resultingoutput.html looks like this:

<h1id="my-document">My document</h1><p>This is a paragraph.</p><figure><imgsrc="plots\9671478262050082276.png"/></figure>

Supported toolkits

pandoc-plot currently supports the following plotting toolkits(installed separately):

  • matplotlib: plots using thematplotlibPython library;
  • plotly_python : plots using theplotly Python library;
  • plotly_r: plots using theplotly Rlibrary
  • matlabplot: plots usingMATLAB;
  • mathplot : plots usingMathematica;
  • octaveplot: plots usingGNUOctave;
  • ggplot2: plots usingggplot2;
  • gnuplot: plots usinggnuplot;
  • graphviz: graphs usingGraphviz;
  • bokeh: plots using theBokeh visualization library;
  • plotsjl: plots using theJuliaPlots.jl package;
  • plantuml: diagrams using thePlantUML software suite;
  • sageplot: plots using theSage software system;
  • d2: plots usingD2;
  • asymptote: plots usingAsymptote;
  • mermaid: plots using theMermaidJS.

To know which toolkits are useable onyour machine (and which ones arenot available), you can check with thetoolkits command:

pandoc-plot toolkits

Wish your plotting toolkit of choice was available? Pleaseraise anissue!

Documentation

You can find more information in the documentation, available either in thesource repository fileMANUAL.md, on thewebpage, or via the commandpandoc-plot --manual.

Installation

Binaries and Installers

Latest release

Windows, Linux, and Mac OS binaries are available on theGitHub releasepage. There arealso Windows installers.

conda

Conda Version

Likepandoc,pandoc-plot is available as a package installable withconda.Click here to see thepackage page.

To install in the current environment:

conda install -c conda-forge pandoc-plot

Homebrew

homebrew version

pandoc-plot is available as a package viaHomebrew.Click here to see the package page.

To install:

brew install pandoc-plot

winget

You can installpandoc-plot from theWindows PackageManagerwinget (just likepandoc). To install:

winget install pandoc-plot

From Hackage/Stackage

Hackage version

pandoc-plot is available onHackage andStackage. Usingthecabal-install tool:

cabal updatecabal install

From source

Building from source can be done usingcabal:

git clone https://github.com/LaurentRDC/pandoc-plotcd pandoc-plotcabal install# Alternatively, `stack install`

Sponsor this project

    Contributors3

    •  
    •  
    •  

    [8]ページ先頭

    ©2009-2025 Movatter.jp