initializes plot and can change plot type