ContextLab / hypertools

A Python toolbox for gaining geometric insights into high-dimensional data
http://hypertools.readthedocs.io/en/latest/
MIT License
1.83k stars 160 forks source link

Problem with creating multiple hypertools figures in a for loop #264

Open NilsNyberg opened 4 months ago

NilsNyberg commented 4 months ago

Hi,

Thank you for creating this awesome toolbox!

I'm using the hyp.plot function within a for loop, to create a new figure with new input data in each iteration the loop. However, the PCA plot does not update with every loop, but instead every plot looks the same as the first plot (i.e, the one generated in the first iteration of the loop). I have checked via debugging that the data is indeed new in every loop, and it works fine when I use matplotlib to plot the same data in the loop. Do you know what might be causing this behaviour, and how to fix it? I assumed there must be some state dependency within the hypertools library, and I found you're using a memoize decorator, that might be causing this problem? I tried to re-import the library with every iteration of the loop, but that unfortunately did not fix the problem.