Няма описание

scatter_squares.py 488B

1234567891011121314151617181920
  1. import matplotlib.pyplot as plt
  2. x_values = list(range(1, 1001))
  3. y_values = [x**2 for x in x_values]
  4. plt.scatter(x_values, y_values, c=(0, 0, 0.8), edgecolor='none', s=40)
  5. # Set chart title, and label axes.
  6. plt.title("Square Numbers", fontsize=24)
  7. plt.xlabel("Value", fontsize=14)
  8. plt.ylabel("Square of Value", fontsize=14)
  9. # Set size of tick labels.
  10. plt.tick_params(axis='both', which='major', labelsize=14)
  11. # Set the range for each axis.
  12. plt.axis([0, 1100, 0, 1100000])
  13. plt.show()