Learn to add annotations including text and arrows to a plot within Jupyter notebooks using matplotlib and NumPy in this video tutorial by Charles Kelly. These are explained in the context of computer science and data science to technologists and students
- [Instructor] The Plot Annotations file…in your exercises file folder…is pre-populated with import statements…and a cell that defines a simple plot.…Go to the Cell menu and select Run All.…I'll explain this code snippet…in context of this plot.…These three statements create a figure,…create a subplot and add randomized data to the subplot.…The text statement allows us to add text to the plot.…
Several interesting things here.…One, the coordinates,…that is the x and y-coordinates, are shown.…The x-coordinates are given…in terms of the number of data points…or the data set that we're displaying.…The y-coordinate uses the y-axis as a reference point.…In this case, r indicates that the string is a raw string…and that backslashes will not be interpreted…as escape characters.…
This particular equation doesn't use any backslashes,…but if you choose, you can use the convention…to prepend r to all your strings that include equations.…This equation, equals mc squared, is printed here.…Again, it's printed at x location one…
- Using Jupyter Notebook
- Creating NumPy arrays from Python structures
- Slicing arrays
- Using Boolean masking and broadcasting techniques
- Plotting in Jupyter notebooks
- Joining and splitting arrays
- Rearranging array elements
- Creating universal functions
- Finding patterns
- Building magic squares and magic cubes with NumPy and Python
Skill Level Intermediate
2. Create NumPy Arrays
3. Index, Slice, and Iterate
4. Plots: Matplotlib and Pyplot
5. Manipulate Arrays
6. Short Examples
7. Extended Examples
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.