MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: combining graphics




Mark wrote:
 ----------
|From: "mahahn"@ccgate.com@PMDF@PAXMB1 To: mathgroup@smc.vnet.net
|To: ersek ted; "mathgroup"@smc.vnet.net@PMDF@PAXMB1 |Subject: [mg11307] [mg11223]
combining graphics |Date: Tuesday, March 03, 1998 3:37AM |
|<<File Attachment: 00000000.TXT>>
|how can I combine a barchart and a plot?  I doesn't work with
|Show[p1,p2]
|or with DisplayTogether[p1,p2].  Nothing is special about the plots. |
|I want to show a data bin count (bar chart) and weibull distribution
|over it.
|

Mark,
This is a very common problem.  You need to use Evaluate inside 
DisplayTogether (as below).
You need to do this because you have to ensure {p1,p2} is explicitly an 
expression in terms of (x).

Do you know about  DisplayFunction?
I use this to ensure the first two graphics are not displayed.  Since 
graphics is not displayed in the first two commands, I need to use it
again  to override the  earlier setting.

In[1]:=
<<Graphics`Graphics`


In[2]:=
p1=BarChart[{0.6,0.5,0.3,0.45,0.2,0.1},
     DisplayFunction->Identity]

Out[2]=
     -Graphics-


In[3]:=
<<Statistics`ContinuousDistributions`

In[4]:=
p2=Plot[PDF[WeibullDistribution[1,2],x],{x,-0,7},
     DisplayFunction->Identity]

Out[4]=
      -Graphics-


In[5]:=
DisplayTogether[Evaluate[{p1,p2}],
DisplayFunction->$DisplayFunction]

Out[5]
     -Graphics-

You get the graphic you want in Out[5].

Ted Ersek




  • Prev by Date: Re: How draw 3D Arrows?
  • Next by Date: sound with 2.2
  • Prev by thread: Re: combining graphics
  • Next by thread: Re: combining graphics