Updated plotting functionality