Added output metadata
Added 'analysis' parameter to choose between plot types