Sample figureΒΆ

It’s easy to include source code that’s automatically run when the documentation is created with sphinx, e.g.:

>>> from pylab import *
>>> def f(x):
>>>     f = where(x>0, cos(x), exp(x))
>>>     return f
>>> x = linspace(-5, 5*pi, 500)
>>> plot(x,f(x))
>>> ylim([-1.2, 1.2])
(Source code)

Output

_images/1-samplefig.png

(PNG, PDF)

Previous topic

Example of one figure with two axes

This Page