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.

Inset seem better suited for ad-hoc labels and legends than for precision, programmatic placement of annotation.

Given the following 'bottom-up' graphic expression:

Graphics[{
  Darker@Blue, 
  Point /@ Table[{k, Last@CountSelectMouseEvents["049", k]}, {k, -10, 
     10, 0.1}],
  Red, Line[{{0, 0}, {0, 55}}], Text["55", {0, 55}, {2, 0}], 
  Darker@Green, Line[{{1.3, 0}, {1.3, 37}}], 
  Text["37", {1.3, 37}, {-2, 0}]
  }, AspectRatio -> 1/GoldenRatio, Frame -> True]

Which yields:

enter image description here

How can the annotation graphics:

Red, Line[{{0, 0}, {0, 55}}], Text["55", {0, 55}, {2, 0}], 
      Darker@Green, Line[{{1.3, 0}, {1.3, 37}}] 

be Inset in ListPlot to create the same graphic? (use random points in lieu of CountSelectMouseEvents). I can never get the placement precise enough given the oblique syntax and placement rules.

share|improve this question

1 Answer 1

up vote 3 down vote accepted
ListLinePlot[Table[{k, k^2}, {k, -10, 10, 0.1}], 
 Epilog -> {Red, Line[{{0, 0}, {5, 55}}], Text["55", {5, 55}, {2, 0}],
            Darker@Green, Line[{{1.3, 0}, {1.3, 37}}]}, 
 InterpolationOrder -> 2]

enter image description here

torn[] credit: @Heike

share|improve this answer
    
I see, so Inset is unnecessary. –  alancalvitti Jul 13 '12 at 21:01
    
@alancalvitti As you already said Inset seem better suited for ad-hoc labels and legends –  belisarius Jul 13 '12 at 21:03
    
Yes but somehow I thought it was necessary with Epilog. Oh well there's a million combinations of functions to become familiar with. –  alancalvitti Jul 13 '12 at 21:07

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.