discontinued a best version with legend and autoscale.
attached is the source file