1

I added margin to a plot and I am trying to use Epilog to write a comment inside the margin but it did not work? How can I writ inside the added margin without using the Drawing Tools

Plot[{x}, {x, 0, 3}, Frame -> True, PlotRange -> {0, 3}, 
  ImageMargins -> {{0, 0}, {0, 50}}, 
  Epilog -> {Text[Style["m=0", {FontSize -> 18, Black, 
    FontFamily -> "Times New Roman"}], Scaled[{.14, 1}]]}]

enter image description here

kglr
  • 394,356
  • 18
  • 477
  • 896
MMA13
  • 4,664
  • 3
  • 15
  • 21

2 Answers2

4

Without PlotRangeClipping->False and using FrameLabel if you want to display the text as title:

Plot[{x}, {x, 0, 3}, Frame -> True, PlotRange -> {0, 3}, 
 ImagePadding -> {{Automatic, Automatic}, {Automatic, 30}}, 
 FrameLabel -> {{"y", ""}, 
   {"x", Text[Style["m=0", 20, Red, FontFamily -> "Times"]]}}, 
 BaseStyle -> {FontSize -> 18, Black, FontFamily -> "Arial"}]

enter image description here

mrz
  • 11,686
  • 2
  • 25
  • 81
3

Use the options PlotRangeClipping and ImagePadding:

Plot[{x}, {x, 0, 3}, Frame -> True, PlotRange -> {0, 3}, 
 PlotRangeClipping -> False, ImagePadding -> {{Automatic, Automatic}, {Automatic, 50}}, 
 Epilog -> {Text[Style["m=0", {FontSize -> 18, Black, 
      FontFamily -> "Times New Roman"}], Scaled[{.14, 1.1}]]}]

enter image description here

kglr
  • 394,356
  • 18
  • 477
  • 896