Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use matplotlib sphinx extensions to build documentation #52

Open
pganssle opened this issue Feb 25, 2019 · 0 comments
Open

Use matplotlib sphinx extensions to build documentation #52

pganssle opened this issue Feb 25, 2019 · 0 comments

Comments

@pganssle
Copy link
Member

We should have a few simple examples in the documentation, generated inline with the matplotlib plotting extensions for sphinx.

For example, we can use this to generate one of the main figures:

.. plot::

   import matplotlib.pyplot as plt
   from grid_strategy.strategies import SquareStrategy

   specs = SquareStrategy('center').get_grid(7)

   for i, spec in enumerate(specs):
      ax = plt.subplot(spec)

      ax.text(0.5, 0.5, f"Subplot: {i}", color='white',
             fontweight='bold', va="center", ha="center")
      ax.tick_params(axis='both', bottom=False, top=False, left=False,
                    right=False, labelbottom=False, labelleft=False)

      ax.patch.set_facecolor('#2E2E2E')

   plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant