How to plot images multithreaded

Hello, i deployed an app a few days ago. It contains a model, and when users send some parameters to it on the app, it can plot an image using matplotlib and show it on the app. However, the image will flash when multiple users are on the app simultaneously. I wrap my code with locks and the image do not flash anymore, but it also allows only one user to interact with the model at the current time. Anyone has other solutions to plot images instead of using matplotlib?

Hi there,

Thanks for sharing your question with the community! Check out our guidelines on how to post an effective question here. Iā€™d recommend adding a code snippet to your post and linking your app so that our community members can better understand your question.