3
$\begingroup$

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.

$\endgroup$
4
$\begingroup$
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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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