@@ -303,9 +303,7 @@ def make_dendrogram(*args, **kwargs):
303
303
return ddata
304
304
305
305
306
- def plot_dynamic_activity_embeddings (
307
- annotated_coordinates : ArrayLike ,
308
- ** kwargs ) -> None :
306
+ def plot_dynamic_activity_embeddings (annotated_coordinates : ArrayLike , ** kwargs ) -> None :
309
307
pyplot_module = kwargs .get ('pyplot_module' , None )
310
308
if pyplot_module is None :
311
309
plt = import_module ('matplotlib.pyplot' , 'matplotlib' )
@@ -329,6 +327,38 @@ def plot_dynamic_activity_embeddings(
329
327
ha = ha ,
330
328
va = va )
331
329
plt .show ()
330
+
331
+
332
+ def plot_embedding_changes_in_vector_space (
333
+ target_activities : ArrayLike ,
334
+ aligned_activity_norms : ArrayLike ,
335
+ timeline_slices : ArrayLike , ** kwargs ) -> None :
336
+
337
+ pyplot_module = kwargs .get ('pyplot_module' , None )
338
+ if pyplot_module is None :
339
+ plt = import_module ('matplotlib.pyplot' , 'matplotlib' )
340
+ else :
341
+ plt = pyplot_module
342
+
343
+ if isinstance (timeline_slices , np .ndarray ):
344
+ timeline_slices = timeline_slices .tolist ()
345
+
346
+ figsize = kwargs .get ('figsize' , (15 ,10 ))
347
+ markersize = kwargs .get ('markersize' , 7 )
348
+ plt .figure (figsize = figsize )
349
+ time_frames = [week for week in timeline_slices ]
350
+ markers = ['+' , 'o' , 'x' ]
351
+ plt .clf ()
352
+
353
+ for idx in range (len (aligned_activity_norms )):
354
+ norms = aligned_activity_norms [idx ]
355
+ plt .plot (time_frames , norms , marker = markers [idx ], markersize = markersize )
356
+
357
+ plt .legend (target_activities )
358
+ plt .xlabel ('week' )
359
+ plt .ylabel ('activity norm' )
360
+ plt .show ()
361
+
332
362
333
363
334
364
if __name__ == "__main__" :
0 commit comments