Re: [R] Plotting contour & filled.contour in one graph
Dear Spencer, Thanks for the assistance and the website. It will be very helpful for my future code programming on graph in R. Abd. Rahman - Original Message - From: "Spencer Graves" <[EMAIL PROTECTED]> To: "Michael Prager" <[EMAIL PROTECTED]> Cc: "Gabor Grothendieck" <[EMAIL PROTECTED]>; "R Help List" ; "Abd Rahman Kassim" <[EMAIL PROTECTED]> Sent: Sunday, February 12, 2006 12:40 PM Subject: Re: [R] Plotting contour & filled.contour in one graph > > Hi, Michael: > > I'm sure the example would be clearer AND more interesting if you used > real data AND accompanied it with a description like you gave below. To > help motivate the usage, you could add a few words of interpretation, > e.g., that if you want both z and zz less than 2, x and y must be in the > upper right corner. > > Thanks for this. > spencer graves > > Michael Prager wrote: >> GG >> >> Yes, gladly. It is an idealized example of the following data situation: >> There are two control or "independent variables." They are represented >> here as x and y, on the horizontal and vertical axes respectively. There >> are two different responses or "dependent" variables plotted as different >> types of contours. The filled contours show response z. The heavy lines >> show response zz. >> >> Thus such a plot displays two different responses from a two-dimensional >> range of conditions. As an example, in fishery biology, x might be the >> age at which fish are first subject to capture, y might be the fishing >> mortality rate (intensity) applied, z might be the resulting yield per >> fish, and zz might be the resulting spawning per fish. There is usually >> a trade-off between yield and spawning potential, and such a graph (if >> done with real data) allows one to look at that trade-off. The OP seemed >> to be seeking a way of contouring two responses against two independent >> variables, and that's what this graph does. >> >> Is that clearer? Would the graph would be better if I used real data? >> >> MHP >> >> >> >> Gabor Grothendieck wrote on 2/12/2006 11:31 AM: >> >>>Could you walk us through, in detail, what that graph is showing? >>> >>> >>>On 2/12/06, Michael Prager <[EMAIL PROTECTED]> wrote: >>> >>>>Besides the answers you already have, you might look at my "4D" graph >>>>example (with code) on the R Graphics Gallery: >>>> >>>>http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=90 >>>> >>>>I think it does exactly what you are asking, and therefore it might fit >>>>your needs with only slight code modification. >>>> >>>>Mike Prager >>>> >>>> >>>>Abd Rahman Kassim wrote on 2/12/2006 11:12 PM: >>>> >>>>>Dear All, >>>>> >>>>>I have a question on overlaying a filled.contour (e.g. on soil >>>>>properties data) and contour (by elevation) in one graph. Both have the >>>>>same z matrix dimension. I'm able to overlay both graph, but the plots >>>>>dimension did not overlap well on the same plots. How can I have both >>>>>filled.contour and contour on the same graph? The commands that I have >>>>>written are as follows: >>>>> >>>>>filled.contour(0:15,0:10,t(matrix(Total.C,nrow=11,ncol=16))) >>>>>contour(0:15,0:10,as.matrix(elev),add=T) >>>>> >>>>>Thanks for anay assistance. >>>>> >>>>>Regards. >>>>> >>>>> >>>>>Abd Rahman Kassim >>>>>Forest Research Institute Malaysia >>>>>Kepong 52109 >>>>>Selangor, MALAYSIA >>>>> >>>>>* >>>>> >>>>> >>>>>* >>>>> [[alternative HTML version deleted]] >>>>> >>>>>__ >>>>>[email protected] mailing list >>>>>https://stat.ethz.ch/mailman/listinfo/r-help >>>>>PLEASE do read the posting guide! >>>>>http://www.R-project.org/posting-guide.html >>>>> >>>>> >>>> >>>>-- >>>>Michael H. Prager, Ph.D. >>>>Population Dynamics Team >>>>NOAA Center for Coastal Habitat and Fisheries Research >>>>NMFS Southeast Fisheries Science Center >>>>Beaufort, North Carolina 28516 USA >>>>http://shrimp.ccfhrb.noaa.gov/~mprager/ >>>> >>>>__ >>>>[email protected] mailing list >>>>https://stat.ethz.ch/mailman/listinfo/r-help >>>>PLEASE do read the posting guide! >>>>http://www.R-project.org/posting-guide.html >>>> >>>> >> >> > > > * > Outgoing mail is certified Virus Free. > Checked by TrendMicro Interscan Messaging Security. > For any enquiries, please contact FRIM IT Department. > * __ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Plotting contour & filled.contour in one graph
Hi, Michael: I'm sure the example would be clearer AND more interesting if you used real data AND accompanied it with a description like you gave below. To help motivate the usage, you could add a few words of interpretation, e.g., that if you want both z and zz less than 2, x and y must be in the upper right corner. Thanks for this. spencer graves Michael Prager wrote: > GG > > Yes, gladly. It is an idealized example of the following data > situation: There are two control or "independent variables." They are > represented here as x and y, on the horizontal and vertical axes > respectively. There are two different responses or "dependent" > variables plotted as different types of contours. The filled contours > show response z. The heavy lines show response zz. > > Thus such a plot displays two different responses from a two-dimensional > range of conditions. As an example, in fishery biology, x might be the > age at which fish are first subject to capture, y might be the fishing > mortality rate (intensity) applied, z might be the resulting yield per > fish, and zz might be the resulting spawning per fish. There is usually > a trade-off between yield and spawning potential, and such a graph (if > done with real data) allows one to look at that trade-off. > > The OP seemed to be seeking a way of contouring two responses against > two independent variables, and that's what this graph does. > > Is that clearer? Would the graph would be better if I used real data? > > MHP > > > > Gabor Grothendieck wrote on 2/12/2006 11:31 AM: > >>Could you walk us through, in detail, what that graph is showing? >> >> >>On 2/12/06, Michael Prager <[EMAIL PROTECTED]> wrote: >> >> >>>Besides the answers you already have, you might look at my "4D" graph >>>example (with code) on the R Graphics Gallery: >>> >>>http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=90 >>> >>>I think it does exactly what you are asking, and therefore it might fit >>>your needs with only slight code modification. >>> >>>Mike Prager >>> >>> >>>Abd Rahman Kassim wrote on 2/12/2006 11:12 PM: >>> >>> Dear All, I have a question on overlaying a filled.contour (e.g. on soil properties data) and contour (by elevation) in one graph. Both have the same z matrix dimension. I'm able to overlay both graph, but the plots dimension did not overlap well on the same plots. How can I have both filled.contour and contour on the same graph? The commands that I have written are as follows: filled.contour(0:15,0:10,t(matrix(Total.C,nrow=11,ncol=16))) contour(0:15,0:10,as.matrix(elev),add=T) Thanks for anay assistance. Regards. Abd Rahman Kassim Forest Research Institute Malaysia Kepong 52109 Selangor, MALAYSIA * * [[alternative HTML version deleted]] __ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >>> >>>-- >>>Michael H. Prager, Ph.D. >>>Population Dynamics Team >>>NOAA Center for Coastal Habitat and Fisheries Research >>>NMFS Southeast Fisheries Science Center >>>Beaufort, North Carolina 28516 USA >>>http://shrimp.ccfhrb.noaa.gov/~mprager/ >>> >>>__ >>>[email protected] mailing list >>>https://stat.ethz.ch/mailman/listinfo/r-help >>>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >>> >>> > > __ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Plotting contour & filled.contour in one graph
GG Yes, gladly. It is an idealized example of the following data situation: There are two control or "independent variables." They are represented here as x and y, on the horizontal and vertical axes respectively. There are two different responses or "dependent" variables plotted as different types of contours. The filled contours show response z. The heavy lines show response zz. Thus such a plot displays two different responses from a two-dimensional range of conditions. As an example, in fishery biology, x might be the age at which fish are first subject to capture, y might be the fishing mortality rate (intensity) applied, z might be the resulting yield per fish, and zz might be the resulting spawning per fish. There is usually a trade-off between yield and spawning potential, and such a graph (if done with real data) allows one to look at that trade-off. The OP seemed to be seeking a way of contouring two responses against two independent variables, and that's what this graph does. Is that clearer? Would the graph would be better if I used real data? MHP Gabor Grothendieck wrote on 2/12/2006 11:31 AM: > Could you walk us through, in detail, what that graph is showing? > > > On 2/12/06, Michael Prager <[EMAIL PROTECTED]> wrote: > >> Besides the answers you already have, you might look at my "4D" graph >> example (with code) on the R Graphics Gallery: >> >> http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=90 >> >> I think it does exactly what you are asking, and therefore it might fit >> your needs with only slight code modification. >> >> Mike Prager >> >> >> Abd Rahman Kassim wrote on 2/12/2006 11:12 PM: >> >>> Dear All, >>> >>> I have a question on overlaying a filled.contour (e.g. on soil properties >>> data) and contour (by elevation) in one graph. Both have the same z matrix >>> dimension. I'm able to overlay both graph, but the plots dimension did not >>> overlap well on the same plots. How can I have both filled.contour and >>> contour on the same graph? The commands that I have written are as follows: >>> >>> filled.contour(0:15,0:10,t(matrix(Total.C,nrow=11,ncol=16))) >>> contour(0:15,0:10,as.matrix(elev),add=T) >>> >>> Thanks for anay assistance. >>> >>> Regards. >>> >>> >>> Abd Rahman Kassim >>> Forest Research Institute Malaysia >>> Kepong 52109 >>> Selangor, MALAYSIA >>> >>> * >>> >>> >>> * >>> [[alternative HTML version deleted]] >>> >>> __ >>> [email protected] mailing list >>> https://stat.ethz.ch/mailman/listinfo/r-help >>> PLEASE do read the posting guide! >>> http://www.R-project.org/posting-guide.html >>> >>> >> -- >> Michael H. Prager, Ph.D. >> Population Dynamics Team >> NOAA Center for Coastal Habitat and Fisheries Research >> NMFS Southeast Fisheries Science Center >> Beaufort, North Carolina 28516 USA >> http://shrimp.ccfhrb.noaa.gov/~mprager/ >> >> __ >> [email protected] mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >> >> -- Michael H. Prager, Ph.D. Population Dynamics Team NOAA Center for Coastal Habitat and Fisheries Research NMFS Southeast Fisheries Science Center Beaufort, North Carolina 28516 USA http://shrimp.ccfhrb.noaa.gov/~mprager/ __ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Plotting contour & filled.contour in one graph
Le 12.02.2006 18:20, Spencer Graves a écrit : > Hi Michael and Gabor: > > (...) > > MICHAEL: The "Addicted to R" web site with it's "R Graph Gallery" are > pretty. Is a companion package downloadable from CRAN Not yet. That's something i've wanted to do in a long time (since the beginning I think), but ... > , or are they > still looking for volunteers to create the necessary help files, etc.? > Anyone with ideas could volonteer something. Recently, i've done something so that users can make comments about specified regions of a graphic. See graph 29 for a first use of that toy, move the mouse on top of the graphic, you should see it .. . (I hope that works ok with several browsers, because javascript is involved) A little sister of the R Graph Gallery could be a movie gallery created with R. For example : * illustration of the CLT * convergence of the EM algorithm (there is an example here : http://addictedtor.free.fr/misc/smalEM.avi ) * kernel density estimation varying the bandwidth * etc Let me know if you feel like you want to help doing something Romain -- visit the R Graph Gallery : http://addictedtor.free.fr/graphiques mixmod 1.7 is released : http://www-math.univ-fcomte.fr/mixmod/index.php +---+ | Romain FRANCOIS - http://francoisromain.free.fr | | Doctorant INRIA Futurs / EDF | +---+ __ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Plotting contour & filled.contour in one graph
Hi Michael and Gabor: GABOR: Prager's '4D' graph looks to me like superimposed contours of both z and zz vs. (x, y), where z is indicated by the colors and pale lines, while "black contour lines are values of zz" (as indicated by the labeling). I once wrote a crudely similar function to prepare contour plots showing any number of z variables vs. (x, y), with each z variable using different colors of contours and filling not with solid colors but with cross hatching at different angles. A reagion of acceptability satisfying multiple inequality constraints would appear as all white, i.e., with no cross hatching, in such a plot. (Unfortunately, I never found the time to get the function adequately dubugged and packaged so others could easily use it.) MICHAEL: The "Addicted to R" web site with it's "R Graph Gallery" are pretty. Is a companion package downloadable from CRAN, or are they still looking for volunteers to create the necessary help files, etc.? Best Wishes, spencer graves Gabor Grothendieck wrote: > Could you walk us through, in detail, what that graph is showing? > > > On 2/12/06, Michael Prager <[EMAIL PROTECTED]> wrote: > >>Besides the answers you already have, you might look at my "4D" graph >>example (with code) on the R Graphics Gallery: >> >>http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=90 >> >>I think it does exactly what you are asking, and therefore it might fit >>your needs with only slight code modification. >> >>Mike Prager >> >> >>Abd Rahman Kassim wrote on 2/12/2006 11:12 PM: >> >>>Dear All, >>> >>>I have a question on overlaying a filled.contour (e.g. on soil properties >>>data) and contour (by elevation) in one graph. Both have the same z matrix >>>dimension. I'm able to overlay both graph, but the plots dimension did not >>>overlap well on the same plots. How can I have both filled.contour and >>>contour on the same graph? The commands that I have written are as follows: >>> >>>filled.contour(0:15,0:10,t(matrix(Total.C,nrow=11,ncol=16))) >>>contour(0:15,0:10,as.matrix(elev),add=T) >>> >>>Thanks for anay assistance. >>> >>>Regards. >>> >>> >>>Abd Rahman Kassim >>>Forest Research Institute Malaysia >>>Kepong 52109 >>>Selangor, MALAYSIA >>> >>>* >>> >>> >>>* >>> [[alternative HTML version deleted]] >>> >>>__ >>>[email protected] mailing list >>>https://stat.ethz.ch/mailman/listinfo/r-help >>>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >>> >> >>-- >>Michael H. Prager, Ph.D. >>Population Dynamics Team >>NOAA Center for Coastal Habitat and Fisheries Research >>NMFS Southeast Fisheries Science Center >>Beaufort, North Carolina 28516 USA >>http://shrimp.ccfhrb.noaa.gov/~mprager/ >> >>__ >>[email protected] mailing list >>https://stat.ethz.ch/mailman/listinfo/r-help >>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >> > > > __ > [email protected] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Plotting contour & filled.contour in one graph
Could you walk us through, in detail, what that graph is showing? On 2/12/06, Michael Prager <[EMAIL PROTECTED]> wrote: > Besides the answers you already have, you might look at my "4D" graph > example (with code) on the R Graphics Gallery: > > http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=90 > > I think it does exactly what you are asking, and therefore it might fit > your needs with only slight code modification. > > Mike Prager > > > Abd Rahman Kassim wrote on 2/12/2006 11:12 PM: > > Dear All, > > > > I have a question on overlaying a filled.contour (e.g. on soil properties > > data) and contour (by elevation) in one graph. Both have the same z matrix > > dimension. I'm able to overlay both graph, but the plots dimension did not > > overlap well on the same plots. How can I have both filled.contour and > > contour on the same graph? The commands that I have written are as follows: > > > > filled.contour(0:15,0:10,t(matrix(Total.C,nrow=11,ncol=16))) > > contour(0:15,0:10,as.matrix(elev),add=T) > > > > Thanks for anay assistance. > > > > Regards. > > > > > > Abd Rahman Kassim > > Forest Research Institute Malaysia > > Kepong 52109 > > Selangor, MALAYSIA > > > > * > > > > > > * > > [[alternative HTML version deleted]] > > > > __ > > [email protected] mailing list > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide! > > http://www.R-project.org/posting-guide.html > > > > -- > Michael H. Prager, Ph.D. > Population Dynamics Team > NOAA Center for Coastal Habitat and Fisheries Research > NMFS Southeast Fisheries Science Center > Beaufort, North Carolina 28516 USA > http://shrimp.ccfhrb.noaa.gov/~mprager/ > > __ > [email protected] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html > __ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Plotting contour & filled.contour in one graph
Besides the answers you already have, you might look at my "4D" graph example (with code) on the R Graphics Gallery: http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=90 I think it does exactly what you are asking, and therefore it might fit your needs with only slight code modification. Mike Prager Abd Rahman Kassim wrote on 2/12/2006 11:12 PM: > Dear All, > > I have a question on overlaying a filled.contour (e.g. on soil properties > data) and contour (by elevation) in one graph. Both have the same z matrix > dimension. I'm able to overlay both graph, but the plots dimension did not > overlap well on the same plots. How can I have both filled.contour and > contour on the same graph? The commands that I have written are as follows: > > filled.contour(0:15,0:10,t(matrix(Total.C,nrow=11,ncol=16))) > contour(0:15,0:10,as.matrix(elev),add=T) > > Thanks for anay assistance. > > Regards. > > > Abd Rahman Kassim > Forest Research Institute Malaysia > Kepong 52109 > Selangor, MALAYSIA > > * > > > * > [[alternative HTML version deleted]] > > __ > [email protected] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html > -- Michael H. Prager, Ph.D. Population Dynamics Team NOAA Center for Coastal Habitat and Fisheries Research NMFS Southeast Fisheries Science Center Beaufort, North Carolina 28516 USA http://shrimp.ccfhrb.noaa.gov/~mprager/ __ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Plotting contour & filled.contour in one graph
Dear Romain, Thanks a lot for the suggested website and program code. I got it run. Thanks. Abd. Rahman Kassim - Original Message - From: "Romain Francois" <[EMAIL PROTECTED]> To: "Abd Rahman Kassim" <[EMAIL PROTECTED]> Cc: Sent: Sunday, February 12, 2006 4:27 AM Subject: Re: [R] Plotting contour & filled.contour in one graph > > Le 13.02.2006 05:12, Abd Rahman Kassim a écrit : >> Dear All, >> >> I have a question on overlaying a filled.contour (e.g. on soil properties >> data) and contour (by elevation) in one graph. Both have the same z >> matrix dimension. I'm able to overlay both graph, but the plots dimension >> did not overlap well on the same plots. How can I have both >> filled.contour and contour on the same graph? The commands that I have >> written are as follows: >> >> filled.contour(0:15,0:10,t(matrix(Total.C,nrow=11,ncol=16))) >> contour(0:15,0:10,as.matrix(elev),add=T) >> >> Thanks for anay assistance. >> >> Regards. >> >> >> Abd Rahman Kassim >> Forest Research Institute Malaysia >> Kepong 52109 >> Selangor, MALAYSIA >> > Hi, > > The trick is to use the argument plot.axes of filled.contour > There are examples of that in ?filled.contour > > See also : > http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=128 > > Romain > > -- > visit the R Graph Gallery : http://addictedtor.free.fr/graphiques > mixmod 1.7 is released : http://www-math.univ-fcomte.fr/mixmod/index.php > +---+ > | Romain FRANCOIS - http://francoisromain.free.fr | > | Doctorant INRIA Futurs / EDF | > +---+ > > > > * > Outgoing mail is certified Virus Free. > Checked by TrendMicro Interscan Messaging Security. > For any enquiries, please contact FRIM IT Department. > * __ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Plotting contour & filled.contour in one graph
Le 13.02.2006 05:12, Abd Rahman Kassim a écrit : > Dear All, > > I have a question on overlaying a filled.contour (e.g. on soil properties > data) and contour (by elevation) in one graph. Both have the same z matrix > dimension. I'm able to overlay both graph, but the plots dimension did not > overlap well on the same plots. How can I have both filled.contour and > contour on the same graph? The commands that I have written are as follows: > > filled.contour(0:15,0:10,t(matrix(Total.C,nrow=11,ncol=16))) > contour(0:15,0:10,as.matrix(elev),add=T) > > Thanks for anay assistance. > > Regards. > > > Abd Rahman Kassim > Forest Research Institute Malaysia > Kepong 52109 > Selangor, MALAYSIA > Hi, The trick is to use the argument plot.axes of filled.contour There are examples of that in ?filled.contour See also : http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=128 Romain -- visit the R Graph Gallery : http://addictedtor.free.fr/graphiques mixmod 1.7 is released : http://www-math.univ-fcomte.fr/mixmod/index.php +---+ | Romain FRANCOIS - http://francoisromain.free.fr | | Doctorant INRIA Futurs / EDF | +---+ __ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
