Update scatter plot marker style - Python Mathplot Module

Update scatter plot marker style - Python Mathplot Module

Instructor-svg Al-Mamun Sarkar
Apr 02 , 2020

Update scatter plot marker style- Python Mathplotlib Module. The following codes show how to update Scatter Plot Marker Style using python mathplotlib module.

 

Import Module:

import matplotlib.pyplot as plt

 

Create Dataset:

x_data = [10,20,30,40,50,60,70,80]
y_data = [50,20,40,20,10,40,50,20]

 

Plot scatter graph and change marker style:

plt.scatter(x_data, y_data, label="Scatter", color='m', s=200, marker='*')
plt.title("Welcome to scatter ploting tutorial")
plt.xlabel('Plot Number on X-Axis')
plt.ylabel('Important Var on Y-Axis')
plt.legend()
plt.show()

 

Changing Marker style:

plt.scatter(x_data, y_data, label="Scatter", color='m', s=200, marker='2')
plt.title("Welcome to scatter ploting tutorial")
plt.xlabel('Plot Number on X-Axis')
plt.ylabel('Important Var on Y-Axis')
plt.legend()
plt.show()

  • Share On:
  • fb
  • twitter
  • pinterest
  • instagram