{
  "id": "lorenz-curve",
  "name": "Lorenz curve and Gini coefficient",
  "unit": "macro",
  "unitName": "Unit 3 · Macroeconomics",
  "topic": "Inequality",
  "hl": false,
  "description": "Plot real income-share data as a Lorenz curve. The Gini coefficient is the area between the line of equality and the Lorenz curve (A) divided by the total area under the line of equality (A + B).",
  "keywords": [
    "Lorenz curve",
    "Gini coefficient",
    "income inequality",
    "income distribution",
    "quintile",
    "decile",
    "redistribution",
    "line of equality"
  ],
  "schemaUrl": "https://graphs.lectere.com/api/v1/templates/lorenz-curve",
  "previewUrl": "https://graphs.lectere.com/thumbs/lorenz-curve.svg",
  "editorUrl": "https://graphs.lectere.com/graph/lorenz-curve/",
  "params": [
    {
      "key": "data1",
      "label": "Income shares, poorest → richest (%)",
      "default": "5, 10, 15, 22, 48",
      "help": "Quintile or decile shares separated by commas. They are rescaled to total 100%.",
      "type": "string"
    },
    {
      "key": "name1",
      "label": "Name of curve",
      "default": "Lorenz curve",
      "type": "string"
    },
    {
      "key": "second",
      "label": "Add a second Lorenz curve",
      "default": false,
      "type": "boolean"
    },
    {
      "key": "data2",
      "label": "Second curve income shares (%)",
      "default": "7, 12, 17, 23, 41",
      "type": "string"
    },
    {
      "key": "name2",
      "label": "Name of second curve",
      "default": "After taxes and transfers",
      "type": "string"
    },
    {
      "key": "shade",
      "label": "Shade areas A and B",
      "default": true,
      "type": "boolean"
    },
    {
      "key": "key",
      "label": "Show a key (instead of labels on the curves)",
      "default": true,
      "type": "boolean"
    },
    {
      "key": "smooth",
      "label": "Smooth curve",
      "default": true,
      "type": "boolean"
    },
    {
      "key": "points",
      "label": "Mark data points",
      "default": false,
      "type": "boolean"
    }
  ],
  "defaults": {
    "data1": "5, 10, 15, 22, 48",
    "name1": "Lorenz curve",
    "second": false,
    "data2": "7, 12, 17, 23, 41",
    "name2": "After taxes and transfers",
    "shade": true,
    "key": true,
    "smooth": true,
    "points": false
  },
  "panels": [
    {
      "id": "main",
      "title": null,
      "xLabel": "Cumulative % of population",
      "yLabel": "Cumulative % of income",
      "xRange": [
        0,
        100
      ],
      "yRange": [
        0,
        100
      ],
      "axisKeys": {
        "x": "main:x",
        "y": "main:y"
      }
    }
  ],
  "labels": [
    {
      "key": "main:y",
      "default": "Cumulative % of income",
      "hint": "Vertical axis",
      "panel": "main"
    },
    {
      "key": "main:x",
      "default": "Cumulative % of population",
      "hint": "Horizontal axis",
      "panel": "main"
    },
    {
      "key": "main.a",
      "default": "A",
      "hint": "Shaded area",
      "panel": "main"
    },
    {
      "key": "main.b",
      "default": "B",
      "hint": "Shaded area",
      "panel": "main"
    },
    {
      "key": "main.key-equality-text",
      "default": "Line of perfect equality",
      "hint": "Text",
      "panel": "main"
    },
    {
      "key": "main.key-lorenz1-text",
      "default": "Lorenz curve",
      "hint": "Text",
      "panel": "main"
    }
  ],
  "elements": [
    {
      "key": "main.a",
      "kind": "area",
      "label": "A"
    },
    {
      "key": "main.b",
      "kind": "area",
      "label": "B"
    },
    {
      "key": "main.equality",
      "kind": "curve"
    },
    {
      "key": "main.lorenz1",
      "kind": "curve"
    },
    {
      "key": "main.key-equality",
      "kind": "curve"
    },
    {
      "key": "main.key-equality-text",
      "kind": "text",
      "label": "Line of perfect equality"
    },
    {
      "key": "main.key-lorenz1",
      "kind": "curve"
    },
    {
      "key": "main.key-lorenz1-text",
      "kind": "text",
      "label": "Lorenz curve"
    }
  ],
  "stats": [
    {
      "label": "Gini — Lorenz curve",
      "value": "0.392"
    },
    {
      "label": "Share of poorest group",
      "value": "5%"
    },
    {
      "label": "Share of richest group",
      "value": "48%"
    }
  ],
  "example": {
    "template": "lorenz-curve",
    "params": {
      "data1": "5, 10, 15, 22, 48",
      "name1": "Lorenz curve",
      "second": false,
      "data2": "7, 12, 17, 23, 41",
      "name2": "After taxes and transfers",
      "shade": true,
      "key": true,
      "smooth": true,
      "points": false
    }
  }
}