Re: Urgent Plot problem
- To: mathgroup at smc.vnet.net
- Subject: [mg32062] Re: Urgent Plot problem
- From: "Borut L" <borut at email.si>
- Date: Fri, 21 Dec 2001 03:57:37 -0500 (EST)
- References: <9vs8ck$g0m$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
I hope following helps,
Putting plots with different domain together:
a) you can do this by drawing two Plot's with DisplayFunction->Identity and
after that using them in Show[{plt1,plt2}] with
DisplayFunction->$DisplayFunction invoked.
b) The same thing is already done for you if you load <<Graphics`Graphics`
Add-On and use built-in DisplayTogether, which works self-explanatory.
In[22]:=
sol1 = NDSolve[{y'[t] == -1/100 y[t], y[0] == 1}, y, {t, 0, 200}][[1]]
Out[22]=
{y -> InterpolatingFunction[{{0., 200.}}, "<>"]}
In[30]:=
sol2 = NDSolve[{y'[t] == -1/100 y[t], y[200] == Exp[-2]},
y, {t, 200, 1000}][[1]]
Out[30]=
{y -> InterpolatingFunction[{{200., 1000.}}, "<>"]}
In[7]:=
<< Graphics`Graphics`
In[33]:=
DisplayTogether[
{
LogPlot[Evaluate[y[t] /. sol1], {t, 0, 200}, PlotStyle -> Hue[0]],
LogPlot[Evaluate[y[t] /. sol2], {t, 200, 1000}, PlotStyle -> Hue[.55]]
}
, PlotRange -> All
, Frame -> True
, Axes -> False
]
<deniz.seker at arcelik.com.tr> wrote in message
news:9vs8ck$g0m$1 at smc.vnet.net...
> Hi,
>
> I have a problem with Plot. For two different results of equations, I need
> to plot the results in one plot. For example, one domain has a range of
> 0-100 in x direction, and the other has a range of 200-1000. How can I
> comb,ne the results in one graph?
>
> regards,
>
> Deniz
>
>