Colorbar duplicates when moving the slider in a 3D surfaceplot with matplotlib in python
I have written code to make a 3D surfaceplot with sliders in Python. I also have a colorbar to better visualise what is happening. However, when I move a slider, the colorbar duplicates. How do I fix it, such that the colorbar is also updated and does not duplicate?