In this article, we will explore how we can create streamline plots using the Plotly figure_factory module.

## Function Syntax and Parameter List

The function syntax is provided below:

arrow_scale=0.09, **kwargs)

Required parameters:

**X**– 1 dimensional, evenly spaced list or array**Y**– 1 dimensional, evenly spaced list or array**U**– 2-dimensional array**V**– 2-dimensional array**density**– sets the density of the streamlines**angle**– angle of arrowhead in radians**arrow_scale**– scale length of the arrowhead

## Streamline Plot With Figure Factory

The following code illustrates how to create a basic streamline plot using Plotly figure_factory.

import numpy as np

import math

x = np.linspace(-1, 1, 10)

y = np.linspace(-1, 1, 10)

Y, X = np.meshgrid(x, y)

u = -1 – X**2 + Y

v = 1 + X – Y**2

u = u.T

v = v.T

fig = create_streamline(x, y, u, v)

fig.show()

The resulting streamline figure is shown below:

## Show Source Point

To include the source point of the arrow heads, we can run the following:

import numpy as np

import math

import plotly.graph_objects as go

x = np.linspace(-1, 1, 10)

y = np.linspace(-1, 1, 10)

Y, X = np.meshgrid(x, y)

u = -1 - X**2 + Y

v = 1 + X - Y**2

u = u.T

v = v.T

fig = create_streamline(x, y, u, v)

fig.add_trace(go.Scatter(x=[-1.0], y=[0.0],

mode='markers',

marker_size=15))

fig.show()

**Output:**

## Conclusion

This article discussed how to create streamline plots using Plotly figure_factory modules with the function syntax and parameters provided. In addition, the source points of the arrow heads were included.