Plotting Points with Quiver Plot
A quiver plot can be shown with the points with the help of the add_trace() method of graph_objects class. The scatter plot is added in such a way that shows the origin of the quivers.
Example:
Python3
import plotly.figure_factory as ff import plotly.graph_objects as go import numpy as np x = np.linspace( - 2 , 2 , 60 ) y = np.linspace( - 1 , 1 , 60 ) Y, X = np.meshgrid(x, y) u = np.cos(X) * Y v = np.sin(X) * Y # Create quiver plot fig = ff.create_quiver(x, y, u, v, arrow_scale = . 1 ) # Adding scatter as the origin fig.add_trace(go.Scatter(x = [ 0 ], y = [ 0 ], mode = 'markers' , marker_size = 15 )) fig.show() |
Output:
Quiver Plots using Plotly in Python
A Plotly is a Python library that is used to design graphs, especially interactive graphs. It can plot various graphs and charts like histogram, barplot, boxplot, spreadplot, and many more. It is mainly used in data analysis as well as financial analysis. plotly is an interactive visualization library.
Contact Us