Re: Building lists
- To: mathgroup at smc.vnet.net
- Subject: [mg22345] Re: [mg22312] Building lists
- From: "David Park" <djmp at earthlink.net>
- Date: Fri, 25 Feb 2000 21:13:40 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hi Tom, Here are several ways. MapThread is the most direct. I often think of MapThread as a way to build a table where the arguments are not evenly spaced but given by a list, as with your colors. Show[Graphics[ {MapThread[{#1, Disk[{0, 0}, #2]} & , {{Blue, Red, Purple, Plum, Gold, Olive, Pink, Navy, Mint, Black}, Table[i, {i, 200, 20, -20}]}]}], AspectRatio -> Automatic, PlotRange -> All, DefaultFont -> {"Times", 18}]; If you really want to use Table with less control of the colors, you can use something like this: (which is somewhat a misuse of Hue) Show[Graphics[ {Table[{Hue[i/50], Disk[{0, 0}, i]}, {i, 200, 20, -20}]}], AspectRatio -> Automatic, PlotRange -> All, DefaultFont -> {"Times", 18}]; Or this: Show[Graphics[ {Table[{Hue[i/200, 1 - i/800, 1], Disk[{0, 0}, i]}, {i, 200, 20, -20}]}], AspectRatio -> Automatic, PlotRange -> All, DefaultFont -> {"Times", 18}]; David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ >Hello, > >The graphics command below builds a simple bull's eye. (I used it for a >probability question in my math class) It does what I want it to, but with >all the repetition I know that it is probably possible to do it more simply. > It isn't so long but I figured I could learn something by seeing how this >command could be duplicated in different ways. I was looking at Thread but >couldn't quite manage to get things to work out. The specific colors >aren't really important, but I did want to get each disk to be a different >color. > >Thanks for any suggestions you might have. > >Sincerely, > >Tom De Vries > >Needs["Graphics`Colors`"] > >Show[Graphics[{ > > {Blue, Disk[{0, 0}, 200]}, > {Red, Disk[{0, 0}, 180]}, > {Purple, Disk[{0, 0}, 160]}, > {Plum, Disk[{0, 0}, 140]}, > {Gold, Disk[{0, 0}, 120]}, > {Olive, Disk[{0, 0}, 100]}, > {Pink, Disk[{0, 0}, 80]}, > {Navy, Disk[{0, 0}, 60]}, > {Mint, Disk[{0, 0}, 40]}, > {Black, Disk[{0, 0}, 20]} > > }], AspectRatio -> Automatic, PlotRange -> All, >DefaultFont -> {"Times", 18}]; >