Skip to content

norwegian-geotechnical-institute/mpldxf-NGI

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

The package can be cloned and installed using poetry:

Usage

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

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

Then, you can save a figure as a DXF file:

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.

About

A fork of a matplotlib backend for DXF

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%