Added capability to save plot in jpg formatted file.