You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
644 B
Python

"""
This is to demonstrate why it may be necessary to adjust the scale of your visualization.
This particular example works because we are scatter plotting two comparable variables.
We have to change the scale to make sure that we aren't getting a misleading picture of the
relationship.
"""
from matplotlib import pyplot as plt
test_grades1 = [99, 90, 85, 97, 80]
test_grades2 = [100, 85, 60, 90, 70]
plt.scatter(test_grades1, test_grades2)
plt.title("Axes Aren't Comparable")
plt.xlabel("Test 1 grade")
plt.ylabel("Test 2 grade")
# Uncomment this line below to realign the axes
plt.axis([40, 120, 40, 120])
# plt.axis('equal')
plt.show()