Week 5: Matplotlib#
5.1 - Line Plots - [Notebook] - [Video]#
Using plt.plot
Plotting a line between two points
Plotting line between multiple points
Plotting a function
Plotting two lines in the same figure
Plot Aesthetics
Changing line colour
Changing line width
Changing line style
Changing marker style
Axis Formatting
Setting limits
Changing ticks
Adding grids
Labels
Adding a title
Labeling axes
Error Bars
Asymptotes and Annotations
Log Plots
Making log-log plots
Making semi-log plots
Figure Object
Creating a figure
Adding axes to figure
Adjusted functions
Saving an image
5.2 - Multiple and Alternative Plots - [Notebook] - [Video]#
Subplots
Making sub-plots using
plt.subplot()
Plots in Plots
Making sub-plots using
fig.add_subplot()
Making sub-plots using
plt.subplots()
Histograms
Scatter Plot
Bar Chart
Pie Chart
5.3 - 3D Plots and Animations - [Notebook] - [Video]#
3D Line Plot
Heatmap
Surface Plot
Interactive Backend
Animation
Making an initialisation function
Making an animation function
Animating a plot
Saving an animation
5.4 Cheatsheet#
5.5 Tutorial#
Noise in qubits
Particle in a Box
Normal Distribution
Monte Carlo \(\pi\) Estimation
Ball Animation
5.6 Exercises#
Settlers of Histogram
Normal Distribution
Particle in a Box
Plotting a Sphere
Snake Animation