modified plot to accept lists as B and U, that way compatible with C++ calling it