Quickly and easily draw basic Lexis diagrams
Project description
PyLexis
PyLexis
is a tool to easily plot Lexis Diagrams within Python. It is based on matplotlib
and inspirated in
LexisPlotR.
What is a Lexis Diagram?
In demography a Lexis diagram (named after economist and social scientist Wilhelm Lexis) is a two dimensional diagram that is used to represent events (such as births or deaths) that occur to individuals belonging to different cohorts. Calendar time is usually represented on the horizontal axis, while age is represented on the vertical axis. (https://en.wikipedia.org/wiki/Lexis_diagram)
Installation
Using PyLexis
First import the package and create a Diagram object with the following arguments:
- initial year
- final year
- first age
- last age
import pylexis
diagram = pylexis.Diagram(1910, 1920, 0, 10)
Then you have a few methods to interact with the graph:
Diagram.lexis_fill(target, value, color)
Highlight a certain age, year or cohort in the grid.
Parameters
----------
target: {'age', 'year' or 'cohort'}
value : int with the value of the target selected.
color: str with the colour to fill.
Diagram.titles(x_label, y_label, title)
Diagram.add_births(year, value)
Diagram.add_deaths(year, value)
FAQ
Just ask me what you need!
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
File details
Details for the file pylexis-0.0.2.tar.gz
.
File metadata
- Download URL: pylexis-0.0.2.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.0.1 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5dddbf83667593062a5b25325f23e0fa410a21e85c2d58b98e98cad18138c0a |
|
MD5 | 1de1a863ce1f96e6402149b1ad920e11 |
|
BLAKE2b-256 | 5703c124c236b444d3dd277e355c8d1316b6f5316a0b7c0fb45cfae0b11ba0b2 |
File details
Details for the file pylexis-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: pylexis-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.0.1 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54627acd03a6991d603dd9250d178c50eb5d8969370b0c86021ce2d0827eab55 |
|
MD5 | 513a454a488d15999bf0ccc80e386b61 |
|
BLAKE2b-256 | 0e5a81c9831e8e7c3ece5e185474b490cbdda314f86c84d371422e047c9e2d26 |