Open IgnacioJPickering opened 5 months ago
I have found an ugly workaround by wrapping the methods right before calling interactive(True)
, which is good enough for me since I use the library for very small things, but it would be cool to fix this.
# Monkey patch cld() and clear_data() to prevent bug
# that happens when plotext.show() is called with no data
plotext._clear_data = plotext.clear_data
def _fixed_clear_data():
if plotext._core._figure._interactive:
plotext.interactive(False)
plotext._clear_data()
plotext.interactive(True)
else:
plotext._clear_data()
plotext.cld = _fixed_clear_data
plotext.clear_data = _fixed_clear_data
This is especially an issue for me when using
interactive(True)
, sinceplotext.show()
is automatically called each timeplotext.clear_data()
is called, which screws up the plots constantly, but it is also an issue withinteractive(False)
.An example:
Expected behavior: plot should be the same before and after
plot.show()
with no data.