Re: How to use DisplayTogether[] properly?
- To: mathgroup at smc.vnet.net
- Subject: [mg15788] Re: How to use DisplayTogether[] properly?
- From: "Allan Hayes" <hay at haystack.demon.co.uk>
- Date: Sun, 7 Feb 1999 02:04:05 -0500 (EST)
- References: <79eas7$9k8@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
DisplayTogether has attribute HoldAll, The following works. <<Graphics`Graphics` DisplayTogether[ Evaluate[ Plot[#,{x,-3,3},DisplayFunction ->Identity]&/@{x,x^2} ] ] Allan --------------------- Allan Hayes Mathematica Training and Consulting www.haystack.demon.co.uk hay at haystack.demon.co.uk Voice: +44 (0)116 271 4198 Fax: +44 (0)870 164 0565 Cheng Lee Lung wrote in message <79eas7$9k8 at smc.vnet.net>... >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. > >