RE: Problem with Show, Can't Give More than 5 Arguments
- To: mathgroup at smc.vnet.net
- Subject: [mg42756] RE: [mg42748] Problem with Show, Can't Give More than 5 Arguments
- From: "David Park" <djmp at earthlink.net>
- Date: Fri, 25 Jul 2003 05:08:02 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Gil, Just add PlotRange -> All at the end of the Show statement. Mathematica has PlotRange -> Automatic as the default option, under which it tries to find the "most interestering" part of the plot and eliminates outliers. You could shorten your code considerably by using Map (/@). First we make a list of the translations, using Union to eliminate duplicates. Then we calculate a sphere, using AffineShape to adjust the size. Then we map TranslateShape of the sphere onto the list of translations. Needs["Graphics`Shapes`"]; translations = {{15, 35, 12}, {85, 3, 10}, {1, 3, 13}, {1, 12, 8}, {0, 0, 0}, {17, 0, 2}, {10, 200, 200}, {200, 10, 26}, {11, 70, 25}, {3, 2, 17}, {24, 0, 1}, {0, 0, 1}, {51, 0, 4}, {10, 0, 1}, {0, 0, 0}, {4, 0, 0}, {1, 0, 0}, {1, 1, 5}} // Union; sphere = AffineShape[Graphics3D[Sphere[]], {1, 1, 1}3]; Show[TranslateShape[sphere, #] & /@ translations, PlotRange -> All]; David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ From: Gil [mailto:jiwwgvpfeudf at spammotel.com] To: mathgroup at smc.vnet.net I'm having a problem which I hope is very simple, but I'm new to Mathematica. I have 18 spheres, and I want to plot them in 3 dimensions. This is what I tried: Needs["Graphics`Shapes`"]; Show[ TranslateShape[Graphics3D[Sphere[]],{15, 35, 12}], TranslateShape[Graphics3D[Sphere[]],{85, 3, 10}], TranslateShape[Graphics3D[Sphere[]],{1, 3, 13}], TranslateShape[Graphics3D[Sphere[]],{1, 12, 8}], TranslateShape[Graphics3D[Sphere[]],{0, 0, 0}], TranslateShape[Graphics3D[Sphere[]],{17, 0, 2}], TranslateShape[Graphics3D[Sphere[]],{10, 200, 200}], TranslateShape[Graphics3D[Sphere[]],{200, 10, 26}], TranslateShape[Graphics3D[Sphere[]],{11, 70, 25}], TranslateShape[Graphics3D[Sphere[]],{3, 2, 17}], TranslateShape[Graphics3D[Sphere[]],{24, 0, 1}], TranslateShape[Graphics3D[Sphere[]],{0, 0, 1}], TranslateShape[Graphics3D[Sphere[]],{51, 0, 4}], TranslateShape[Graphics3D[Sphere[]],{10, 0, 1}], TranslateShape[Graphics3D[Sphere[]],{0, 0, 0}], TranslateShape[Graphics3D[Sphere[]],{4, 0, 0}], TranslateShape[Graphics3D[Sphere[]],{1, 0, 0}], TranslateShape[Graphics3D[Sphere[]],{1, 1, 5}] ]; However, not all the spheres get plotted. For example, (10, 200, 200) is not plotted. So I decided to try adding them one at a time. I got this far Needs["Graphics`Shapes`"]; Show[ TranslateShape[Graphics3D[Sphere[]],{15, 35, 12}], TranslateShape[Graphics3D[Sphere[]],{85, 3, 10}], TranslateShape[Graphics3D[Sphere[]],{1, 3, 13}], TranslateShape[Graphics3D[Sphere[]],{1, 12, 8}], TranslateShape[Graphics3D[Sphere[]],{0, 0, 0}] ]; And everything was plotted. However, when I added one more point Needs["Graphics`Shapes`"]; Show[ TranslateShape[Graphics3D[Sphere[]],{15, 35, 12}], TranslateShape[Graphics3D[Sphere[]],{85, 3, 10}], TranslateShape[Graphics3D[Sphere[]],{1, 3, 13}], TranslateShape[Graphics3D[Sphere[]],{1, 12, 8}], TranslateShape[Graphics3D[Sphere[]],{0, 0, 0}], TranslateShape[Graphics3D[Sphere[]],{10, 200, 200}] ]; All of a sudden it looked like neither (10, 200, 200) nor (85, 3, 10) were plotted any more. I decided trying to take out one point Needs["Graphics`Shapes`"]; Show[ TranslateShape[Graphics3D[Sphere[]],{15, 35, 12}], TranslateShape[Graphics3D[Sphere[]],{85, 3, 10}], TranslateShape[Graphics3D[Sphere[]],{1, 12, 8}], TranslateShape[Graphics3D[Sphere[]],{0, 0, 0}], TranslateShape[Graphics3D[Sphere[]],{10, 200, 200}] ]; And everything was OK again. So, as far as I can tell, if I have more than 5 arguments to Show, it doesn't show all of them. To see if it might have anything to do with the Sphere function, I substituted Cuboids, bu t I got exactly the same problem. The same pattern of objects was not plotted. Show[ Graphics3D[Cuboid[{15, 35, 12}]], Graphics3D[Cuboid[{85, 3, 10}]], Graphics3D[Cuboid[{1, 3, 13}]], Graphics3D[Cuboid[{1, 12, 8}]], Graphics3D[Cuboid[{0, 0, 0}]], Graphics3D[Cuboid[{17, 0, 2}]], Graphics3D[Cuboid[{10, 200, 200}]], Graphics3D[Cuboid[{200, 10, 26}]], Graphics3D[Cuboid[{11, 70, 25}]], Graphics3D[Cuboid[{3, 2, 17}]], Graphics3D[Cuboid[{24, 0, 1}]], Graphics3D[Cuboid[{0, 0, 1}]], Graphics3D[Cuboid[{51, 0, 4}]], Graphics3D[Cuboid[{10, 0, 1}]], Graphics3D[Cuboid[{0, 0, 0}]], Graphics3D[Cuboid[{4, 0, 0}]], Graphics3D[Cuboid[{1, 0, 0}]], Graphics3D[Cuboid[{1, 1, 5}]] ]; Any ideas why Mathematica isn't drawing everything it's being asked to draw? Thanks to anyone who can help!