Skip to content

Commit 3d636b0

Browse files
authored
Merge pull request #45 from Gurnek/update_readme
Update README to current state of project
2 parents 3b77808 + 3a2d8d2 commit 3d636b0

File tree

5 files changed

+19
-11
lines changed

5 files changed

+19
-11
lines changed

README.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ organize _matplotlib_ plots using different **grid strategies**.
1111

1212
## Abstract
1313

14-
This package would add a mechanism for creating a grid of
14+
This package adds a mechanism for creating a grid of
1515
subplots based on the number of axes to be plotted and
1616
a strategy for how they should be arranged, with some
1717
sensible strategy as the default.
@@ -31,25 +31,24 @@ how many axes they want to plot, and they would
3131
get back a collection of axes arranged according
3232
to their strategy.
3333

34-
A proof of concept was implemented for the 'squarish'
35-
strategy, which arranges plots in alternating rows
36-
of `x` and `x-1` objects. Some examples featuring this
37-
technique:
34+
The SquareStrategy alternates rows of x and x-1 columns
35+
to get as close as possible to a square shape for the plots.
36+
Some examples featuring this technique:
3837

39-
<img src="https://gist.github.com/pganssle/afde3d9ae1e9f1d9349cff4a00ddead0/raw/b82d5c2fa3ab34579cfdd4e28be058230fdde199/grid_arrangement06.png" width="300" alt="n=6"> <img src="https://gist.github.com/pganssle/afde3d9ae1e9f1d9349cff4a00ddead0/raw/b82d5c2fa3ab34579cfdd4e28be058230fdde199/grid_arrangement07.png" width="300" alt="n=7">
38+
<img src="images/grid_arrangement06.png" width="300" alt="n=6"> <img src="images/grid_arrangement07.png" width="300" alt="n=7">
4039

41-
<img src="https://gist.github.com/pganssle/afde3d9ae1e9f1d9349cff4a00ddead0/raw/b82d5c2fa3ab34579cfdd4e28be058230fdde199/grid_arrangement08.png" width="300" alt="n=8"> <img src="https://gist.github.com/pganssle/afde3d9ae1e9f1d9349cff4a00ddead0/raw/b82d5c2fa3ab34579cfdd4e28be058230fdde199/grid_arrangement17.png" width="300" alt="n=17">
40+
<img src="images/grid_arrangement08.png" width="300" alt="n=8"> <img src="images/grid_arrangement17.png" width="300" alt="n=17">
4241

4342
This makes use of a `GridStrategy` object, which populates a `GridSpec`. In general, this concept can likely be implemented as a layer of abstraction *above* `gridspec.GridSpec`.
4443

4544
Some basic strategies that will be included in the first release:
4645

47-
- `"Squarish"` (name subject to change) - As implemented in the demo code above - currently this is centered, but the base `SquarishStrategy` object could have options like `justification` which could include:
46+
- `"Square"` - As implemented in the pictures above - currently this is centered, but the base `SquareStrategy` object has options for `alignment` which include:
4847
- `'center'` (default), `'left'`, `'right'` - empty spaces either center the plots or leave them ragged-left or ragged-right
49-
- `'fill-space'` and `fill-grow'` (names subject to change) - These would fill every column as "fully-justified", with `fill-space` increasing the interstitial space and `fill-grow` modifying the width of the plots themselves to fill the row.
50-
- `"Rectangular"` - Similar to `"Squarish"`, this would find the largest pair of factors of the number of plots and use that to populate a rectangular grid - so `6` would return a 3x2 grid, `7` would return a 7x1 grid, and `10` would return a 5x2 grid.
48+
- `'justified'` - This will fill every column as "fully-justified", with some plots being stretched to fill all of the colums in the row.
49+
50+
- `"Rectangular"` - Similar to `"Square"`, this would find the largest pair of factors of the number of plots and use that to populate a rectangular grid - so `6` would return a 3x2 grid, `7` would return a 7x1 grid, and `10` would return a 5x2 grid.
5151

52-
Since many of these grid strategies would likely have at least *some* asymmetries, a mechanism for transposing any grid structure should be implemented in the base `GridStrategy` object.
5352

5453
### Higher dimensions
5554

@@ -63,3 +62,12 @@ figures"). This would be no harder to implement
6362
in terms of the creation of such strategies, but
6463
may be harder to work with since it would
6564
necessarily spawn axes across multiple figures.
65+
66+
### Installation Instructions
67+
Simply run:
68+
`pip install grid-strategy`
69+
70+
Then, in your project, do:
71+
`from grid_strategy import strategies`
72+
73+
The strategies module has all usable strategies.

images/grid_arrangement06.png

8.16 KB
Loading

images/grid_arrangement07.png

9.29 KB
Loading

images/grid_arrangement08.png

9.83 KB
Loading

images/grid_arrangement17.png

14.7 KB
Loading

0 commit comments

Comments
 (0)