graph2img: convert a graph to a png file.
Project description
Prerequisite
xelatex
and pdf2svg
. Installation on Linux:
# Ubuntu
sudo apt-get install texlive-xetex
sudo apt-get install poppler-utils
# CentOS
yum install texlive-xetex
yum install poppler-utils
For Windows, you only need to install texlive directly.
Installation by pip
Install with pip:
pip install graph2img
Then write your edge information into graph.txt
. For example:
1 2 1
2 3 2
1 3 3
This will return a triangular graph.
Then run the program:
graph2img graph.txt
This will return a file graph.png
:
Or to draw a tree:
1 2 1
1 3 2
2 4 2
2 5 3
3 6 3
3 7 2
1 9 1
2 8 2
This will return a tree:
Options
Several options are provided: Three options are provided:
--save-temp-files=true/false
--temp-path=[path]
--output-format=png/svg
--output-file=[path]
--show=true/false
If you want to save the temporary files (like tex codes), set --save-temp-files
as true
;
If you want to generate a svg format image, set -output-format
as svg
;
If your system does not have a user interface, set --show
as false
.
Installation from source
git clone https://github.com/ForwardStar/graph_drawer.git
cd graph_drawer
python setup.py install
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 graph2img-1.2.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3661a0ab1d1b5b2b2e1ab25c579091bb57d01e9078b6bf1e4a4d3a4a0474648a |
|
MD5 | b0d5ecc248990d7845e5d6817a744505 |
|
BLAKE2b-256 | 87ca2d46c1d5db7854d9a7c0140549feeab831444fff6f0b91d2dbe7400e6eeb |