HOME/Articles/

matplotlib example sample wheel (snippet)

Article Outline

Python matplotlib example 'sample wheel'

Modules used in program:

  • import numpy as np

python sample wheel

Python matplotlib example: sample wheel

import numpy as np
from figure import Figure

t = np.linspace(0, 2 * np.pi, 1001)
x = np.cos(3 * t)
y = np.sin(4 * t)

fig = Figure()
fig.set_figsize((6, 6))
fig[0].plot(x, y)
fig[0].add_zoom_func()
fig.show()