Set variable point size in Matplotlib


To set the variable point size in matplotlib, we can take the following steps−

  • Initialize the coordinates of the point.
  • Make a variable to store the point size.
  • Plot the point using scatter method, with marker=o, color=red, s=point_size.To display the figure, use show() method.

Example

from matplotlib import pyplot as plt
plt.rcParams["figure.figsize"] = [7.00, 3.50]
plt.rcParams["figure.autolayout"] = True
xy = (3, 4)
point_size = 100
plt.scatter(x=xy[0], y=xy[1], marker='o', c='red', s=point_size)
plt.show()

Output

Updated on: 06-May-2021

290 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements