Tillsten / MPLslides

Presentations with matplotlib

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#Readme

MPLslides

by Till Stensitzki ##Introduction

Hacked together python presentation framework using only matplotlib. This is mostly a prototype and if development will continue everything will probaly change. Can output to every matplotlib backend.

Example

See the example.pdf for the pdf generated by example.py.

Hello world

from mplslides.content import listed_text, image
from mplslides.presentation import Presentation
from mplslides.slides import TitleSlide, NormalSlide
import matplotlib.pyplot as plt

pres = Presentation()
s = TitleSlide("Hello", "World")
pres.add_slide(s)

s = NormalSlide('Hello World!', 'Second Page')
txt = listed_text(['Foo', 'Bar', '123'], (0.1, 0.75))
img = image('mplslides.png', (0.05,0.05), zoom=0.5)
s.add_content([txt, img])
pres.add_slide(s)

plt.show()

Content

In mplslides content is added to the slides in the form of functions.

When a slide is drawn, each content is called with the slide as the argument. So the content function has access to the slide, including the figure slide.fig and a default axis spanning the whole figure slide.def_ax. The function is free to create new axes as needed from the figure.

Styling and Layout

Styling defaults and various layout dimensions are defined in styles.py.

Third party libarys

mplslides includes a copy of cascadict by JNevrly.

About

Presentations with matplotlib

License:MIT License


Languages

Language:Python 100.0%