From: S. B. Gray on 28 May 2010 07:21 I would appreciate advice on these questions: 1. Why do I need Table in this expression: ParametricPlot3D[Table[{(Cos[ang] xb + Sin[ang] yb)*radb + cenb, (Cos[ang] xa + Sin[ang] ya)*rada + cena}^], {ang, 0, 2\[Pi]}, PlotStyle -> {Blue, Thickness[.01]}] 2. In the no-Table form that I expected to work, ParametricPlot3D[{(Cos[ang] xb + Sin[ang] yb)*radb + cenb, (Cos[ang] xa + Sin[ang] ya)*rada + cena}, {ang, 0, 2\[Pi]}, PlotStyle -> {Blue, Thickness[.01]}] the Blue option works only for the first line and the Thickness option works only on the second line. (?) The first version (1.) works correctly but I don't know the syntax for giving each circle a different color. In actual use I will have a dozen or more circles and it is desirable to make every one have a different color. 3. In the first version I have put a ^ after "cena}" as a substitute for a similar symbol put there by Mathematica that's aligned with the bottom of the line. I think it's a warning but I don't know what it means. The plot works correctly even with it. Steve Gray
From: Bill Rowe on 29 May 2010 04:45 On 5/28/10 at 7:21 AM, stevebg(a)ROADRUNNER.COM (S. B. Gray) wrote: >I would appreciate advice on these questions: >1. Why do I need Table in this expression: >ParametricPlot3D[Table[{(Cos[ang] xb + Sin[ang] yb)*radb + cenb, >(Cos[ang] xa + Sin[ang] ya)*rada + cena}^], {ang, 0, 2\[Pi]}, >PlotStyle -> {Blue, Thickness[.01]}] >2. In the no-Table form that I expected to work, >ParametricPlot3D[{(Cos[ang] xb + Sin[ang] yb)*radb + cenb, (Cos[ang] >xa + Sin[ang] ya)*rada + cena}, >{ang, 0, 2\[Pi]}, PlotStyle -> {Blue, Thickness[.01]}] >the Blue option works only for the first line and the Thickness >option works only on the second line. (?) The first version (1.) >works correctly but I don't know the syntax for giving each circle a >different color. In actual use I will have a dozen or more circles >and it is desirable to make every one have a different color. >3. In the first version I have put a ^ after "cena}" as a substitute >for a similar symbol put there by Mathematica that's aligned with >the bottom of the line. I think it's a warning but I don't know what >it means. The plot works correctly even with it. The code you posted is incomplete making it impossible for me to evaluate it and determine exactly what the difference are that you are seeing. But having said that, my guess is the issue is the way Mathematica plotting works. Basically, Mathematica substitutes numeric values for the dependent variable then evaluates the expression to be plotted rather than first evaluating the expression then substituting a numeric value for the dependent variable. This is key to understanding how to get plots in various colors. For example doing Plot[Table[n Sin[x], {n, 3}], {x, 0, 2 \[Pi]}] results in a plot with three curves all the same color. Since Mathematica assigns values to x before evaluating the Table construct, the three numeric values returned by the Table construct are seen as a single multi-valued function. Consequently, only the first item of any PlotStyle directive list is applied to all three curves. Contrast this with a = Table[n Sin[x], {n, 3}]; Plot[a, {x, 0, 2 \[Pi]}] Now the result is the same three curves with three different colors. Here a has Head List which Mathematica sees as a list of three single valued functions. Now, a list of PlotStyle directives work as expected with the first directive in the list being applied to the first function and so on. The same result can be obtained by using Evaluate as follows: Plot[Evaluate(a)Table[n Sin[x], {n, 3}], {x, 0, 2 \[Pi]}] Here, the Table construct is forced to evaluate before any numerica assignment is made by Plot. The result is something with Head LIst which Mathematica sees as three single valued functions. My guess is inserting Evaluate in front of Table as I do here in the preceding example will result in the plot you are looking for.
From: David Park on 29 May 2010 04:45 There are no definitions for most of the variables in your posted expression so it will never work. David Park djmpark(a)comcast.net http://home.comcast.net/~djmpark/ From: S. B. Gray [mailto:stevebg(a)ROADRUNNER.COM] I would appreciate advice on these questions: 1. Why do I need Table in this expression: ParametricPlot3D[Table[{(Cos[ang] xb + Sin[ang] yb)*radb + cenb, (Cos[ang] xa + Sin[ang] ya)*rada + cena}^], {ang, 0, 2\[Pi]}, PlotStyle -> {Blue, Thickness[.01]}] 2. In the no-Table form that I expected to work, ParametricPlot3D[{(Cos[ang] xb + Sin[ang] yb)*radb + cenb, (Cos[ang] xa + Sin[ang] ya)*rada + cena}, {ang, 0, 2\[Pi]}, PlotStyle -> {Blue, Thickness[.01]}] the Blue option works only for the first line and the Thickness option works only on the second line. (?) The first version (1.) works correctly but I don't know the syntax for giving each circle a different color. In actual use I will have a dozen or more circles and it is desirable to make every one have a different color. 3. In the first version I have put a ^ after "cena}" as a substitute for a similar symbol put there by Mathematica that's aligned with the bottom of the line. I think it's a warning but I don't know what it means. The plot works correctly even with it. Steve Gray
|
Pages: 1 Prev: exporting EPS files with Illustrator compatible fonts Next: Lists: how to? |