plot2 implementation