plot4 implementation