Plotting the Source Point
The source point can be plot using the scatterplot() method of the graph_objects class. In this, the streamline plot and the position of the marker in the scatterplot are tweaked in such a way that it seems that all the stream is originating from a particular source.
Example:
Python3
import plotly.figure_factory as ff import plotly.graph_objects as go import numpy as np x = np.linspace( - 1 , 2 , 50 ) y = np.linspace( - 1 , 1 , 50 ) Y, X = np.meshgrid(x, y) u = np.cos(X) * Y v = np.cos(y) * X # Source for x and y coordinate # of scatter plot X, Y = 0 , 0 # Create streamline figure fig = ff.create_streamline(x, y, u, v, arrow_scale = . 1 ) fig.add_trace(go.Scatter(x = [X], y = [Y], mode = 'markers' , marker_size = 15 , )) fig.show() |
Output:
Streamline Plots in Plotly using 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