A python wrapper for tikz
Project description
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.
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.
-
from tikzpy import TikzPictureimports theTikzPictureclass from thetikzpypackage. -
The second line of code is analogous to the TeX code
\begin{tikzpicture}and\end{tikzpicture}. The variabletikzis now a tikz environment, specifically an instance of the classTikzPicture, and we can now append drawings to it. -
The third, fourth, and fifth lines draw a filled circle and two elliptic arcs, which give the illusion of a sphere.
-
In the last line, the call
show()immediately displays the PDF of the drawing to the user.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for tikz_python-0.0.2-py3-none-any.whl
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | 0a52b28fc37689a11b83c060cdac529d87a40679d70966ca262b9615d3c02c3b |
|
| MD5 | fb2b465bebe58eacc48c208fc8dea28c |
|
| BLAKE2b-256 | e13a7beb32c31c1775faae0a378ea3e764afe177dd814b28bccae14943313a0f |