Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #8045 > unrolled thread

Specifying Locator appearance in Manipulate

Started byChris Young <cy56@comcast.net>
First post2012-01-21 10:10 +0000
Last post2012-01-21 10:10 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Specifying Locator appearance in Manipulate Chris Young <cy56@comcast.net> - 2012-01-21 10:10 +0000

#8045 — Specifying Locator appearance in Manipulate

FromChris Young <cy56@comcast.net>
Date2012-01-21 10:10 +0000
SubjectSpecifying Locator appearance in Manipulate
Message-ID<jfe2va$9nv$1@smc.vnet.net>
Took quite a while to figure this out, so I thought I'd pass it along. 
I wish that Locator color could be specified directly in the Appearance 
option for the Locator, but that just puts a colored oblong behind the 
Locator. Below, I add the points in in the Graphics[ ] section. This at 
least gives colored Locators. Could also add text, etc., there.

http://home.comcast.net/~cy56/Mma/LocatorColorAndSize.nb
http://home.comcast.net/~cy56/Mma/LocatorColorAndSizePic.png

Manipulate[
 Module[
  {A = P[[1]], B = P[[2]], M},
  M = (A + B)/2;
  Show[
   ParametricPlot[
    M + k (t - 1/2) (B - A),    {t, 0, 1},
    PlotRange -> 2,
    PlotStyle -> Directive[Purple, Thick]
    ],
   Graphics[{
     AbsolutePointSize[12],
     With[{color = {Green, Red}},
      {color[[k]], Point[P[[k]]]}~Table~{k, 2}
      ],
     Yellow, Point[M]
     }]
   ]
  ],
 {{k, 0.5}, 0, 1},

 { {P, {{0, 0}, {1, 1}}},
  Appearance -> Graphics[Locator[{0, 0}, ImageSize -> Medium]],
  Locator}
 ]

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web