liesun1994 / DrawGrayScale

DrawGrayScale

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DrawGrayScale

Setting up the repository

requirements:

  1. python 2.7
  2. matplotlib
  3. pillow & ipyton (not necessary)

Data format

  1. Chinese
Chinese

  1. English
English

  1. Alignment
Alignment

DrawGrayScale Usage

linux usage (x for input y for output utf-8 file)

add auto-fill owing to alignment (add eos symbol)
python drawgrayscale_linux.py  ./data/x.file  ./data/y.file  ./data/ailgn.file  ./data/fileout 

windows usage

python drawgrayscale.py  ./data/file.ch  ./data/file.en  ./data/file.align  ./data/fileout 

Examples

With the data provided, you can get an image as follows:

GrayScale

Tips

Windows_Tips

if you want to draw a picture with Chinese characters, as in drawgrayscale.py(line 70), links are listed: solution1, solution2, solution3
or just move font/simhei.ttf to $PYTHON_PATH\Lib\site-packages\matplotlib\mpl-data\fonts\ttf (windows only)

Linux_tips

if you want to draw a picture with Chinese characters on top of linux, as in drawgrayscale_line.py(line 15), you may change the path to your own Chinese character path. links are listed as follows: solution_linux

About

DrawGrayScale


Languages

Language:Python 99.7%Language:xBase 0.3%