Mathematica notebook to easily plot Electronic Spectra from Computational Chemistry calculations

listPlotPeaks functions

This function enables the plot of the list of electronic transitions in a vertical lines layout. It is very useful because is the direct picture of the vertical transitions obtained by the quantum chemistry calculation.

listPlotPeaks[data_?ListQ, color_] :=
  Filling -> Axis,
  PlotRange -> {{All, All}, {0.0, All}},
  PlotStyle -> Directive[PointSize[Large], color],
  ImageSize -> 600]

plotPeaks functions

These plot functions are based on the sum of the convolutions of the statistical distributions over each vertical transition. You can choose different versions like plotGaussPeaks, plotLorentzPeaks, and plotVoigtPeaks.

plotGaussPeaks[data_?ListQ, \\[Sigma]_?NumericQ, xMin_?NumericQ, xMax_?NumericQ, color_, legends_?StringQ] :=

    Plot[getGaussPeaks[x, data, \\[Sigma]], {x, xMin, xMax},
         PlotRange -> {{xMin, xMax}, All},
         Frame -> True, FrameLabel -> {Style[\"Energy (eV)\", FontSize -> 16],
         Style[\"Oscillator Strength\", FontSize -> 16]}, FrameTicksStyle -> Directive[FontSize -> 14],
         PlotStyle -> Directive[color], ImageSize -> 600,
         PlotLegends -> Placed[SwatchLegend[{legends}], Above],
        PerformanceGoal -> \"Speed\"]

One of my favorite tools is the manipulateGaussSpectrum, in which you can dynamically try and choose the best parameters for your plot. In this case, the Manipulate tool enables the selection of the range of the energy axis plot and the σ value of the Gauss distribution. Once you get experienced, you can fully enjoy the flexibility of the Wolfram language.

Best regards!