APPENDIX A

image

Writing Mathematical Expressions with LaTeX

LaTeX is extensively used in Python. In this appendix there are many examples that can be useful to represent LaTeX expressions inside Python implementations. This same information can be found at the link http://matplotlib.org/users/mathtext.html.

With matplotlib

You can enter the LaTeX expression directly as an argument of various functions that can accept it. For example, the title() function that draws a chart title.

import matplotlib.pyplot as plt%matplotlib inlineplt.title(r’$\alpha > \beta$’)

With IPython Notebook in a Markdown Cell

You can enter the LaTeX expression between two ’$$’. ...

Get Python Data Analytics: Data Analysis and Science Using Pandas, matplotlib, and the Python Programming Language now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.