implement resize event for scatter plot