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
p = plane(
    Plane((0, 0, 0), (0, 0, 1)), (x, -s, s), (y, -s, s), (z, -s, s),
    n1=n, n2=n)[0]
xx, yy, zz = p.get_data()
graphics(
    vector_field_3d(
        u, v, w, (x, -s, s), (y, -s, s), (z, -s, s),
        n=40, streamlines=True,
        stream_kw=dict(
            starts=dict(x=xx, y=yy, z=zz),
            width=0.025,
            color_map=k3d.colormaps.matplotlib_color_maps.plasma
        )),
    title=r"Rössler \, attractor", xlabel="x", ylabel="y", zlabel="z",
    backend=KB, grid=False)