words = StringSplit[
"I'm giving a big presentation in a couple of weeks and it has to \
be impressive. I have a fabulous idea for a graphic, inspired by the \
facebook friend wheel, where I want to wrap perhaps 100 words around \
a circle and draw lines to connect them in illustrative ways. The \
drawing lines part is easy, but the wrapping text around a circle \
part is hard (without doing it one element at a time, rotating and \
aligning each one just so). I *know* there's an easy way to do this, \
but am not quite smart enough to figure it out in omnigraffle or find \
another program that can do it. I can use Mac or PC. If you point me \
to a workable solution, you'll get your name in lights (if you wish) \
in addition to my unending gratitude."];
angles = 2 Pi Most[Rescale[Range[Length[words] + 1]]];
RadialWord[word_, angle_] :=
Module[{x = Cos[angle], y = Sin[angle],
sign = If[Cos[angle] > 0, 1, -1]},
Rotate[Text[
word, {sign, 0}, {If[x > 0, Left, Right], Center}], {{sign,
0}, {x, y}}]]
img = Graphics[{Blue, Circle[{0, 0}, 0.98], Black,
MapThread[RadialWord, {words, angles}]}, PlotRange -> 1.3,
ImageSize -> 600]
Export["wordsarounddisk.jpg", img]You are not logged in, either login or create an account to post comments
posted by AmbroseChapel at 10:51 PM on April 21