refactor scattergram