Skip to content

Use matplotlib sphinx extensions to build documentation #52

Open
@pganssle

Description

@pganssle

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions