Coder Social home page Coder Social logo

afcarl / ipython-tikzmagic Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mkrphys/ipython-tikzmagic

0.0 1.0 0.0 165 KB

IPython magics for generating figures with TikZ

License: BSD 3-Clause "New" or "Revised" License

Python 9.04% Jupyter Notebook 90.96%

ipython-tikzmagic's Introduction

ipython-tikzmagic

IPython magics for generating figures with TikZ. You can select the output format as svg, png or jpg, define the image size, specify a scale factor, load TikZ packages, and save to external files. The accompanying IPython notebooks shows some examples demonstrating how to use these features.

The package requires a working LaTeX installation, ImageMagick and pdf2svg.

Installation

pip install git+git://github.com/mkrphys/ipython-tikzmagic.git

Usage

Load package by writing

%load_ext tikzmagic

in a notebook cell. Call tikz by prepending %tikz to a single command, e.g.,

%tikz \draw (0,0) rectangle (1,1);

or by starting a cell with %%tikz, e.g.,

%%tikz
\draw (0,0) rectangle (1,1);
\filldraw (0.5,0.5) circle (.1);

Optional Arguments

  • -sc or --scale: scaling factor of plots, default=1
  • -s or --size: pixel size of plots, e.g., -s width,height, default=400,240
  • -f or --format: plot format (png, svg or jpg), default=png
  • -e or --encoding: text encoding, default=utf-8
  • -x or --preamble: LaTeX preamble to insert before tikz figure, default=None
  • -p or --package: LaTeX packages to load, separated by comma, e.g., -p pgfplots,textcomp, default=None
  • -l or --library: TikZ libraries to load, separated by comma, e.g., -l matrix,arrows, default=None
  • -S or --save: save a copy to file, e.g., -S filename, default=None

Example

IPython example notebook

ipython-tikzmagic's People

Contributors

michakraus avatar mkrphys avatar davidpowell avatar joelkim avatar ceshine avatar hblanks avatar jluttine avatar goerz avatar

Watchers

James Cloos 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.