Skip to main content
improved answer by reading the last comment from the OP
Source Link
Syed
  • 62.9k
  • 5
  • 48
  • 103

Epilog puts graphics primitives after the plot is drawn. The legend has to be put together manually.

Plot[x^2, {x, 0, 2} , Frame -> True , ImageSize -> 400 , Epilog -> {AbsolutePointSize[6], Red, Point@{1, 1}} ,  PlotLegends -> Placed[ LineLegend[Placed[LineLegend[{Blue, RedBlue} , {"\!\(\*SuperscriptBox[\(x\), \(2\)]\)", "Red dot"} , LegendLayout -> {"Column", 1}   , LegendFunction -> (Framed[ #, Background -> GrayLevel[0.9] , RoundingRadius -> 4 ] &) *, LegendMarkers -> {"" LegendFunction\[Rule](*Graphics[{AbsoluteThickness[5] ,Line[{{-0.5,0},{0.5,0}}]}]*) , Graphics[Disk[]]}]Framed[# , {1, 0Background\[Rule]GrayLevel[0.5} ] ] 

enter image description here

For the specific case mentioned in the OP:

Plot[x^2, {x, 0, 2} , Frame -> True , ImageSize -> 400 , Epilog -> {AbsolutePointSize[6], Red, Point@{1, 1}} , PlotLegends -> Placed[ LineLegend[{Blue, White}9] , {"\!\(\*SuperscriptBox[\(x\), \(2\RoundingRadius\[Rule]4]&)]\*)", "Red dot"} , LegendLayout -> {"Column", 1} , LegendMarkers -> {"",   , Graphics[{Red, Disk[]}]}] , {1, 0.5} ] ]]] 

enter image description here

Epilog puts graphics primitives after the plot is drawn. The legend has to be put together manually.

Plot[x^2, {x, 0, 2} , Frame -> True , ImageSize -> 400 , Epilog -> {AbsolutePointSize[6], Red, Point@{1, 1}} , PlotLegends -> Placed[ LineLegend[{Blue, Red} , {"\!\(\*SuperscriptBox[\(x\), \(2\)]\)", "Red dot"} , LegendLayout -> {"Column", 1}   , LegendFunction -> (Framed[ #, Background -> GrayLevel[0.9] , RoundingRadius -> 4 ] &) , LegendMarkers -> {"" (*Graphics[{AbsoluteThickness[5] ,Line[{{-0.5,0},{0.5,0}}]}]*) , Graphics[Disk[]]}] , {1, 0.5} ] ] 

enter image description here

For the specific case mentioned in the OP:

Plot[x^2, {x, 0, 2} , Frame -> True , ImageSize -> 400 , Epilog -> {AbsolutePointSize[6], Red, Point@{1, 1}} , PlotLegends -> Placed[ LineLegend[{Blue, White} , {"\!\(\*SuperscriptBox[\(x\), \(2\)]\)", "Red dot"} , LegendLayout -> {"Column", 1} , LegendMarkers -> {""   , Graphics[{Red, Disk[]}]}] , {1, 0.5} ] ] 

Epilog puts graphics primitives after the plot is drawn. The legend has to be put together manually.

Plot[x^2, {x, 0, 2} , Frame -> True , ImageSize -> 400 , Epilog -> {AbsolutePointSize[6], Red, Point@{1, 1}},  PlotLegends -> Placed[LineLegend[{Blue, Blue} , {"\!\(\*SuperscriptBox[\(x\), \(2\)]\)", "Red dot"} , LegendLayout -> {"Column", 1} (*,LegendFunction\[Rule](Framed[# ,Background\[Rule]GrayLevel[0.9] ,RoundingRadius\[Rule]4]&)*) , LegendMarkers -> {"", Graphics[{Red, Disk[]}]}], {1, 0.5}]] 

enter image description here

Source Link
Syed
  • 62.9k
  • 5
  • 48
  • 103

Epilog puts graphics primitives after the plot is drawn. The legend has to be put together manually.

Plot[x^2, {x, 0, 2} , Frame -> True , ImageSize -> 400 , Epilog -> {AbsolutePointSize[6], Red, Point@{1, 1}} , PlotLegends -> Placed[ LineLegend[{Blue, Red} , {"\!\(\*SuperscriptBox[\(x\), \(2\)]\)", "Red dot"} , LegendLayout -> {"Column", 1} , LegendFunction -> (Framed[ #, Background -> GrayLevel[0.9] , RoundingRadius -> 4 ] &) , LegendMarkers -> {"" (*Graphics[{AbsoluteThickness[5] ,Line[{{-0.5,0},{0.5,0}}]}]*) , Graphics[Disk[]]}] , {1, 0.5} ] ] 

enter image description here

For the specific case mentioned in the OP:

Plot[x^2, {x, 0, 2} , Frame -> True , ImageSize -> 400 , Epilog -> {AbsolutePointSize[6], Red, Point@{1, 1}} , PlotLegends -> Placed[ LineLegend[{Blue, White} , {"\!\(\*SuperscriptBox[\(x\), \(2\)]\)", "Red dot"} , LegendLayout -> {"Column", 1} , LegendMarkers -> {"" , Graphics[{Red, Disk[]}]}] , {1, 0.5} ] ]