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

  • Eight built-in utility models

    Cobb-Douglas, Leontief, Perfect Substitutes, CES, Translog, Satiation, Quasi-Linear, and Stone-Geary — 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

  • Multi-panel teaching figures

    Build side-by-side, stacked, and grid layouts with Figure, then combine budget lines, indifference curves, and equilibria across panels.

    Figures & demand diagrams

  • Demand-path diagrams

    Generate PricePath, IncomePath, and linked DemandDiagram views for PCC, ICC, and Marshallian-demand teaching graphics.

    Figures & demand diagrams

  • 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, papers, and the web.

    Export formats

  • Animated GIF sweeps

    Render parameter, price, and income animations with Animator, including budget-only teaching sweeps for notebook demos and web docs.

    Animation

  • Notebook widgets

    Use WidgetViewer in Jupyter with a slider plus numeric input for each parameter, so students can drag or type exact values.

    Interactive widgets

  • Analysis helpers

    Compute comparative statics, Slutsky matrices, and inspect homogeneity, Euler's theorem, homotheticity, and demand degree-0 behaviour.

    Analysis tools

  • 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 and print closed-form Marshallian demand formulas with solve-tex.

    CLI reference

Install

pip install econ-viz

Requires Python 3.10 or later.

Comments