1. Learn
  2. /
  3. Courses
  4. /
  5. Unit Testing for Data Science in Python

Exercise

Fix the plotting function

In the last exercise, pytest saved the baseline images, actual images, and images containing the pixelwise difference in a temporary folder. The difference image for one of the tests test_on_almost_linear_data() is shown below.

The black areas are where the actual image and the baseline matches. The white areas are where they don't match.

This clearly tells us that something is wrong with the axis labels. Take a look at the plots section to see the baseline (plot 1/2) and the actual plot (plot 2/2). Based on that, it's your job to fix the plotting function.

Instructions 1/2

undefined XP
    1
    2
  • Fill in the axis labels xlabel and ylabel so that they match the baseline plot (plot 1/2).