Recurrence PlotΒΆ

This example shows how to transform a time series into a Recurrence Plot using pyts.image.RecurrencePlot.

../../_images/sphx_glr_plot_rp_001.png
import matplotlib.pyplot as plt
from pyts.image import RecurrencePlot
from pyts.datasets import load_gunpoint

X, _, _, _ = load_gunpoint(return_X_y=True)

# Recurrence plot transformation
rp = RecurrencePlot(threshold='point', percentage=20)
X_rp = rp.fit_transform(X)

# Show the results for the first time series
plt.figure(figsize=(6, 6))
plt.imshow(X_rp[0], cmap='binary', origin='lower')
plt.title('Recurrence Plot', fontsize=18)
plt.show()

Total running time of the script: ( 0 minutes 0.380 seconds)

Gallery generated by Sphinx-Gallery