Matplotlib Tutorial
Matplotlib Useful Resources
Selected Reading
- Matplotlib - Transforms
- Matplotlib - Working with Images
- Mathematical Expressions
- Matplotlib - Working With Text
- Matplotlib - 3D Surface plot
- Matplotlib - 3D Wireframe plot
- Matplotlib - 3D Contour Plot
- Three-dimensional Plotting
- Matplotlib - Violin Plot
- Matplotlib - Box Plot
- Matplotlib - Quiver Plot
- Matplotlib - Contour Plot
- Matplotlib - Scatter Plot
- Matplotlib - Pie Chart
- Matplotlib - Histogram
- Matplotlib - Bar Plot
- Matplotlib - Twin Axes
- Setting Ticks and Tick Labels
- Matplotlib - Setting Limits
- Matplotlib - Formatting Axes
- Matplotlib - Grids
- Matplotlib - Subplot2grid() Function
- Matplotlib - Subplots() Function
- Matplotlib - Multiplots
- Matplotlib - Axes Class
- Matplotlib - Figure Class
- Object-oriented Interface
- Matplotlib - PyLab module
- Matplotlib - Simple Plot
- Matplotlib - Pyplot API
- Matplotlib - Jupyter Notebook
- Matplotlib - Anaconda distribution
- Matplotlib - Environment Setup
- Matplotlib - Introduction
- Matplotlib - Home
Matplotlib Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Mathematical Expressions
Matplotpb - Mathematical Expressions
You can use a subset TeXmarkup in any Matplotpb text string by placing it inside a pair of dollar signs ($).
# math text plt.title(r $alpha > eta$ )
To make subscripts and superscripts, use the _ and ^ symbols −
r $alpha_i> eta_i$ import numpy as np import matplotpb.pyplot as plt t = np.arange(0.0, 2.0, 0.01) s = np.sin(2*np.pi*t) plt.plot(t,s) plt.title(r $alpha_i> eta_i$ , fontsize=20) plt.text(0.6, 0.6, r $mathcal{A}mathrm{sin}(2 omega t)$ , fontsize = 20) plt.text(0.1, -0.5, r $sqrt{2}$ , fontsize=10) plt.xlabel( time (s) ) plt.ylabel( volts (mV) ) plt.show()
The above pne of code will generate the following output −
Advertisements