added test code to produce plot