Skip to main content

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.

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.

  • from tikzpy import TikzPicture imports the TikzPicture class from the tikzpy package.

  • The second line of code is analogous to the TeX code \begin{tikzpicture} and \end{tikzpicture}. The variable tikz is now a tikz environment, specifically an instance of the class TikzPicture, 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tikz_python-0.0.3.tar.gz (24.8 kB view details)

Uploaded Source

Built Distribution

tikz_python-0.0.3-py3-none-any.whl (29.5 kB view details)

Uploaded Python 3

File details

Details for the file tikz_python-0.0.3.tar.gz.

File metadata

  • Download URL: tikz_python-0.0.3.tar.gz
  • Upload date:
  • Size: 24.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.6

File hashes

Hashes for tikz_python-0.0.3.tar.gz
Algorithm Hash digest
SHA256 e1b6a1999093ec366d0e0d3486379bf7dbb8256e9b769416d2a8d54319c00990
MD5 7230187b4f50e5b0f1fbb00578ec866d
BLAKE2b-256 05e8e9ab80f34fa1e881e1c67c38ce9c797a7241d0c3ea4905c2f453c73d604b

See more details on using hashes here.

File details

Details for the file tikz_python-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: tikz_python-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 29.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.6

File hashes

Hashes for tikz_python-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f10ee36628e4cd1344b4f9f9c8927c12a894e9563467fb435f2ed85c2985b3e4
MD5 22c1eda6e1c1d05deb7258adee4efb56
BLAKE2b-256 3fbe40047dd2665e4288e82848eea6e54757efa9fd4149b4631119fe756f36a5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page