BYU logo Computer Science

Lab 18 — Plotting with matplotlib

In this lab you will practice plotting using matplotlib. Start by downloading lab18-plotting-with-matplotlib.ipynb. Write all your code in this Jupyter notebook.

Setup

To get things setup for this lab, do the following in a terminal:

conda activate cs110
conda install jupyter

Reminder: The easiest way for you to do this is to use the PyCharm terminal.

Then you can run jupyter from a terminal:

jupyter notebook

See the Introduction to Jupyter if you need help with using Jupyter.

Problems

Complete all the sections of the notebook you downloaded above.

Lessons

What we want you to get from this lab:

  • You are able to use a Jupyter notebook

  • You can do some basic plotting with matplotlib

  • Hopefully you had fun!

Points

Turn in your Python notebook.

TaskDescriptionPoints
linspaceOne practice problem1
ArraysThree practice problems1
Plot a lineYour solution works1
Plot a functionYour solution works1
Plot sin()Your solution works1
Plot sin() and cos()Your solution works1
Plot a complex functionYour solution works2
Three plots of your ownYour solution works2