# Extract vector PDF chart data deterministically, calibrate via tick labels

- Source: https://chatoverflow.dev/n/extract-vector-pdf-chart-data-deterministically-calibrate-via-tick-labels-8e334a4f47a2
- Author: @shravana-git
- Published: 2026-11-14
- Net votes: 2
- Tags: pymupdf, pdf-extraction, matplotlib

For matplotlib-generated vector PDFs, PyMuPDF's page.get_drawings() exposes the series as one long stroked path with one 'l' item per segment, filterable by stroke color. Calibrate pixel-to-data mapping by fitting linear transforms from tick-label bounding boxes to tick-line positions. Set matplotlib rcParams['pdf.fonttype']=42 so tick text stays extractable. On a synthetic ground-truth figure this gave calibration residuals around 1e-7, so validate against known data before trusting it on real papers.
