Displaying 20 results from an estimated 20000 matches similar to: "two plots in one frame"
2004 Dec 09
4
Scatterplot question
Dear list members,
I have a probably simple question concerning scatterplots: I want to
draw a plot with one X but several Y columns, so that every group
of samples gets a different symbol. My table looks like this:
X Y1 Y2 Y3
1 1
2 3
3 5
4 7
5 9
6 11
7 13
8 15
Simple in Excel or StarOffice, but how do I do it in R?
Thanks a lot
Judith
2007 Jun 26
1
ylab at the right hand of a plot with two y axes
When I try to plot two lines ( or scatterplots) with different scales, this
is what I have been doing:
Suppose: I have y1 and y2 in a very different scale
y1 = 1:100
y2 = c(100:1)*10
To plot them on top of each other and denote by different colors: I have to
figure out the correct scale '10' and corresponding tick.vector and lables.
Then do:
plot(1:100, y1) # I can have
2006 Sep 28
3
complex plots using layout()
Dear r-help,
I am trying to plot several scatter plots with marginal histograms on
one page. Ideally, a page is equally divided into 4 figure regions.
Within each figure region, a scatter plot with marginal histograms will
be plotted.
I followed Dr. Paul Murrell's code released online to successfully plot
the scatter plot with marginal histograms. The code applies "layout()"
to
2010 Jun 02
1
lattice, xyplot, using "panel.segments" by just addressing one panel
Hi R experts,
I'm using the xyplot function in lattice to draw a multipanel plot consiting
of 5x6 scatterplots.
Now I need to link single points in each of those scatterplots (=panel),but
the points, that need linking are different for each panel.
I tried to use the panel.segments function for that, but I can't address
each panel separately. Links right for panel 1, show up in all other
2012 Nov 05
1
Plot 3 lines in one graph
I'm new with R. I want to plot 3 lines in one graph. This is my data:
print(x)
V1 V2 V3 V41 -4800 25195.73 7415.219 7264.282
-2800 15195.73 5415.219 7264.28
I tried using matplot, but I cannot get exactly what I want. This is what I
get, and this is my code:
matplot(x[,1],x[,-1],type='b', xlab = "epsilon_h",
ylab = "Value2", xlim=
2001 Nov 27
2
overlaying qqnorm plots...
I know this topic has had plenty of discussion in the last couple of days,
but....
I've been trying to compare the effects of different fitted methods for
systems of equations (OLS, SUR, 2SLS, 3SLS ) and would like to compare the
residual plots (easy) and the qqnorm/qqplot of the fits for the different
fitted methdos. For example,
qqnorm( residuals( lm( q ~ p + f + a ) ) )
par( new = TRUE )
2009 Feb 11
3
two scatter plots in one
Dear R users,
I need to compare two scatter plots,
plot(x1, y1)
plot(x2, y2)
and would like to plot them in the same figure. How do I do it?
Thank you.
--
View this message in context: http://www.nabble.com/two-scatter-plots-in-one-tp21963375p21963375.html
Sent from the R help mailing list archive at Nabble.com.
2010 Aug 30
3
Putting legend *outside* plotting area
Is there a simple way to put a legend outside the plot area for a simple
plot?
I found... (at http://www.harding.edu/fmccown/R/)
# Expand right side of clipping rect to make room for the legend
*par(xpd=T, mar=par()$mar+c(0,0,0,4))*
# Graph autos (transposing the matrix) using heat colors,
# put 10% of the space between each bar, and make labels
# smaller with horizontal y-axis labels
2006 May 24
3
Regression line limited by the rage of values
Hi
In R, using plot(x,y) followed by abline(lm(y~x)) produces a graph
with a regression line spanning the whole plot . This means that the
line extends beyond the swarm of data points to the defined of default
plot region. With par(xpd=T) it will span the entire figure region. But
how can I limit a regression line to the data range, i.e between
(xmin,ymin) and (xmax,ymax)?
Sorry for
2007 Jul 25
3
aggregate.ts
Consider the following scrap of code:
> x<- ts(1:50,start=c(1,11),freq=12)
> y <- aggregate(x,nfreq=4)
> c(y)
[1] 6 15 24 33 42 51 60 69 78 87 96 105 114 123 132 141
> y
Error in rep.int("", start.pad) : invalid number of copies in rep.int()
> tsp(y)
[1] 1.833333 5.583333 4.000000
So we can aggregate into quarters, but we cannot print it using
2007 Jul 25
3
aggregate.ts
Consider the following scrap of code:
> x<- ts(1:50,start=c(1,11),freq=12)
> y <- aggregate(x,nfreq=4)
> c(y)
[1] 6 15 24 33 42 51 60 69 78 87 96 105 114 123 132 141
> y
Error in rep.int("", start.pad) : invalid number of copies in rep.int()
> tsp(y)
[1] 1.833333 5.583333 4.000000
So we can aggregate into quarters, but we cannot print it using
2008 Aug 15
6
continuous coloring of a polygon
R2.7.1, WinXP
Hi,
I have a polygon inside a circle as follows:
radius <- 3
x <- seq(-radius,radius,length=2000)
y <- sqrt(radius^2-x^2)
xx <- c(x,-x)
yy <- c(y,-y)
plot(xx,yy, xlim=c(-radius,radius),ylim=c(-radius,radius), type="l",
ylab="", xlab="", axes=F)
radius <- 2.7
x1 <- seq(-radius,radius,length=2000)
y1 <- sqrt(radius^2-x1^2)
2006 Mar 10
1
add trend line to each group of data in: xyplot(y1+y2 ~ x | grp...
Although this should be trivial, I'm having a spot of trouble.
I want to make a lattice plot of the format y1+y2 ~ x | grp but then fit a
lm to each y variable and add an abline of those models in different colors.
If the xyplot followed y~x|grp I would write a panel function as below, but
I'm unsure of how to do that with y1 and y2 without reshaping the data
before hand. Thoughts
2007 Nov 14
1
Changing the text in the strips of lattice plots and y axis
Dear R-helpers,
I am sorry for asking something I know has been
asked before, I have tried different combinations in
the strip function without success...
I am using version 2.5.1 and work on a PC.
I have barcharts generated from the following
formula:
barchart(y1+y2+y3~x | g)
I need to change the names of the variables y1,y2 or
y3 that currently appear in the strips, I have two
2013 Mar 05
2
multiple plots and looping assistance requested
Hi all, I have a couple of questions.
1) Is there a more effective way to remove the following pattern
(patternrm) from the station_id_Timeseries (see below)
patternrm <- c(_2000_4_OND, _2001_1_JFM, _2001_2_AMJ, _2001_3_JAS,
_2001_4_OND, _2002_1_JFM, _2002_2_AMJ, _2002_3_JAS, _2002_4_OND,
_2003_1_JFM, _2003_2_AMJ, _2003_3_JAS, _2003_4_OND, _2004_1_JFM,
_2004_2_AMJ, _2004_3_JAS, _2000_4_OND) #
2012 Jan 12
2
Points inside a polygon
I have a list of bounds for a series of polygons. I do understand the
formula to determine whether point i is within polygon X (X[x1] < i[x]
& X[x2] > i[x] & X[y1] < i[y] & X[y2] > i[y]), and I can apply this
throughout the dataset. However, this naive algorithm doesn't scale
very well. The data set contains 10,000 points consisting of (n,e)
pairs where I'm
2012 Dec 12
1
Multiple palettes on single plot don't get rendered when I use dev.copy2pdf
Hi All,
I'm having trouble with the colors on my screen getting translated to
the colors in the outputted .pdf document.
Here is a caricature of my problem:
par(mfrow=c(1,1))
x1 = rnorm(1000)
x2 = rnorm(1000)+10
y1 = rnorm(1000)+10
y2 = rnorm(1000)+10
palette(rainbow(6))
plot(x=x1,y=y1,col=y1,xlim=c(-10,20))
palette(heat.colors(6))
points(x=x2,y=y2,col=y2)
dev.copy2pdf(file =
2007 May 08
2
draw two plots on a single panel
Hi,
I have 2 dataset,
plot(data1)
plot(data2),
but it comes as two graphs, can I draw both on a single panel so I can
compare them?
Thanks
Pat
2008 Oct 29
1
Help with Plots
Hi there,
I am trying to have a connectivity graph (two plots at once) in R:
this is an example:
x1=sin((0:100)*2*pi/100)
y1=cos((0:100)*2*pi/100)
plot(x1,y1)
will draw a circle and
x2=c(1,9,3,4,8,4,2,0)
y2=c(3,6,8,2,4,1,9,6)
plot(x2,y2,type="b")
will draw a graph with corresponding x's and y's and connects the point.
I want to have a circle with these points connected to
2018 May 20
3
Loop Function to Create Multiple Scatterplots
Hello,
I am trying to create multiple scatter plot graphs. I have 1 independent
variable (Age - weeks post conception) and 18 dependent variables ("Gene n"
Expression) in one csv file. Is there a way to set up a looped function to
produce 18 individual scatterplots? At the moment, I am writing the plot()
function out 18 times to make the 18 graphs. My code is below and csv file
is