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 am using LocatorPane with LocatorAutoCreate -> True. I would like to have the appearance of each new locator be different. Ideally I would like to use a dot with a numeric superscript that would be incremented as they where created, but just using the incremented number as the locator would be good too. Is this possible?

share|improve this question
    
Related: mathematica.stackexchange.com/q/3313/5 (Eli and David's answers are especially relevant) –  rm -rf Feb 7 '13 at 20:56
    
@rm-rf But those answers only deal with determining the appearance of all locators at the same time. –  Sjoerd C. de Vries Feb 7 '13 at 21:25
    
@SjoerdC.deVries I just said that they're related (not dupes) and someone seeing this question might also find those interesting/relevant. –  rm -rf Feb 7 '13 at 21:57
2  
@rm-rf Fair enough. I only wanted to prevent trigger-happy closers from prematurely closing this. –  Sjoerd C. de Vries Feb 7 '13 at 22:05

1 Answer 1

up vote 7 down vote accepted

I am not aware of any built-in option to do this, but using some graphics in combination with Dynamic does the trick.

pts = {{0, 0}};
LocatorPane[Dynamic[pts], 
  Graphics[
   {
     Circle[], 
     Dynamic@MapIndexed[Text[#2[[1]], #1 + {0.05, 0.05}] &, pts]
   }
  ], 
LocatorAutoCreate -> True]

Mathematica graphics

or, with Appearance -> "\[CenterDot]":

Mathematica graphics

share|improve this answer
    
You sir are a hero. Great answer! Thank you very much. –  EdM Feb 7 '13 at 21:55

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.