It's easy enough to do this,
the question is "what does it MEAN?"
If you overlay two graphs, what comparisons will
people naturally make, and what do
you want them to make?
What transformations on the x axis would make
two vertically aligned points about the "same" thing?
What transformations on th
Thanks a lot Rui and Jim. Works great !
On Tue, Feb 7, 2023, 1:34 PM Rui Barradas wrote:
> Às 21:18 de 07/02/2023, Jim Lemon escreveu:
> > Hi Bogdan,
> > Try this:
> >
> > A<-data.frame(x=c(1,7,9,20),
> > y=c(39,91,100,3))
> > B<-data.frame(x=c(10,21,67,99,200),
> > y=c(9,89,1000,90,1001)) #
Às 21:18 de 07/02/2023, Jim Lemon escreveu:
Hi Bogdan,
Try this:
A<-data.frame(x=c(1,7,9,20),
y=c(39,91,100,3))
B<-data.frame(x=c(10,21,67,99,200),
y=c(9,89,1000,90,1001)) # one value omitted to equalize the rows
xrange<-range(c(unlist(A$x),unlist(B$x)))
yrange<-range(c(unlist(A$y),unlist(B$
Hi Bogdan,
Try this:
A<-data.frame(x=c(1,7,9,20),
y=c(39,91,100,3))
B<-data.frame(x=c(10,21,67,99,200),
y=c(9,89,1000,90,1001)) # one value omitted to equalize the rows
xrange<-range(c(unlist(A$x),unlist(B$x)))
yrange<-range(c(unlist(A$y),unlist(B$y)))
plot(A,type="l",xlim=xrange,ylim=yrange,col
Dear all,
Any suggestions on how I could overlay two or more graphs / plots / lines
that have different sizes and the x axes have different breakpoints.
One dataframe is : A :
on x axis : 1 , 7, 9, 20, etc ... (100 elements)
on y axis : 39, 91, 100, 3, etc ... (100 elements)
The other datafra
>> Hi
> >>
> >> You should use position dodge.
> >>
> >> p <- ggplot(iris, aes(x=Sepal.Length, colour=Species))
> >> p+geom_density()
> >> p <- ggplot(iris, aes(x=Sepal.Length, y=..density.., colour=Species))
> >&g
On Behalf Of Bogdan Tanasa
Sent: Wednesday, February 24, 2021 11:07 PM
To: r-help
Subject: [R] overlaying frequency histograms or density plots in R
Dear all, we do have a dataframe with a FACTOR called EXP that has 3
LEVELS ;
head(pp_ALL)
VALUE EXP
1 1639742 DMSO
2 1636822 DMSO
3
: PIKAL Petr
Cc: r-help
Subject: Re: [R] overlaying frequency histograms or density plots in R
Thanks a lot Petr !
shall i uses "dodge" also for the RELATIVE FREQUENCY HISTOGRAMS :
p <- ggplot(iris, aes(x=Sepal.Length, y=..count../sum(..count..)*100,
colour=Species))
p+g
p+geom_histogram(position="dodge")
>
> Cheers
> Petr
> > -Original Message-
> > From: R-help On Behalf Of Bogdan Tanasa
> > Sent: Wednesday, February 24, 2021 11:07 PM
> > To: r-help
> > Subject: [R] overlaying frequency histograms or de
ehalf Of Bogdan Tanasa
> Sent: Wednesday, February 24, 2021 11:07 PM
> To: r-help
> Subject: [R] overlaying frequency histograms or density plots in R
>
> Dear all, we do have a dataframe with a FACTOR called EXP that has 3
LEVELS ;
>
> head(pp_ALL)
> VALUE EXP
>
Dear all, we do have a dataframe with a FACTOR called EXP that has 3 LEVELS
;
head(pp_ALL)
VALUE EXP
1 1639742 DMSO
2 1636822 DMSO
3 1634202 DMSO
shall i aim to overlay the relative frequency histograms, or the density
histograms for the FACTOR LEVELS,
please would you let me know why the
On 4/22/20 7:31 AM, Cade, Brian S via R-help wrote:
Hi All. I am trying to construct a graph using the xYplot() function in Hmisc
package (thank you Frank Harrell) taking advantage of the Cbind() argument for
plotting the median, 10th, and 90th quantiles and also the cbind() argument for
in
Reproducible example with data via dput?
Code that you used that 'didn't work'?
Error messages or output and why it was not satisfactory?
Following the posting guide by providing such information is more
likely to generate useful answers and save both you and those who try
to help a lot of wasted
Hi All. I am trying to construct a graph using the xYplot() function in Hmisc
package (thank you Frank Harrell) taking advantage of the Cbind() argument for
plotting the median, 10th, and 90th quantiles and also the cbind() argument for
individual data values. I know how to do both of these se
Hi R-users,
I think that I have figured out what I should do. But I would welcome any
comments clarifying any of the questions that I have raised. (I am showing
my revised code below). The questions which are still unresolved for me are
the following :
1. With the points3d or the plot3D function,
Hi R users and experts,
I am interested in learning more about the use of 3D plots. Specifically, I
want to add points and lines to a surface plot. And get the axes and labels
plotted also. Here is what I have tried with an example data set :
library(rgl)
vol2 <- 2*volcano # Exaggerate the relief
erzonden: maandag 27 januari 2014 12:13
Aan: R-help
Onderwerp: [R] Overlaying two graphs using ggplot2 in R
Hi R Users,
I was struggling to overlay two graphs created from the two different dataset
using ggplot2. Furthermore, I could not join means of the box plots.
I tried this way but did not w
2, more = F)
Duncan
Duncan Mackay
Department of Agronomy and Soil Science
University of New England
Armidale NSW 2351
Email: home: mac...@northnet.com.au
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Kristi Glover
Sent: Mon
On Jan 27, 2014, at 3:13 AM, Kristi Glover wrote:
> Hi R Users,
> I was struggling to overlay two graphs created from the two different dataset
> using ggplot2. Furthermore, I could not join means of the box plots.
>
> I tried this way but did not work. Any suggestions?
> dat1<-structure(list(s
Hi R Users,
I was struggling to overlay two graphs created from the two different dataset
using ggplot2. Furthermore, I could not join means of the box plots.
I tried this way but did not work. Any suggestions?
dat1<-structure(list(site = c(1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L,
2L, 2L, 3L, 3L,
Hi, I have a cloud of randomly distributed points in 2-dimensional space and
want to set up a grid, with a given grid-cell size, that minimizes the distance
between my points and the grid nodes. Does anyone know of an R function or
toolbox that somehow addresses this problem? This is a problem o
How about this?
require(FNN)
#FOR DEMONSTRATION PURPOSES, GENERATE 2D DATA
set.seed(3242)
X <- matrix(runif(50),ncol=2)
plot(X,pch=16,cex=1.5, asp=1)
#PLOT GRID
grid <- as.matrix(expand.grid(seq(0,1,by=.1),seq(0,1,by=.1)) )
abline(v=unique(grid[,1]),col="#FF30")
abline(h=unique(grid[,2]),co
Gonçalo,
Interesting question. You can use the optim() function to optimize a
function over two dimensions. Here's an example.
# some clumpy "cloud" data
myx <- c(0.3 + rnorm(50, 0, 0.05), 0.7 + rnorm(50, 0, 0.05))
myy <- c(0.45 + rnorm(50, 0, 0.05), 0.65 + rnorm(50, 0, 0.05))
# size of the fi
str(x) ; str(y) reveals
#zoo series ...
# ..$ : chr [1:3] "a" "c" "b" ## HERE
# Index: Date[1:100], format: "2010-01-01" "2010-01-02" "2010-01-03"
"2010-01-04" ...
#'data.frame':99 obs. of 3 variables:
# $ ID : Factor w/ 3 levels "a","b","c": ## HERE
# ..
Hello
Let's say I have a multivariate zoo timeseries (synchronised automatic
loggers at different places):
library(zoo)
library(lattice)
library(latticeExtra)
x<-zoo(data.frame(a=rnorm(100), c=rnorm(100), b=rnorm(100)),
seq(from=as.Date("2010-01-01"), by="day", length.out=100))
and a dataframe
Try this:
# define the locations on the x axis for each cell in the image
nxcells <- dim(m)[2]
xlocs <- (seq(nxcells)-1)/(nxcells-1)
# define the groupings
group <- rep(1:3, c(10, 20, 25))
# calculate the range of locations on the xaxis for each group
group.ranges <- sapply(split(xlocs, group),
Hi, I have a matrix that I am displaying via image. I would like to
obtain an image where the columns are 'grouped' (I have a grouping
variable). But I am not sure how how I can draw the lines to indicate
the grouping in the margin. I realize this is essentially waht heatmap
does but as I have a se
ealth, Medicine, and Life Sciences
Maastricht University, P.O. Box 616 (VIJV1)
6200 MD Maastricht, The Netherlands
+31 (43) 368-5248 | http://www.wvbauer.com
> -----Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
> On Behalf Of Michael D
From: Michael Dewey
To: "Frank Peter" , r-help@r-project.org
Subject: Re: [R] Overlaying density plot on forest plot
Date: Sun, 11 Dec 2011 14:20:13 +
> At 07:16 10/12/2011, Frank Peter wrote:
> >Dear R User,
> >
> >Please, I am new to R. I want to overlay density
At 07:16 10/12/2011, Frank Peter wrote:
Dear R User,
Please, I am new to R. I want to overlay density plot for predictive
interval pooled result in meta-analysis.
http://addictedtor.free.fr/graphiques/graphcode.php?graph=114
It is hard to be sure from your rather brief question but does the
Frank,
Have you tried the R function overlay(), it is exactly applying to your
question.
Jeff
--
View this message in context:
http://r.789695.n4.nabble.com/Overlaying-density-plot-on-forest-plot-tp4179654p4180430.html
Sent from the R help mailing list archive at Nabble.com.
__
Dear R User,
Please, I am new to R. I want to overlay density plot for predictive interval
pooled result in meta-analysis.
http://addictedtor.free.fr/graphiques/graphcode.php?graph=114
Regards
Frank Peter
__
R-help@r-project.org mailing list
https
Hi,
I'm trying to construct a heatmap using two matrices rather than one (Is this
possible?)
For example, matrix1: (color range black---> blue)
acr DPA1-0103 DPA1-0104 DPA1-0201 DPA1-0202
DPA1-0301
DPA1-0103 17 0 2 1 0
DPA1-0104
Using my mind-reading skills, plot.Map(), while deprecated, does provide an
add= option.
If this doesn't help, you'll need to read the posting guide and provide (a lot)
more
information.
Ray Brownrigg
On Thu, 19 May 2011, michael.laviole...@dhhs.state.nh.us wrote:
> I'm having difficulty over
I'm having difficulty overlaying maps when writing to a file graphics
device. My command sequence has the structure
plot(map1)
par(new = T)
plot(map2)
On the screen device, it works fine. When I attempt something like
png(file = "map.png")
plot(map1)
par(new = T)
plot(map2)
dev.off()
only the
age-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of Ryan Doherty
> Sent: Wednesday, April 13, 2011 11:45 PM
> To: r-help@r-project.org
> Subject: [R] Overlaying images at nodes of phylogenetic tree
>
> Can you recommend an R library th
Can you recommend an R library that will help me create a diagram of a
phylogenetic tree on which specific images are placed at appropriate nodes of
the tree?
For example, I have specific image files associated with each member of the
phylogenetic tree, and I would like to automate the display
--- On Sun, 3/27/11, Bulent Arikan wrote:
> From: Bulent Arikan
> Subject: [R] overlaying
> To: r-help@r-project.org
> Received: Sunday, March 27, 2011, 5:45 PM
> Dear List,
> I am working with a small (3 columns and 9 rows) data
> table, which contains
> 9 observation
t; To: r-help@r-project.org
> Subject: [R] overlaying
>
> Dear List,
> I am working with a small (3 columns and 9 rows) data table, which
> contains
> 9 observations, their mean values and standard deviations (I extracted
> these data from a huge set and I cannot use the origina
Dear List,
I am working with a small (3 columns and 9 rows) data table, which contains
9 observations, their mean values and standard deviations (I extracted these
data from a huge set and I cannot use the original data). I plotted means
(y-axis) and the observations (x-axis) using the " plot() " c
I have a program that creates a Png file using Rgooglemap with an extent
(lonmin,lonmax,latmin,latmax)
I also have a contour plot of the same location, same extent, same sized
(height/width) png file.
I'm looking for a way to make the contour semi transparent and overlay it on
the google map ( hyb
On Oct 13, 2010, at 11:44 AM, Jeremy Olson wrote:
Dear All,
I have 4 or 5 contour plots that I need to overlay. Currently they
are maps showing hot and cold areas for specific elements.
Providing paste-able examples is the standard way to present such
problems.
I would like to combine
Dear All,
I have 4 or 5 contour plots that I need to overlay. Currently they are maps
showing hot and cold areas for specific elements.
I would like to combine these plots into one map, where each color will
correspond to a different element and you would be able to see the areas that
each elem
Thanks so much for that elegant solution... it works extremely well.
I'm now trying to add lines, points and polygons to show transects,
locations of the original data points and the bounding polygon of the study
area. Presumably I can use panel.polygonsplot, panel.pointsplot for this?
--
Vie
You are plotting the entire lattice plot (including axes, margins etc)
in the grid viewport. What you want to do is to call the panel
function, panel.levelplot(), instead.
However, why not just
mm <- map('worldHires', plot = FALSE)
levelplot(z~x+y,xyz, mm = mm, panel = function(..., mm) {
pan
You don't have to use map() to draw the map.
m <- map(..., plot = FALSE)
xyplot(y ~ x, m, type = "l", aspect = "iso",
par.settings = list(axis.line = list(col = "transparent")))
or inside a panel function, assuming appropriate scales:
panel.xyplot(m$x, m$y, ...)
On 23 April 2010 04:38, David
Thanks for those pointers making some progress now
The following will put the levelplot on to the map, but the not with the
co-ordinates aligned...
The level plot appears on a slightly larger scale compared to the underlying
map.
In both the map and levelplot, the coordinates are in lon, lat
On Apr 22, 2010, at 2:24 PM, Kevin Wright wrote:
Mixing base/lattice graphics can be tricky, but is possible.
http://www.bioconductor.org/CRAN/web/packages/gridBase/vignettes/gridBase.pdf
That could be quite useful in the future. Thanks for that.
Also, did you look at Chapter 13 of the la
Mixing base/lattice graphics can be tricky, but is possible.
http://www.bioconductor.org/CRAN/web/packages/gridBase/vignettes/gridBase.pdf
Also, did you look at Chapter 13 of the lattice book?
http://lmdvr.r-forge.r-project.org/figures/figures.html
Kevin
On Wed, Apr 21, 2010 at 2:08 PM, David
On Apr 22, 2010, at 5:33 AM, Simon Goodman wrote:
Thanks for the suggestions Unfortunately contour won't in this
case as it
expects the x,y values to be in an ascending sequence.
?order
David Winsemius, MD
West Hartford, CT
__
R-help@r
Thanks for the suggestions Unfortunately contour won't in this case as it
expects the x,y values to be in an ascending sequence.
--
View this message in context:
http://r.789695.n4.nabble.com/overlaying-a-levelplot-on-a-map-plot-tp2019419p2020292.html
Sent from the R help mailing list ar
Try using contour() instead of levelplot. See the examples
in help('contour') for how to add contour lines to an
existing plot.
-Peter Ehlers
On 2010-04-21 13:08, David Winsemius wrote:
On Apr 21, 2010, at 2:27 PM, Simon Goodman wrote:
I've generated a levelplot showing the density distrib
On Apr 21, 2010, at 2:27 PM, Simon Goodman wrote:
I've generated a levelplot showing the density distribution of a
species
derived from survey transects, with lon, lat co-ordinates.
I'd like to overlay this on a map of the study region specified by:
map('worldHires', xlim = range(mlon), y
I've generated a levelplot showing the density distribution of a species
derived from survey transects, with lon, lat co-ordinates.
I'd like to overlay this on a map of the study region specified by:
map('worldHires', xlim = range(mlon), ylim = range(mlat)), where mlon, mlat
specifies the study
Hello,
I was following an example on The ROCR Package pdf, learning to overlay ROC
curves on the same plot using the add = TRUE statement. I used this one:
data(ROCR.hiv)
attach(ROCR.hiv)
pred.svm <- prediction(hiv.svm$predictions, hiv.svm$labels)
perf.svm <- performance(pred.svm, 'tpr', 'fp
n...@r-
> project.org] On Behalf Of dxc13
> Sent: Wednesday, May 13, 2009 12:06 PM
> To: r-help@r-project.org
> Subject: [R] Overlaying two plots
>
>
> Hi useR's,
>
> I want to overlay an image plot over a world map and I can do it, but
> just
> not the way I need
Hi useR's,
I want to overlay an image plot over a world map and I can do it, but just
not the way I need to do it. Here is the code I am using (with data file
attached) to create my baseline map:
library(sp)
load("TM_WORLD_BORDERS_SIMPL-0.2.RData")
par(bty="l")
plot(wrld_simpl, axes = TRUE, ylim
On Thu, Apr 30, 2009 at 2:03 PM, MUHC-Research
wrote:
>
> Dear R-users,
>
> I recently began using the ggplot2 package and I am still in the process of
> getting used to it.
>
> My goal would be to plot on the same grid a number of curves derived from
> two distinct datasets. The first dataset (ca
Dear R-users,
I recently began using the ggplot2 package and I am still in the process of
getting used to it.
My goal would be to plot on the same grid a number of curves derived from
two distinct datasets. The first dataset (called molten.data) looks like
this :
Column names : Perc, Week, Weig
Dear Marion,
Take a look at the first example in ?pairs.
HTH,
Jorge
On Thu, Apr 30, 2009 at 7:21 AM, Marion Dumas wrote:
> Hello
> I have a multivariate data frame giving various responses for several
> treatments. I would like to plot the relationship in the responses in a
> pairs plot with
Hello
I have a multivariate data frame giving various responses for several
treatments. I would like to plot the relationship in the responses in
a pairs plot with different symbols for the different treatments. In a
regular plot I would have used 'matplot' or just added the new
treatment
Another option,
library(ggplot2)
qplot(year, value, data=melt(foo), color= L1)
which can also be achieved "by hand",
test<- do.call(rbind,foo) # combines all data.sets
test$name <- do.call(rep, list(x=names(foo), times =
unlist(lapply(foo,nrow # append the name of the original dataset
Create a zoo object z and plot it:
library(zoo)
f <- function(x) zoo(x$data, levels(x$year)[x$year])
z <- do.call(merge, lapply(foo, f))
plot(z, screen = 1, col = 1:6, pch = 1:6, type = "o",
ylab = "data", xlab = "year")
legend("topright", legend = 1:6, lty = 1, pch = 1:6, col = 1:6)
See
Hello R list,
I have a list of data frames, in the form (dump output for an example
list follows message):
$site1
yeardata
1 2000 0.03685042
2 2001 0.02583885
6 2005 0.02480015
7 2006 0.03458745
$site2
year data
1 2002 4.071134e-03
2 2003 -4.513524e-08
3 2004 8.336272e
On 1/6/09, Assaf oron wrote:
> Hi all,
>
> I want to create a rather standard overlaid qqnorm plot on a single
> variable, with different subgroups of the same dataset plotted using
> different colors/symbols/etc. (I don't want side-by-side, rather
> different-colored curves on the same graph)
Hi all,
I want to create a rather standard overlaid qqnorm plot on a single
variable, with different subgroups of the same dataset plotted using
different colors/symbols/etc. (I don't want side-by-side, rather
different-colored curves on the same graph)
I managed to do it rather tediously using "
ix 'xx'
should contain only the corresponding elements in x, rest all should be
NA.
Any ideas for this?
Thanks, Shubha
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Shubha Vishwanath Karanth
Sent: Monday, June 09, 2008 4:57 PM
To: [EMAIL PROTEC
.htm
- Original Message -
From: "Shubha Vishwanath Karanth" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 09, 2008 1:26 PM
Subject: [R] Overlaying the matrices
Hi R,
I have a matrix,
x1=matrix(NA,6,6,dimnames=list(letters[1:6],LETTERS[1:6]))
Perhaps somethink like about this:
x1[rownames(x2),colnames(x2)] <- x2
x1
On Mon, Jun 9, 2008 at 8:26 AM, Shubha Vishwanath Karanth <
[EMAIL PROTECTED]> wrote:
> Hi R,
>
>
>
> I have a matrix,
>
>
>
> > x1=matrix(NA,6,6,dimnames=list(letters[1:6],LETTERS[1:6]))
>
> > x1
>
> A B C D E F
>
Hi R,
I have a matrix,
> x1=matrix(NA,6,6,dimnames=list(letters[1:6],LETTERS[1:6]))
> x1
A B C D E F
a NA NA NA NA NA NA
b NA NA NA NA NA NA
c NA NA NA NA NA NA
d NA NA NA NA NA NA
e NA NA NA NA NA NA
f NA NA NA NA NA NA
> x2=matrix(rpois(9,1),3,3,dimnames=list(c("b","a"
Deepayan:
Very nice, thanks for introducing me to a new resource. I will include the
entire, functioning example in the event others may find it useful.
--Seth
## Sample code for overlaying data points on a contour graph, using
xyplot and contourplot ##
library(lattice)
mo
Hi Seth,
An alternative would be to use ggplot2, http://had.co.nz/ggplot2:
model <- function(a,b,c,X1,X2) {
(exp(a + b*X1 + c*X2)) / (1 + exp(a + b*X1 + c*X2))
}
g <- expand.grid(X1 = seq(0.40, 0.8,0.01), X2 = seq(0.03,0.99,0.03))
a <- -37.61
b <- 34.88
c <- 28.44
g$z<- model(a, b, c, g$X1,g$
On 12/13/07, Seth W Bigelow <[EMAIL PROTECTED]> wrote:
>
> Friends: I wish to overlay data points on a contour graph. The following
> example produces a nice contour plot, but I have not mastered the concept
> of using panel functions to modify plots. Can someone show me how to
> overlay the data
Friends: I wish to overlay data points on a contour graph. The following
example produces a nice contour plot, but I have not mastered the concept
of using panel functions to modify plots. Can someone show me how to
overlay the data points (given after contour plot statement) on the
contourplot?
74 matches
Mail list logo