Skip to content

Commit c1fe509

Browse files
committed
docs: Update README
1 parent 8f9526e commit c1fe509

File tree

1 file changed

+17
-22
lines changed

1 file changed

+17
-22
lines changed

README.md

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,34 @@
1+
# MPLLayout
12

23
![Project logo](logo.svg)
34

45
## Summary
56

6-
MPLLayout is a package used to create figure layouts for [matplotlib](https://matplotlib.org/) using geometric constraints.
7+
MPLLayout is a package to create precise figure layouts in [matplotlib](https://matplotlib.org/).
8+
It works by modelling figure elements using geometric primitives (for example, text anchors are points, the figure is a quadrilateral, etc.), then constraining the sizes and positions of these elements using geometric constraints (for example, fixing the width of a figure, constraining axes sides to be collinear, constraining axes to lie on a grid, etc.).
79

8-
MPLLayout can be used to:
10+
Using this approach, MPLLayout can:
911

1012
* align figure elements (axes, text label location, x and y axis, etc.),
1113
* specify margins around axes,
12-
* specify the figure size,
14+
* create templates for figures across different mediums (posters, manuscripts, slides, etc.),
1315
* and more!
1416

15-
## Motivation
17+
## Basic usage
1618

17-
Matplotlib contains several strategies for creating figure layouts (for example, `GridSpec` and `subplots` for grid-based layouts).
18-
These strategies work well, however, they can be insufficient for complex figures or if you want precise placement of figure elements.
19-
To address this, this package uses geometric primitives and constraints to represent and position figure elements.
19+
The tutorial notebook in `examples/tutorial.ipynb` demonstrates the basic usage of the package and explains some of the commonly used geometric constraints.
20+
Other examples are also given in the `examples` folder.
21+
The notebook at `examples/ten_simple_rules_demo.ipynb` contains an interactive demo to recreate a figure from ["Ten Simple Rules For Better Figures"](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1003833) (Rougier, Droettboom and Bourne 2014).
2022

21-
It consists of:
23+
A summary of how to use the package is shown in the figure below.
24+
The process resembles creating and constraining geometry in computer-aided design programs like AutoCAD, SolidWorks, etc.
25+
![Project logo](doc/Summary.svg)
26+
27+
## Motivation
2228

23-
* geometric primitives to represent figure elements (for example, a `Quadrilateral` primitive represents a figure, a `Point` represents a text anchor, etc.),
24-
* geometric constraints to position figure elements (for example, `Collinear` constraints align lines, `Length` constraints fix line lengths, etc.),
25-
* a solver to find primitives that satisfy the constraints,
26-
* and utilities to generate matplotlib figures and axes from the primitives.
29+
Matplotlib contains several strategies for creating figure layouts (for example, `GridSpec` and `subplots` for grid-based layouts).
30+
While these approaches work well, greater control over figure element positions is sometimes desirable;
31+
for example, when preparing figures for published documents, research papers, or slides.
2732

2833
## Installation
2934

@@ -42,16 +47,6 @@ pip install .
4247

4348
The package requires `numpy`, `matplotlib`, and `jax`.
4449

45-
## How to use
46-
47-
The tutorial notebook in `examples/tutorial.ipynb` demonstrates the basic usage of the package and explains some of the commonly used geometric constraints.
48-
Other examples are also given in the `examples` folder.
49-
The notebook at `examples/ten_simple_rules_demo.ipynb` contains an interactive demo to recreate figures from ["Ten Simple Rules For Better Figures"](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1003833) (Rougier, Droettboom and Bourne 2014).
50-
51-
A summary of how to use the package is shown in the figure below.
52-
The process resembles creating and constraining geometry in computer-aided design programs like AutoCAD, SolidWorks, etc.
53-
![Project logo](doc/Summary.svg)
54-
5550
## Contributing
5651

5752
This project is a work in progress so there are likely bugs and missing features.

0 commit comments

Comments
 (0)