Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hopefully this is a simple question. I'm trying to overlay some text on top of a LogLogPlot using Epilog and Text. However, I'm struggling with the coordinates that Text seems to be using for placement. For example:

LogLogPlot[x + Sin[2x], {x, 1, 1000},
  Epilog -> Style[Text["x+sin(2x)", {5, 5}], 14]]

places the label "x+sin(x)" at roughly {x,y}={150,150} on the plot's coordinate system, and not {5,5} as in the input. However, if I change the LogLogPlot to just Plot, the label will get placed at {5,5} (or wherever I specify). What's going on?

How it looks right now:


share|improve this question
You have to use Log on the coordinates, this works: LogLogPlot[x + Sin[2 x], {x, 1, 1000}, Epilog -> Style[Text["x+sin(2x)", {Log[5], Log[5]}], 14]] – C. E. Jul 31 '13 at 22:01
@Anon You just beat me. If you want, I'll delete my answer and let you answer. ? – Michael E2 Jul 31 '13 at 22:03
@MichaelE2 I only beat you to it because I was too lazy to create that image. Your answer deserved to get accepted :) – C. E. Aug 1 '13 at 6:53
up vote 6 down vote accepted

Apparently the Epilog is processed after the coordinate remapping. Log[{150., 150.}] ~ {5., 5.}. Try this if you want the label at {5, 5}:

LogLogPlot[x + Sin[2 x], {x, 1, 1000}, 
 Epilog -> Style[Text["x+sin(2x)", Log@{5, 5}], 14]]

Mathematica graphics

share|improve this answer
I love those four-character fixes! – Mr.Wizard Jul 31 '13 at 22:05
That works perfectly... interesting, though, that while the log scales are in base 10, you must supply the log base e of the coordinates. – user1748343 Jul 31 '13 at 22:06
@user1748343 If you want to see what's being used, select the graphics, and execute the menu item Cell > Show Expression. It'll be long. But search for CoordinatesToolOptions. You'll see the functions used. – Michael E2 Jul 31 '13 at 22:11
There's no need to search for it; just use Options[(*graphic*), CoordinatesToolOptions] – Mr.Wizard Jul 31 '13 at 22:25
slightly related:… – Jonie Jul 31 '13 at 23:55

Your Answer


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.