Changed signature of assign_shapes to allow reference to ggplot object