pandoc-plot-1.9.2: tests/integration.md
---
title: Integration test
plot-configuration: tests/fixtures/.verbose-config.yml
---
```{.matplotlib}
# Example from:
# https://matplotlib.org/gallery/lines_bars_and_markers/scatter_demo2.html#sphx-glr-gallery-lines-bars-and-markers-scatter-demo2-py
#
import matplotlib.pyplot as plt
# Pie chart, where the slices will be ordered and plotted counter-clockwise:
labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'
sizes = [15, 30, 45, 10]
explode = (0, 0.1, 0, 0) # only "explode" the 2nd slice (i.e. 'Hogs')
fig1, ax1 = plt.subplots()
ax1.pie(sizes, explode=explode, labels=labels, autopct='%1.1f%%',
shadow=True, startangle=90)
ax1.axis('equal') # Equal aspect ratio ensures that pie is drawn as a circle.
```
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
```{.matplotlib file=tests/fixtures/plotfile.py caption="Example of plot included by file."}
```
The following plot uses a file that is specified using a path relative
from the location where pandoc-plot is called. Read issue #2 for context.
```{.matplotlib}
import numpy as np
import matplotlib.pyplot as plt
x, y = np.loadtxt("tests/fixtures/data.csv", delimiter=',', unpack=True)
plt.figure()
plt.plot(x,y)
```