Plotting a Series of Points with scatter( )
import matplotlib.pyplot as plt
plt.style.use('seaborn')
fig, ax = plt.subplots()
ax.scatter(2, 4, s = 200)
#The scatter() method plots a single point.
#s argument sets the size of the dots
ax.set_title("Square Numbers", fontsize = 24)
ax.set_xlabel("Value", fontsize = 14)
ax.set_ylabel("Square of Value", fontsize = 14)
ax.tick_params(axis = 'both', which = 'major', labelsize = 14)
plt.show()
Result:
plotting point.png
Adjusting your plotting figure
import matplotlib.pyplot as plt
x_values = range(1, 1001)
y_values = [x**2 for x in x_values]
#a list comprehension gener