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.

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:

graph

share|improve this question
1  
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]] –  Pickett 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 :) –  Pickett Aug 1 '13 at 6:53
add comment

1 Answer

up vote 4 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
1  
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
1  
There's no need to search for it; just use Options[(*graphic*), CoordinatesToolOptions] –  Mr.Wizard Jul 31 '13 at 22:25
    
slightly related: mathematica.stackexchange.com/questions/27109/… –  Jonie Jul 31 '13 at 23:55
add comment

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.