Personal graph drawing library with high-level abstraction of python-matplotlib
- Dependent package: numpy, matplotlib
apt-get install python-numpy python-matplotlib
Mac may already have built-in python binary and matplotlib
- Library constitution
- Front-end Parser
- Middle-end specifier
- Back-end plotter
Top(or test) module to draw graphs using ep.py APIs User should denote specification of data layout and graph's layout.
- Supported graph type
- Line (line-key, line-raw, line-flat)
- Normalized line (line-norm)
- Clustered Bar (bar-clustered, bar-key-clustered)
- Normalized Clustered Bar (bar-norm-clustered, bar-key-clustered)
- Clustered Clustered Bar (bar-key-cc)
- Stacked Bar (bar-stacked, bar-clustacked)
- Box (box-key, box-time, box-multi-time)
- Clustered Box (jaws-all, jaws)
- Pie (jaws-pie)
- Multiple subplot (Not yet)
- CDF (Not yet)
- etc...
- Line (line-key, line-raw, line-flat)
ref. "jaws-*" examples can be also tested with "draw.sh" styles
-
./examples.py -i [input] [attributes ...]
- ./examples.py -i dat/line.dat -s line-key
- ./examples.py -i dat/line-norm.dat -s line-norm
- ./examples.py -i dat/bar-clustered.dat -s bar-clustered
- ./examples.py -i dat/bar-clustered.dat -s bar-norm-clustered
- ./examples.py -i dat/bar-key-cc.dat -s bar-key-cc
6-1) ./examples.py -si atax -s bar-stacked
6-2) ./examples.py -s bar-clustacked - ./examples.py -i dat/box.dat -s box-key
- ./examples.py -i dat/box.dat -s box-time
- ./examples.py -i dat/jaws/atax.share.log -s jaws-pie
- ./examples.py -i dat/line.dat -s line-key
-
Sub attributes
- -f data format
- -o output name
- -t title
- -xl xlabel
- -yl ylabel
- -lw figure width
- -lh figure height
Front-end parser class module. PatternParser class parses data with row(\n:newline) and col(denoted key). The class receives raw text string as an input of the constructor.
And then, ParseKeyWith and ParseWith methods parses data and special key respectively. Special key is used as a identifier when grouping correlated data with tools.py.
Users must modify this codes to adapt their customized data with helper methods as mentioned.
Some of data manipulation tools are defined in this file. To draw graph, user must inform the program of specific information, say, postion of xlabel, which row's data be used as legend, and so on. This kind of meta data can be abstracted with Group class in tools.py. Middle-end data specification process can be written by these tools.
Set of graph drawing class with grouped meta data which mid-end specified already. Because, program cannot know which of graph styles the programmer wants to draw, all styles of classes must be defined case by case. Here are the list of classes.
- LinePlotter
- BoxPlotter (Timeline)
- CBoxPlotter (Clustered timeline)
- BarPlotter
- CBarPlotter (Clustered Bar)
- CCBarPlotter (Double-Clustered Bar)
- SBarPlotter (Stacked Bar)
- PiePlotter