Skip to content

Home

Econ-Viz

A Python toolkit for producing publication-quality microeconomics diagrams.

Publish Coverage PyPI Python


Documentation: https://econ-viz.org

Source Code: https://github.com/EconViz/econ-viz


from econ_viz import Canvas, levels, solve
from econ_viz.models import CobbDouglas

model = CobbDouglas(alpha=0.5, beta=0.5)
eq    = solve(model, px=2.0, py=3.0, income=30.0)
lvls  = levels.around(eq.utility, n=5)

cvs = Canvas(x_max=20, y_max=15, title=r"Cobb-Douglas $x^{0.5} y^{0.5}$")
cvs.add_utility(model, levels=lvls)
cvs.add_budget(2.0, 3.0, 30.0, fill=True)
cvs.add_equilibrium(eq, show_ray=True)
cvs.save("cobb_douglas.png")

Features

  • Six built-in utility models

    Cobb-Douglas, Leontief, Perfect Substitutes, CES, Satiation, and Quasi-Linear — covering the full range of standard microeconomic preferences.

    Model catalogue

  • Automatic equilibrium solving

    Interior solutions, kinked optima (Leontief), and corner solutions — all handled via SLSQP with no manual setup required.

    Quick Start

  • LaTeX parser

    Pass a LaTeX expression like x^{0.4} y^{0.6} directly and get back a fully-configured model instance.

    LaTeX parsing

  • Publication-ready export

    Save as PNG, PDF, or SVG for presentations, or export TikZ/PGFPlots source to embed directly in LaTeX documents.

    Export formats

  • Advanced models

    Wrap any callable as a utility function, or extend to N goods with 2-D projection via MultiGoodCD.freeze().

    Advanced models

  • CLI

    Generate diagrams from the terminal without writing a single line of Python.

    CLI reference

Install

pip install econ-viz

Requires Python 3.12 or later.