Python and Jupyter Notebooks: difficulty 3

Mark Yourself Question

  1. Grab a piece of paper and try this problem yourself.
  2. When you're done, check the "I have answered this question" box below.
  3. View the solution and report whether you got it right or wrong.

A student plots a bacterial growth curve:

import matplotlib.pyplot as plt
time_h = [0, 2, 4, 6, 8]
od600 = [0.05, 0.11, 0.24, 0.50, 0.95]
plt.plot(od600, time_h, "o-")
plt.xlabel("Time (h)")
plt.ylabel("OD600")
plt.show()

The horizontal axis labelled "Time (h)" runs only from about 0 to 1, and the vertical axis labelled "OD600" reaches 8. Explain the bug, write the corrected plotting line, and give the (x, y) coordinates of the right-most point after the fix.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Python and Jupyter Notebooks Questions: