How to use DisplayTogether[] properly?
- To: mathgroup at smc.vnet.net
- Subject: [mg15744] How to use DisplayTogether[] properly?
- From: Cheng Lee Lung <eeacheng at cityu.edu.hk>
- Date: Fri, 5 Feb 1999 03:42:40 -0500 (EST)
- Organization: City University of Hong Kong
- Sender: owner-wri-mathgroup at wolfram.com
Dear All,
I have tried to write a program to plot multiple curves in a single plot
for a StudentTDistribution. I use the DisplayTogether to plot the
curves. Case 1 shows a nice plot but Case 2 is not. However, Case 2 is
more elegant if it works. Any one can help me or show me what's wrong
with Case 2. Many Thanks.
L L Cheng
City University of Hong Kong, Electronic Engineering Department. Phone :
(852) 27887755
email : eeacheng at cityu.edu.hk
<<Statistics`NormalDistribution`
<< Graphics`Graphics`
tdist=Table[StudentTDistribution[r],{r,1,20}] Case 1
DisplayTogether[Plot[tdf[[1]],{x, -4, 4}],Plot[tdf[[2]],{x,-3,3}],
Plot[tdf[[3]],{x,-3,3}],Plot[tdf[[4]],{x,-3,3}],Plot[tdf[[5]],{x,-3,3}],
Plot[tdf[[6]],{x,-3,3}],Plot[tdf[[7]],{x,-3,3}],Plot[tdf[[8]],{x,-3,3}],
Plot[tdf[[9]],{x,-3,3}],Plot[tdf[[20]],{x,-3,3}],
DisplayFunction->$DisplayFunction]
A nice plot is shown.
Case 2
DisplayTogether[Plot[#,{x,-3,3}]&/@tdf]
The error message shows:
\!\(Show[{
Map[Plot[#1, {x, \(-3\), 3}]&, {1\/\(\[Pi]\ \((1 + x\^2)\)\),
\((1\/\(2 + x\^2\))\)\^\(3/2\),
\(6\ \ at 3\)\/\(\[Pi]\ \((3 + x\^2)\)\^2\),
12\ \((1\/\(4 + x\^2\))\)\^\(5/2\),
\(200\ \ at 5\)\/\(3\ \[Pi]\ \((5 + x\^2)\)\^3\),
405\/2\ \((1\/\(6 + x\^2\))\)\^\(7/2\),
\(5488\ \ at 7\)\/\(5\ \[Pi]\ \((7 + x\^2)\)\^4\),
4480\ \((1\/\(8 + x\^2\))\)\^\(9/2\),
2519424\/\(35\ \[Pi]\ \((9 + x\^2)\)\^5\),
984375\/8\ \((1\/\(10 + x\^2\))\)\^\(11/2\)},
DisplayFunction \[Rule] Identity]},
DisplayFunction \[Rule] \((Display[$Display, #1]&)\)]\)
No plot is given.