Added plotting functionality.