Check a solution here to clear the REPL terminal:
write(stdin.buffer, 0x0C)
NB: subsequent plots do stay in place: