Hey, I want to draw several plots sequently, but have to make them dispaly in one figure. So how to achieve this? Thanks. Fred
See help(layout). Henrik Bengtsson> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Feng Zhang > Sent: den 5 mars 2003 17:05 > To: R-Help > Subject: [R] How to draw several plots in one figure? > > > Hey, > > I want to draw several plots sequently, but have to make them > dispaly in one figure. So how to achieve this? > > Thanks. > > Fred > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > http://www.stat.math.ethz.ch/mailman/listinfo/> r-help > >
Thanks, Su. But I want to plot the several plots in the same x-y axis setting, not in multiple subplots. ----- Original Message ----- From: "Steve Su" <s.su at qut.edu.au> To: "Feng Zhang" <f0z6305 at labs.tamu.edu> Sent: Wednesday, March 05, 2003 12:29 AM Subject: Re: [R] How to draw several plots in one figure?> Dear Fred, > > try par(mfrow=c(2,2)) for example, gives four plots per page. Also try > trellis plots. > > Steve. > > > ----- Original Message ----- > From: "Feng Zhang" <f0z6305 at labs.tamu.edu> > To: "R-Help" <r-help at stat.math.ethz.ch> > Sent: Wednesday, March 05, 2003 4:05 PM > Subject: [R] How to draw several plots in one figure? > > > > Hey, > > > > I want to draw several plots sequently, but have to make them dispaly in > one > > figure. > > So how to achieve this? > > > > Thanks. > > > > Fred > > > > ______________________________________________ > > R-help at stat.math.ethz.ch mailing list > > http://www.stat.math.ethz.ch/mailman/listinfo/r-help >
One way is to make inital plot:>plot()Then build other data into the plot using: lines() points() etc. see help files for those Alternatively: set par(new=T) then plot again and the device wont be cleared J.>From: "Feng Zhang" <f0z6305 at labs.tamu.edu> >To: "Steve Su" <s.su at qut.edu.au> >CC: R-Help <r-help at stat.math.ethz.ch> >Subject: Re: [R] How to draw several plots in one figure? >Date: Wed, 5 Mar 2003 00:35:00 -0600 > >Thanks, Su. > >But I want to plot the several plots in the same >x-y axis setting, not in multiple subplots. >----- Original Message ----- >From: "Steve Su" <s.su at qut.edu.au> >To: "Feng Zhang" <f0z6305 at labs.tamu.edu> >Sent: Wednesday, March 05, 2003 12:29 AM >Subject: Re: [R] How to draw several plots in one figure? > > > > Dear Fred, > > > > try par(mfrow=c(2,2)) for example, gives four plots per page. Also try > > trellis plots. > > > > Steve. > > > > > > ----- Original Message ----- > > From: "Feng Zhang" <f0z6305 at labs.tamu.edu> > > To: "R-Help" <r-help at stat.math.ethz.ch> > > Sent: Wednesday, March 05, 2003 4:05 PM > > Subject: [R] How to draw several plots in one figure? > > > > > > > Hey, > > > > > > I want to draw several plots sequently, but have to make them dispaly >in > > one > > > figure. > > > So how to achieve this? > > > > > > Thanks. > > > > > > Fred > > > > > > ______________________________________________ > > > R-help at stat.math.ethz.ch mailing list > > > http://www.stat.math.ethz.ch/mailman/listinfo/r-help > > > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >http://www.stat.math.ethz.ch/mailman/listinfo/r-help
Paul Johnson
2003-Mar-05 13:25 UTC
Rtips still up (was Re: [R] How to draw several plots in one figure?
Dear Feng and everybody I still have my list of "how to" things for R and sometimes I even try to add more. Here's the address http://lark.cc.ku.edu/~pauljohn/R/statsRus.html I can't tell if you want to have several plots on the same page, in which case you should use this item: http://lark.cc.ku.edu/~pauljohn/R/statsRus.html#5.1 Of if you want a full overlay onto the exact same piece of paper, in which you should look at: http://lark.cc.ku.edu/~pauljohn/R/statsRus.html#5.11 When I first put up the R tips page, several of the R regulars checked it over for errors, but it has probably been a year or two since I got any advice, constructive or otherwise. I know new users still sometimes find it because I get follow up questions, but I'm always glad for more help. So, in case anybody has corrections or updates, please let me know. Feng Zhang wrote:> Hey, > > I want to draw several plots sequently, but have to make them dispaly in one > figure. > So how to achieve this? > > Thanks. > > Fred-- Paul E. Johnson email: pauljohn at ukans.edu Dept. of Political Science http://lark.cc.ku.edu/~pauljohn University of Kansas Office: (785) 864-9086 Lawrence, Kansas 66045 FAX: (785) 864-5700
Spencer Graves
2003-Mar-28 02:08 UTC
[R] A dead problem on deriving the derivative equation.
Do you want numbers? If yes, did you try programming KL(theta) as a function, then computing D.KL <- (KL(theta+delta)-KL(delta))/delta for some suitably small delta? Spencer Graves Feng Zhang wrote:> Hey, R-listers > > I was totally confused by a seemling simple first derivative > function. > Given the Kullback-Leibler divergence function between > a true pdf function P(x,theta) and an approximation pdf > function Q(theta)=q1(theta1)*q2(theta2)*...*qn(thetan), > where theta=[theta1,theta2, ..., thetan]''. > KL(Q||P) > = \integration Q(theta)*log(P(x,theta)/Q(theta)) dtheta > > So how to derive the first derivative of KL with respect > to theta1? > > Thanks for your helpful advices. > > Fred > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Spencer Graves
2003-Mar-28 03:01 UTC
[R] A dead problem on deriving the derivative equation.
If the limits of integration do not include theta, then you can interchange the order of integration and differentiation. To go beyond this, I think I would need more specifics. Spencer Graves p.s. You''ve got the negative of the standard KL divergence; see, e.g., "http://www.cis.hut.fi/aapo/papers/NCS99web/node26.html". Feng Zhang wrote:> Not for calculation on numbers, > just to derive the symbolic formulation with > theta, x.. > > > ----- Original Message ----- > From: "Spencer Graves" <spencer.graves at PDF.COM> > To: "Feng Zhang" <f0z6305 at labs.tamu.edu> > Cc: <r-help at stat.math.ethz.ch> > Sent: Thursday, March 27, 2003 6:08 PM > Subject: Re: [R] A dead problem on deriving the derivative equation. > > > >>Do you want numbers? If yes, did you try programming KL(theta) as a >>function, then computing >> >>D.KL <- (KL(theta+delta)-KL(delta))/delta >> >>for some suitably small delta? >> >>Spencer Graves >> >>Feng Zhang wrote: >> >>>Hey, R-listers >>> >>>I was totally confused by a seemling simple first derivative >>>function. >>>Given the Kullback-Leibler divergence function between >>>a true pdf function P(x,theta) and an approximation pdf >>>function Q(theta)=q1(theta1)*q2(theta2)*...*qn(thetan), >>>where theta=[theta1,theta2, ..., thetan]''. >>>KL(Q||P) >>>= \integration Q(theta)*log(P(x,theta)/Q(theta)) dtheta >>> >>>So how to derive the first derivative of KL with respect >>>to theta1? >>> >>>Thanks for your helpful advices. >>> >>>Fred >>> >>>______________________________________________ >>>R-help at stat.math.ethz.ch mailing list >>>https://www.stat.math.ethz.ch/mailman/listinfo/r-help >> >> > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Hey, R-listers I was totally confused by a seemling simple first derivative function. Given the Kullback-Leibler divergence function between a true pdf function P(x,theta) and an approximation pdf function Q(theta)=q1(theta1)*q2(theta2)*...*qn(thetan), where theta=[theta1,theta2, ..., thetan]''. KL(Q||P) = \integration Q(theta)*log(P(x,theta)/Q(theta)) dtheta So how to derive the first derivative of KL with respect to theta1? Thanks for your helpful advices. Fred
Not for calculation on numbers, just to derive the symbolic formulation with theta, x.. ----- Original Message ----- From: "Spencer Graves" <spencer.graves at PDF.COM> To: "Feng Zhang" <f0z6305 at labs.tamu.edu> Cc: <r-help at stat.math.ethz.ch> Sent: Thursday, March 27, 2003 6:08 PM Subject: Re: [R] A dead problem on deriving the derivative equation.> Do you want numbers? If yes, did you try programming KL(theta) as a > function, then computing > > D.KL <- (KL(theta+delta)-KL(delta))/delta > > for some suitably small delta? > > Spencer Graves > > Feng Zhang wrote: > > Hey, R-listers > > > > I was totally confused by a seemling simple first derivative > > function. > > Given the Kullback-Leibler divergence function between > > a true pdf function P(x,theta) and an approximation pdf > > function Q(theta)=q1(theta1)*q2(theta2)*...*qn(thetan), > > where theta=[theta1,theta2, ..., thetan]''. > > KL(Q||P) > > = \integration Q(theta)*log(P(x,theta)/Q(theta)) dtheta > > > > So how to derive the first derivative of KL with respect > > to theta1? > > > > Thanks for your helpful advices. > > > > Fred > > > > ______________________________________________ > > R-help at stat.math.ethz.ch mailing list > > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > >