Skip to main content

Live rendering of python code using matplotlib

Project description

Mkdocs-Matplotlib

PyPI version Test Release Pipeline Code Quality Documentation Status Python version License: MIT pre-commit Black

Mkdocs-Matplotlib is a plugin for mkdocs which allows you to automatically generate matplotlib figures and add them to your documentation. Simply write the code as markdown into your documention.

screenshot

Quick Start

This plugin can be installed with pip

pip install mkdocs-matplotlib

To enable this plugin for mkdocs you need to add the following lines to your mkdocs.yml.

plugins:
  - mkdocs_matplotlib

To render a code cell using matplotlib you simply have to add the comment # mkdocs: render at the top of the cell.

# mkdocs: render
import matplotlib.pyplot as plt
import numpy as np

xpoints = np.array([1, 8])
ypoints = np.array([3, 10])

plt.plot(xpoints, ypoints)

In addition you can add the comment # mkdocs: hidecode to hide the code and and # mkdocs: hideoutput to hide the output image of the cell.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs_matplotlib-0.10.1.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

mkdocs_matplotlib-0.10.1-py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page