Setting up plotting functionality