Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I use the following code to draw a parametric plot, with Epilog to add a point, and text using Graphics.

graf7 = ParametricPlot[  { delta18[t], delta2D[t]}, {t, 0, 800},
   Epilog -> {Red, PointSize[Large], 
     Point[{ delta18[0] , delta2D[0]} ], 
     Line[{{20, 160}, {-50, -400}}] } ,
   AspectRatio -> 1, PlotLabel -> "d18O vs dD (g/kgda)",
   PlotStyle -> Thick, PlotRange -> All, ImageSize -> Medium
   ];

Show[graf7,
  Graphics[Text["Dot is at surface", {-10.6, -89.4}]],
  Graphics[Text["Black line is MWL ", {-10.6, -89.6}]]  ]

For now, it works fine. I experimented with the equations that find the original arguments, delta18[t] and delta2D[t], so their value ranges change drastically, and the inserted text is no longer in the plot region.

How can I make the text appear at a relative position within the plot, so it is never outside the plot region?

share|improve this question
    

1 Answer 1

up vote 5 down vote accepted

You must use Scaled coordinates to position the text.

Example:

Manipulate[
 Plot[Sin[x], {x, 0, max},
  PlotRange -> 1.1 {-1, 1},
  Epilog -> {Text["sine", Scaled[{.2, .8}]]}],
 {max, 1, 20}
 ]
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.