开发者

How do I control the appearance of a Locator inside a Mathematica's Manipulate statement?

If I have a Manipulate statement, such as:

开发者_JAVA技巧
Manipulate[
 Graphics[Line[{{0, 0}, pt}], PlotRange -> 2], {{pt, {1, 1}}, 
  Locator}]

How do I control the appearance of a Locator inside a Mathematica's Manipulate statement?

How do I change the appearance of the Locator object in the easiest way possible? Do I have to resort to Dynamic statements? Specifically, I would have liked to make the Locator invisible.


In addition to WReach's answer: In a normal Locator call its appearance can be given as one of the arguments. When used in a Manipulate this is not possible. However, Appearance can be used to draw other locator symbols.

a = Graphics[{Red, Table[Circle[{0, 0}, i], {i, 3}]}, ImageSize -> 20];
Manipulate[
 Graphics[Line[{{0, 0}, pt}], PlotRange -> 2], {{pt, {1, 1}}, Locator,
   Appearance -> a}]

How do I control the appearance of a Locator inside a Mathematica's Manipulate statement?

I don't think this is documented. Last year I tried finding out how to do this, but couldn't find a way. Got no response on my question on the mathematica newsgroup either.


Try adding Appearance -> None to the Locator control:

Manipulate[
  Graphics[
    Line[{{0, 0}, pt}]
  , PlotRange -> 2
  ]
, {{pt, {1, 1}}, Locator, Appearance -> None}
]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜