The use of returnfig=True
creates multiple figures when using ipywidgets
#673
Labels
bug
Something isn't working
Describe the bug
If you provide returnfig=True or use your own axes, updating the ipywidgets produces additional plots.
To Reproduce
this example uses 15 min klines, but that doesn't matter.
Expected behavior
When using ipywidgets and updateing the slider, the reloading of the plot_func produces an additional figure each time you update the widget. This shouldn't be. When your don't use returnfig (or don't add ax and volume by your own figure) this behaviour does not accure.
jupyter lab
mplfinance 0.12.10b0
Screenshots
![image](https://private-user-images.githubusercontent.com/1568087/335826140-147b7e8d-c72e-4299-9f8f-0a0bb7201f3b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYwMDc0MDQsIm5iZiI6MTcyNjAwNzEwNCwicGF0aCI6Ii8xNTY4MDg3LzMzNTgyNjE0MC0xNDdiN2U4ZC1jNzJlLTQyOTktOWY4Zi0wYTBiYjcyMDFmM2IucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkxMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MTBUMjIyNTA0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9M2Y3ODU2YzUwYjViMDk5OWJjNjdjMzQ1NjNiYzNiNzM5NjM4MTU5ZjhlNzBmYmEyYWQ2MzRhMjJhODE4YTk1NSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.R8qpG73c-iYl3I5hjGl4CXfqGxkhEgrUhhyog0YSn6Q)
The text was updated successfully, but these errors were encountered: