ltrujello / Tikz-Python

An object-oriented Python approach towards providing a giant wrapper for Tikz code, with the goal of streamlining the process of creating complex figures for TeX documents.
https://ltrujello.github.io/Tikz-Python
MIT License
16 stars 2 forks source link

Tikz-Python

An object-oriented Python approach towards providing a giant wrapper for Tikz code, with the goal of streamlining the process of creating complex figures for TeX documents.

To install it, run

pip install tikz-python

Documentation

We have documentation now! Please visit the documentation site.

Examples

Want to see some nice examples of what this package can do? See here.

How to Use: Basics

An example of this package in action is below.

from tikzpy import TikzPicture  # Import the class TikzPicture

tikz = TikzPicture()
tikz.circle((0, 0), 3, options="thin, fill=orange!15")

arc_one = tikz.arc((3, 0), 0, 180, x_radius=3, y_radius=1.5, options="dashed")
arc_two = tikz.arc((-3, 0), 180, 360, x_radius=3, y_radius=1.5)

tikz.show()  # Displays a pdf of the drawing to the user

which produces

We explain line-by-line the above code.