Python | Markers Edge Styles in Matplotlib

In this article, we are going to explore different markers edge styles available in Python matplotlib.
Submitted by Anuj Singh, on August 22, 2020

Illustrations:

Python markers edge (1)

Python markers edge (2)

Python markers edge (3)

Python markers edge (4)

Python markers edge (5)

Python markers edge (6)

Python code for markers edge styles in matplotlib

import numpy as np
import matplotlib.pyplot as plt

x = np.arange(25)
y = np.random.randint(1,15,25)

plt.figure()
plt.plot(x, y, 'o', markersize=10, markerfacecolor='yellow', 
         markeredgecolor='purple', markeredgewidth=2.0, alpha=0.9)
plt.title('Marker Edge Style')

#############################################
#############################################
x = np.arange(25)
y = np.random.randint(1,15,25)

plt.figure()
plt.plot(x, y, 'o', markersize=10, markerfacecolor='yellow', 
         markeredgecolor='purple', markeredgewidth=6.0, alpha=0.9)
plt.title('Marker Edge Style')

#############################################
#############################################
x = np.arange(25)
y = np.random.randint(1,15,25)

plt.figure()
plt.plot(x, y, 's', markersize=10, markerfacecolor='yellow', 
         markeredgecolor='red', markeredgewidth=2.0, alpha=0.9)
plt.title('Marker Edge Style')

#############################################
#############################################
x = np.arange(25)
y = np.random.randint(1,15,25)

plt.figure()
plt.plot(x, y, 's', markersize=10, markerfacecolor='yellow', 
         markeredgecolor='green', markeredgewidth=6.0, alpha=0.9)
plt.title('Marker Edge Style')

#############################################
#############################################
x = np.arange(25)
y = np.random.randint(1,15,25)

plt.figure()
plt.plot(x, y, 'P', markersize=10, markerfacecolor='red', 
         markeredgecolor='yellow', markeredgewidth=2.0, alpha=0.9)
plt.title('Marker Edge Style')

#############################################
#############################################
x = np.arange(25)
y = np.random.randint(1,15,25)

plt.figure()
plt.plot(x, y, 'X', markersize=10, markerfacecolor='yellow', 
         markeredgecolor='purple', markeredgewidth=7.0, alpha=0.9)
plt.title('Marker Edge Style')

Output:

Output is as Figure





Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.





Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.