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?
-
$\begingroup$ Related: mathematica.stackexchange.com/q/3313/5 (Eli and David's answers are especially relevant) $\endgroup$– rm -rf ♦Feb 7, 2013 at 20:56
-
$\begingroup$ @rm-rf But those answers only deal with determining the appearance of all locators at the same time. $\endgroup$– Sjoerd C. de VriesFeb 7, 2013 at 21:25
-
$\begingroup$ @SjoerdC.deVries I just said that they're related (not dupes) and someone seeing this question might also find those interesting/relevant. $\endgroup$– rm -rf ♦Feb 7, 2013 at 21:57
-
2$\begingroup$ @rm-rf Fair enough. I only wanted to prevent trigger-happy closers from prematurely closing this. $\endgroup$– Sjoerd C. de VriesFeb 7, 2013 at 22:05
1 Answer
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]
or, with Appearance -> "\[CenterDot]"
:
-
$\begingroup$ You sir are a hero. Great answer! Thank you very much. $\endgroup$– EdMFeb 7, 2013 at 21:55