Metadata-Version: 2.4
Name: mpldxf
Version: 1.0.6
Summary: A fork of mpldxf - a matplotlib backend to write DXF drawings. Modified by NGI to handle geotechnical plots
Keywords: matplotlib,DXF,CAD
Author: David Kent, Jon-Michael Josefsen, Ingeborg Gjerde
Author-email: Jon-Michael Josefsen <jmj@ngi.no>, Ingeborg Gjerde <ingeborg.gjerde@ngi.no>
License-Expression: MIT
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: ezdxf>=1.3,<2
Requires-Dist: matplotlib>=3.9.2,<4
Requires-Dist: shapely>=2.0.6,<3
Requires-Dist: svgpathtools>=1.6.1,<2
Requires-Python: >=3.12, <4
Project-URL: Homepage, https://github.com/norwegian-geotechnical-institute/mpldxf-NGI
Project-URL: Repository, https://github.com/norwegian-geotechnical-institute/mpldxf-NGI
Description-Content-Type: text/markdown

# 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](http://bitbucket.org/mozman/ezdxf)

## Installation of dependencies

The package dependencies can be installed with uv

```bash
uv sync --upgrade
source .venv/bin/activate
```

## Usage

To use this backend, you first need to register it with Matplotlib:

```python
import matplotlib
from mpldxf import FigureCanvasDxf
matplotlib.backend_bases.register_backend('dxf', FigureCanvasDxf)
```

Then, you can save a figure as a DXF file:
```python
from matplotlib import pyplot as plt
plt.plot(range(10))
plt.savefig('myplot.dxf')
```


## 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.
