How to mark a specific line in ContourPlot

Clear["Global`*"]

sol = ParametricNDSolve[{y'[t] == a y[t], y[0] == 1}, y, {t, 0, 10}, {a}];

Show[
 ContourPlot[y[a][x] /. sol, {x, 0, 0.1}, {a, 0, 4},
  PlotLegends -> BarLegend[Automatic,
    LegendMarkerSize -> 180,
    LegendFunction -> "Frame",
    LegendMargins -> 5,
    LegendLabel -> "y[a][x]"],
  Frame -> True,
  FrameLabel -> {{"a", ""}, {"x", ""}},
  BaseStyle -> {FontWeight -> "Bold", FontSize -> 14}],
 ContourPlot[y[a][x] /. sol, {x, 0, 0.1}, {a, 0, 4},
  Contours -> {1.15},
  ContourStyle -> Directive[Thick, White],
  ContourShading -> None]]

enter image description here

Or

ContourPlot[y[a][x] /. sol, {x, 0, 0.1}, {a, 0, 4},
 PlotLegends -> BarLegend[Automatic,
   LegendMarkerSize -> 180,
   LegendFunction -> "Frame",
   LegendMargins -> 5,
   LegendLabel -> "y[a][x]"],
 Frame -> True,
 FrameLabel -> {{"a", ""}, {"x", ""}},
 BaseStyle -> {FontWeight -> "Bold", FontSize -> 14},
 Contours -> Range[1.05, 1.45, 0.05],
 ContourStyle -> ReplacePart[
   Array[Black, 9],
   3 -> Directive[Thick, Opacity[1, White]]]]

enter image description here


How about:

  sol = ParametricNDSolve[{y'[t] == a y[t], y[0] == 1}, 
   y, {t, 0, 10}, {a}];
ContourPlot[y[a][x] /. sol, {x, 0, 0.1}, {a, 0, 4}, Frame -> True, 
 FrameLabel -> {{"a", ""}, {"x", ""}}, 
 BaseStyle -> {FontWeight -> "Bold", FontSize -> 14},
 Contours -> {1.15}, ContourStyle -> Directive[Thick, Red], 
 ContourShading -> None]

enter image description here


Woudl this work?

ContourPlot[
  y[a][x] /. sol, {x, 0, 0.1}, {a, 0, 4},
  PlotLegends -> 
   BarLegend[Automatic, LegendMarkerSize -> 180, 
    LegendFunction -> "Frame", LegendMargins -> 5,
    LegendLabel -> "y[a][x]"],
  Frame -> True, FrameLabel -> {{"a", ""}, {"x", ""}},
  BaseStyle -> {FontWeight -> "Bold", FontSize -> 14},

  Contours -> {{1.15, Thick}}, ContourShading -> None
]

enter image description here

Tags:

Plotting