Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pylexis-0.0.4.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

pylexis-0.0.4-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file pylexis-0.0.4.tar.gz.

File metadata

  • Download URL: pylexis-0.0.4.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

Hashes for pylexis-0.0.4.tar.gz
Algorithm Hash digest
SHA256 74e32ccd80c13d31e69b2bb82fb65ded208367191d4d720642448ae15ab456f1
MD5 56eeeed2e63689bcffcbe400b93df684
BLAKE2b-256 d58990786c1522fd03b558b795ccf31b3205e011aaa5c3238ee24582855d43d1

See more details on using hashes here.

File details

Details for the file pylexis-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: pylexis-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 2.7 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

Hashes for pylexis-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e2a11d9d10959aeb9ec37e30e53aad67904c9c69189bca65962371b65dd2a02e
MD5 2c4c86c614d1b46569faa3838db9c380
BLAKE2b-256 01130d86f99d9e15429f706b00e0fd57286186867d85548c8672c44b512aaae3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page