import matplotlib.pyplot as plt from utils import annotations from utils import data as d_module %matplotlib inline plt.figure(figsize=(10, 5)) plt.subplot(1, 2, 1) annotations.plot_frame('A', 2, timestamp=827) plt.subplot(1, 2, 2) annotations.plot_frame('B', 2, timestamp=2257) # Annotate clusters annotations.plot_clusters( (9, 8), (4, 6.5), (1, 5), (8.5, 4.5), title_pos=(4, 11), ) d_module.save_to_graphics('annotations-clustering_example') fig = plt.figure(figsize=(10, 10)) # utility function to plot the corelate movement base_timestamp = 2211 # starting from the next one i = 1 last_loc = None def fast_plot(x, y): global i, last_loc plt.subplot(3, 3, i) annotations.plot_frame('B', 2, timestamp=i + base_timestamp, title=None, legend=False, b_size=150) annotations.plot_cluster((x, y)) if last_loc is not None: annotations.movement(last_loc, (x, y)) last_loc = (x, y) i += 1 fast_plot(3.5, 2.2) fast_plot(1.5, 2.7) fast_plot(-0.5, 4) fast_plot(-2, 6.5) fast_plot(-3.3, 8.5) fast_plot(-3.5, 10.7) fast_plot(-3.3, 13.6) fast_plot(-1, 14.7) fast_plot(0.5, 14.7) d_module.save_to_graphics('annotations-correlated_movement_example')