Metadata-Version: 2.4
Name: Matlabfigexporter
Version: 0.0.2
Summary: Export Matplotlib figures directly to editable native MATLAB .fig files using the MATLAB Engine API.
Author: Aditya Kumar
Maintainer: Aditya Kumar
License: MIT
Project-URL: Homepage, https://github.com/adityak1911/Matlabfigexporter
Project-URL: Repository, https://github.com/adityak1911/Matlabfigexporter
Project-URL: Documentation, https://github.com/adityak1911/Matlabfigexporter#readme
Project-URL: Issues, https://github.com/adityak1911/Matlabfigexporter/issues
Project-URL: Releases, https://github.com/adityak1911/Matlabfigexporter/releases
Project-URL: Changelog, https://github.com/adityak1911/Matlabfigexporter/releases
Keywords: matlab,matplotlib,matlab-engine,figure,fig,plot,plotting,visualization,scientific,engineering,python,graph,graphics,export,converter,scientific-computing,data-visualization,matlab-figure,figure-export,matplotlib-export
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: matplotlib>=3.5
Provides-Extra: matlab

# Matlabfigexporter

> Export **Matplotlib** figures directly to **editable native MATLAB `.fig` files** using the MATLAB Engine API.

[![PyPI](https://img.shields.io/pypi/v/Matlabfigexporter)](https://pypi.org/project/Matlabfigexporter/)
[![Python](https://img.shields.io/pypi/pyversions/Matlabfigexporter)](https://pypi.org/project/Matlabfigexporter/)
[![License](https://img.shields.io/github/license/adityak1911/Matlabfigexporter)](LICENSE)

## Overview

`Matlabfigexporter` is a lightweight Python package that allows you to export Matplotlib figures as **native MATLAB `.fig` files**.

Unlike PNG, SVG, PDF, or EPS exports, the generated `.fig` file remains fully editable in MATLAB. Titles, axes, legends, labels, and other plot elements can be modified using MATLAB's Figure Editor.

The package is designed for researchers, engineers, students, and scientists who work with both Python and MATLAB.

---

## Features

* Export Matplotlib figures directly to native MATLAB `.fig`
* Familiar Matplotlib-style API
* Editable figures in MATLAB
* Automatic detection of the MATLAB Engine
* Automatic MATLAB Engine installation attempt (if supported)
* Lightweight and easy to use
* Open source
* Windows support (tested)
* Tested with MATLAB R2026

---

## Installation

Install from PyPI:

```bash
pip install Matlabfigexporter
```

---

## Requirements

* Python 3.8+
* MATLAB installed
* MATLAB Engine for Python

If the MATLAB Engine is not available, `Matlabfigexporter` will attempt to install it automatically when first imported. If automatic installation is unsuccessful, a clear error message is displayed with instructions for manual installation.

---

## Quick Start

```python
from Matlabfigexporter import plt

x = [1, 2, 3, 4]
y = [1, 4, 9, 16]

plt.figure(figsize=(6,4))
plt.plot(x, y, linewidth=2, label="y = x²")

plt.title("Example Figure")
plt.xlabel("X")
plt.ylabel("Y")
plt.legend()
plt.grid(True)

plt.savefig("example.fig")
```

Open the figure in MATLAB:

```matlab
openfig("example.fig")
```

---

## Why use Matlabfigexporter?

Normally, Matplotlib exports figures as image or vector formats:

* PNG
* JPG
* SVG
* PDF
* EPS

These formats are **not editable** as MATLAB figures.

`Matlabfigexporter` creates a **native MATLAB `.fig`** that can be opened and modified just like figures created inside MATLAB.

---

## Typical Use Cases

* Scientific publications
* Engineering reports
* Signal processing
* Control systems
* Machine learning visualization
* Optical communication research
* Data analysis
* Academic research
* MATLAB/Python interoperability

---

## Example Workflow

```
Matplotlib
      │
      ▼
Matlabfigexporter
      │
      ▼
Native MATLAB .fig
      │
      ▼
Open & Edit in MATLAB
```

---

## Compatibility

| Component    | Status   |
| ------------ | -------- |
| Windows      | ✅ Tested |
| Linux        | Planned  |
| macOS        | Planned  |
| MATLAB R2026 | ✅ Tested |

---

## Project Structure

```
Matlabfigexporter/
│
├── src/
├── examples/
├── tests/
├── README.md
├── LICENSE
└── pyproject.toml
```

---

## Roadmap

Planned improvements include:

* Linux support
* macOS support
* Additional Matplotlib artist support
* Improved compatibility with future MATLAB releases
* More examples and documentation
* Automated testing

---

## Contributing

Contributions, feature requests, and bug reports are welcome.

If you find a bug or have an idea for an improvement, please open an issue or submit a pull request.

GitHub Issues:

https://github.com/adityak1911/Matlabfigexporter/issues

---

## Citation

If this package is useful in your research, consider citing the GitHub repository or linking to the PyPI project.

---

## Author

**Aditya Kumar**

GitHub:

https://github.com/adityak1911/Matlabfigexporter

PyPI:

https://pypi.org/project/Matlabfigexporter/

---

## License

This project is licensed under the MIT License.

---

## Support

If you encounter any issues or have suggestions for new features, please open an issue on GitHub.

Feedback and contributions are always appreciated.
