TST/CLN: centralize common validation methods in test_graphics

Create base class for plotting related test, and organized data creation and validation function.