Skip to main content

A directive to include K3D Jupyter's screenshots into a Sphinx document

Project description

sphinx_k3d_screenshot

PyPI version Conda (channel only) Documentation Status

A Sphinx directive for including the screenshot of a K3D Jupyter plot into a Sphinx document.

This package is based on matplotlib's plot directive.

Install

pip install sphinx_k3d_screenshot

or:

conda install -c davide_sd sphinx_k3d_screenshot 

Take a look at the Installation page to understand how to configure the extension to run on readthedocs.org server.

Usage

.. k3d-screenshot::

   f = lambda r, d: 5 * np.cos(r) * np.exp(-r * d)
   x, y = np.mgrid[-7:7:100j, -7:7:100j]
   r = np.sqrt(x**2 + y**2)
   z = f(r, 0.1)

   fig = k3d.plot()
   surface = surface = k3d.surface(
      z.astype(np.float32), bounds=[-7, 7, -7, 7],
      attribute=z.astype(np.float32),
      color_map=k3d.colormaps.matplotlib_color_maps.viridis)
   fig += surface

   fig

Take a look at the Examples page to visualize the available customization options.

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

sphinx_k3d_screenshot-0.2.0.tar.gz (15.7 kB view hashes)

Uploaded Source

Built Distribution

sphinx_k3d_screenshot-0.2.0-py3-none-any.whl (15.2 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