matplotlib/grid-strategy

I don't understand how to use this

dAnjou opened this issue · 1 comments

Hi,

I'm very new to matplotlib and I'm creating figures in a loop and I'd like to arrange them nicely.

Can someone add example code to the README that shows how to apply the strategies in this package?

Hi,
Sorry for the late response, this repo is kinda dead.
Here is some code that illustrates how to use the strategies.

`from grid_strategy import strategies
import matplotlib.pyplot as plt
import numpy as np

X axis values

t1 = np.arange(-10.0, 10.0, 0.1)

funcs = [2 * t1, t1 ** 2, t1 ** 3, 3 * t1]

Create a grid of 40 subplots using Square strategy

specs = strategies.SquareStrategy("center").get_grid(4)
plt.ioff()

loop through the subplots

for i, subplot in enumerate(specs):
plt.subplot(subplot)
plt.xticks([])
plt.yticks([])
ax = plt.gca()
plt.plot(funcs[i])

plt.show()`