Matplotlib Backend for DXF
Overview
This is a Matplotlib backend that enables Matplotlib to save figures as DXF drawings. DXF is a drawing format commonly used by Computer-Aided Design (CAD) tools.
This package builds on the ezdxf package by Manfred Moitzi:
ezdxf on Bitbucket
Installation of dependencies
The package dependencies can be installed with uv
uv sync --upgrade
source .venv/bin/activate
Usage
To use this backend, you first need to register it with Matplotlib:
import matplotlib
from mpldxf import backend_dxf
# Matplotlib registration takes a FigureCanvas *class* (no kwargs), so use the
# factory to configure options like subplot sub-blocks.
FigureCanvas = backend_dxf.make_figure_canvas(use_fm_layers=False, use_subplot_blocks=True)
matplotlib.backend_bases.register_backend("dxf", FigureCanvas)
Then, you can save a figure as a DXF file:
from matplotlib import pyplot as plt
plt.plot(range(10))
plt.savefig('myplot.dxf')
Feature flags
mpldxf can optionally write each subplot into its own DXF block (nested under a single main_plot block) to keep modelspace clean and make downstream CAD reuse easier.
- Default: disabled
- Enable (legacy “write directly to modelspace” behavior): pass
use_subplot_blocks=Trueviabackend_dxf.make_figure_canvas(...).
Warning
This package is a work in progress. Not all Matplotlib plot types will render correctly, and text alignment and sizing in particular may require adjustments.
Metadata
Release files for mpldxf 1.0.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mpldxf-1.0.11.tar.gz | 14.2 kB | Without provenance | Details for mpldxf-1.0.11.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mpldxf-1.0.11-py3-none-any.whl | Python 3 | none | any | Details for mpldxf-1.0.11-py3-none-any.whl |
Total release size: 30.3 kB
Release files / mpldxf-1.0.11.tar.gz
| Download URL | mpldxf-1.0.11.tar.gz |
|---|---|
| Size | 14.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
23bd5fb11e8ec98a528dbc9a17e393a3251483b74049bc881ee0ed33846e0b72
|
|
BLAKE2b-256 checksum How to use checksums |
0149b53662f45ef078a17faf7421d30ee99e59ef76616cca8a079e9f4e373723
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / mpldxf-1.0.11-py3-none-any.whl
| Download URL | mpldxf-1.0.11-py3-none-any.whl |
|---|---|
| Size | 16.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
56287d1837003fa6a7dd01bb3401beac73b24b5a57611e470623af89aaa88028
|
|
BLAKE2b-256 checksum How to use checksums |
ac72c674d6c70477f9ca9ab08dae32fea520ed40598b4595437f1cbf827fc0b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for mpldxf 1.0.11
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.