Home »
Python »
Python Data Visualization
Python | Hatching Head of the Arrow
In this article, we are going to hatch the head of the arrow (with default shape) using the hatch command of matplotlib.
Submitted by Anuj Singh, on July 31, 2020
Through this tutorial, we are trying to present different types of hatch that are possible in an arrow. Any of them can be used for different applications. Following are the plots as an output from the python code.
Python code for hatching head of the arrow
import matplotlib.pyplot as plt
plt.figure()
plt.arrow(0.05, 0.2, 0.5, 0, linewidth=3.0, hatch='+',
head_width=0.15, head_length=0.25)
plt.title('Hatched Head')
plt.show()
plt.figure()
plt.arrow(0.05, 0.2, 0.5, 0, linewidth=3.0, hatch='-',
head_width=0.15, head_length=0.25)
plt.title('Hatched Head')
plt.show()
plt.figure()
plt.arrow(0.05, 0.2, 0.5, 0, linewidth=3.0, hatch='/',
head_width=0.15, head_length=0.25)
plt.title('Hatched Head')
plt.show()
plt.figure()
plt.arrow(0.05, 0.2, 0.5, 0, linewidth=3.0, hatch='o',
head_width=0.15, head_length=0.25)
plt.title('Hatched Head')
plt.show()
plt.figure()
plt.arrow(0.05, 0.2, 0.5, 0, linewidth=3.0, hatch='.',
head_width=0.15, head_length=0.25)
plt.title('Hatched Head')
plt.show()
Output:
Output is as figure