Split String Based On Character Python Compiler With Matplotlib