from sympy import *
from spb import *
import k3d
var("x:z")
u = -y - z
v = x + y / 5
w = S(1) / 5 + (x - S(5) / 2) * z
s = 10 # length of the cubic discretization volume
# create an XY plane with n discretization points along each direction
n = 8
p1 = plot_geometry(
    Plane((0, 0, 0), (0, 0, 1)), (x, -s, s), (y, -s, s), (z, -s, s),
    n1=n, n2=n, show=False)
# extract the coordinates of the starting points for the streamlines
xx, yy, zz = p1[0].get_data()
# streamlines plot
plot_vector(Matrix([u, v, w]), (x, -s, s), (y, -s, s), (z, -s, s),
    backend=KB, n=40, streamlines=True, grid=False,
    stream_kw=dict(
        starts=dict(x=xx, y=yy, z=zz),
        width=0.025,
        color_map=k3d.colormaps.matplotlib_color_maps.plasma
    ),
    title="Rössler \, attractor", xlabel="x", ylabel="y", zlabel="z")