So I am having a similar problem to the one in this question but the solutions therein are of no use.
Consider a basic ContourPlot with an automatic BarLegend
ContourPlot[{Cos[y + x] x y}, {x, 0, 3}, {y, 0, 3}, PlotRange -> All,
PlotLegends -> BarLegend[Automatic],
Epilog -> {{Red, Line[Table[{i, Cos[i]}, {i, 0., 3., .1}]]}}]
which gives the following, nice ContourPlot:
However, when I try and add a LineLegend for the Epilog, ContourPlot cannot do so automatically. I have tried all suggestions in the link above and none of them work
ContourPlot[{Cos[y + x] x y}, {x, 0, 3}, {y, 0, 3}, PlotRange -> All,
PlotLegends ->
Column[{BarLegend[Automatic],
LineLegend[{Directive[Red]}, {"Test"}]}],
Epilog -> {{Red, Line[Table[{i, Cos[i]}, {i, 0., 3., .1}]]}}]
How do I fix this? I want the BarLegend to be automatic, since it provides a nice, simple fit of values. However, even manually I have had no success with BarLegend not evaluating.
(As a sidenote, imgur is not accepting the pictures I have provided. Have put up links, if someone can fix, would be grateful).