Class tikzpy (main class object)
Load main tikzpy class as follow:
1import tikzpy
2
3### Load main object
4tikZ = tikzpy.pytikz()
and start bulding yor drawing.
Class -> tikzpy
- class tikz_py.pytikz[source]
Python class to build your tikZ drawings
- Platform
Unix, Windows
- Synopsis
Python class to build your tikZ drawings
- Variables
dpi=300 – dots per inch property of the drawings
extension=".tikz.tex" – extension property use to build TikZ drawings
description – drawing header description, by default “Created with tikzpy”
unit="" – general units use in TikZ drawing, no units by default
scale=1. – scale value of the TikZ drawing
scale_text=1. – scale value for the nodes text the TikZ drawing
rot_x=0. – angle (in degrees) through which the coordinate frame is rotated about the x axis
rot_y=0. – angle (in degrees) through which the coordinate frame is rotated about the y axis
rot_z=0. – angle (in degrees) through which the coordinate frame is rotated about the z axis
- save_eps(path, name)[source]
- Synopsis:
Save TikZ drawing as a eps file for visualization purposes
File is save with .tikz.eps extension
- Args:
path: path to directory where the pdef files will be save
name: name of the eps file to be save
- Returns:
route: the complete path to the eps file
Note
Dependent on the local latex instalation, use latex to dvi and dvips to eps (ubuntu: apt-get install texlive-full / windows: miktex.org)
See example
- save_pdf(path, name, as_png=True, as_eps=True)[source]
- Synopsis:
Save TikZ drawing as a pdf file for visualization purposes
File is save with .tikz.pdf extension
- Args:
path: path to directory where the pdef files will be save
name: name of the pdf file to be save
- Optional parameters:
as_png = True: convert the pdf to a png file
as_eps = True: convert the pdf to a eps file
- Returns:
route_pdf: the complete path to the pdf file
Note
Dependent on the local latex installation, use pdflatex to generate a pdf (ubuntu: apt-get install texlive-full / windows: miktex.org)
To save pdfs as png files requires ImageMagick to be installed (also ghostscript in Windows), uses convert command
To save pdfs as eps pdftops is used
See example
- save_tikz_stanalone(path, name)[source]
- Synopsis:
Save TikZ drawing as a TikZ file, including the necessary headers
File is save with .tikz.tex extension
- Args:
path: path to directory where the pdef files will be save
name: name of the tikz format file to be save
- Returns:
route: the complete path to the output file
Note
See example
- save_tikz(path, name)[source]
- Synopsis:
Save TikZ drawing as a TikZ file, without the headers, ready to be embedded in latex
File is save with .tikz.tex extension
- Args:
path: path to directory where the pdef files will be save
name: name of the tikz format file to be save
- Returns:
route: the complete path to the output file
Note
See example