new function for subplot