How to reduce the spacing between legend in plot?

I would like to know how to reduce the vertical spacing between the legends in the PlotLegend option.

In the answer to this similar question in How to change the spacing of line in legend? it suggests using the option "Spacings" in the method LineLegend. However, such an option seems to be abandoned at least in version 12.0, so what would be the way to achieve the same goal similar to the Spacings option now?

• For v12.2.0, the option Spacings shows up in Red and the popup says: Spacings is not an option for LineLegend; but somehow it still works.
– Syed
Jun 7, 2022 at 8:44
• Crossposted here. Jun 7, 2022 at 22:00

One way is to give a function to the LegendLayout option. The following is an example of using Column[list,alignment,spacing]. The list itself uses Row[] to combine the colored line (or swatch if SwatchLegend[] is used) with the expression, while spacing controls the vertical spacing. The position of the legend itself is controlled by Placed[].
Plot[{Sin[x], Cos[x]}, {x, 0, 5},