Python | Different Head Types using Overhang Command in Matplotlib

In this article, we are going to explore different types of head (with default shape) using the overhang command of matplotlib.
Submitted by Anuj Singh, on July 31, 2020

We have shown the arrow shape with overhang value from 0.8 to -1 (with the gap of two). Any of them can be used for different applications. Following are the plots as an output from the python code.

Python | Different Head Types  (1)

Python | Different Head Types  (2)

Python | Different Head Types  (3)

Python | Different Head Types  (4)

Python | Different Head Types  (5)

Python | Different Head Types  (6)

Python | Different Head Types  (7)

Python | Different Head Types  (8)

Python | Different Head Types  (9)

Python | Different Head Types  (10)

Python code for different head types using overhang command in matplotlib

import matplotlib.pyplot as plt

plt.figure()
plt.arrow(0.2, 0.2, 0.5, 0, overhang=0.8, head_width=0.05, head_length=0.1)
plt.title(' Head Shape using Overhang 0.8')
plt.show()


plt.figure()
plt.arrow(0.2, 0.2, 0.5, 0, overhang=0.6, head_width=0.05, head_length=0.1)
plt.title(' Head Shape using Overhang 0.6')
plt.show()


plt.figure()
plt.arrow(0.2, 0.2, 0.5, 0, overhang=0.4, head_width=0.05, head_length=0.1)
plt.title(' Head Shape using Overhang 0.4')
plt.show()


plt.figure()
plt.arrow(0.2, 0.2, 0.5, 0, overhang=0.2, head_width=0.05, head_length=0.1)
plt.title(' Head Shape using Overhang 0.2')
plt.show()


plt.figure()
plt.arrow(0.2, 0.2, 0.5, 0, overhang=0, head_width=0.05, head_length=0.1)
plt.title(' Head Shape using Overhang 0')
plt.show()


plt.figure()
plt.arrow(0.2, 0.2, 0.5, 0, overhang=-0.2, head_width=0.05, head_length=0.1)
plt.title(' Head Shape using Overhang -0.2')
plt.show()


plt.figure()
plt.arrow(0.2, 0.2, 0.5, 0, overhang=-0.4, head_width=0.05, head_length=0.1)
plt.title(' Head Shape using Overhang -0.4')
plt.show()


plt.figure()
plt.arrow(0.2, 0.2, 0.5, 0, overhang=-0.6, head_width=0.05, head_length=0.1)
plt.title(' Head Shape using Overhang -0.6')
plt.show()

plt.figure()
plt.arrow(0.2, 0.2, 0.5, 0, overhang=-0.8, head_width=0.05, head_length=0.1)
plt.title(' Head Shape using Overhang -0.8')
plt.show()


plt.figure()
plt.arrow(0.2, 0.2, 0.5, 0, overhang=-1, head_width=0.05, head_length=0.1)
plt.title(' Head Shape using Overhang -1')
plt.show()

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.