Matplotlib is a library of Python bindings which provides the user with a MATLAB-like plotting framework. Matplotlib can be used in Python scripts, the Python and IPython shell, web application servers, and various graphical user interface toolkits like Tkinter, awxPython, etc.
matplotlib.pyplot.quiver method is used to plot a 2D field of arrows.
Syntax: matplotlib.pyplot.quiver(x_coordinate, y_coordinate, x_direction, y_direction)
x_coordinate : x-coordinate of the arrow location
y_coordinate : y-coordinate of the arrow location
x_direction : x-component of the direction of the arrow
y_direction : y-component of the direction of the arrow
scale: used to set the scale of the graph
scale_units: used to set the units of the plane with respect to x and y
angle: used to determine the angle of the arrow vectors plotted
Return Value : Returns a 2D graph with arrows plotted
Plotting multiple arrows on a graph using
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.