Displaying 20 results from an estimated 20000 matches similar to: "multiple series on same graph"
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=
2009 Oct 09
1
subsetting key on qqmath
Dear R list,
The code below puts qq-plots for two of three groups on the one
plot. However the legend includes all three groups, ie the auto.key
ignores the subset instruction. Is there an easy way to get around
this, so that only those groups plotted are included in the legend?
y1<-rnorm(100); y2<-rnorm(100)+1; y3<-rnorm(100)+2; y<-c(y1,y2,y3)
2011 Mar 31
2
Graph many points without hiding some
I have a very large dataset with three variables that I need to graph using
a scatterplot. However I find that the first variable gets masked by the
other two, so the graph looks entirely different depending on the order of
variables. Does anyone have any suggestions how to manage this?
This code is an illustration of what I am dealing with:
x <- 10000
2010 Jul 22
5
legend in R plot
Hi all,
I am have some difficulty with the legend function.
I need to add a legend to describe the different line types in a plot. The
legend box is small.
It did not include sufficient length of each line type to help distinguish
the differnt line types.
Is there a way to fix this.
Thank you
Hannah
[[alternative HTML version deleted]]
2009 May 11
1
Legend in plots
Dear R users,
I have what I think it is a very simple question concerning plots in R. If
you could help me I would be very grateful.
How can I include a legend in my plot? Below I give an example of my data
and the code I am using.
What I wish to accomplish is a legend saying that the black line refers to
"A", the red to "B" and the blue to "C". Any suggestions?
2009 Jun 17
1
problem with axis alignment when plotting 2 time series on same graph
I am trying to plot 2 time series on the same graph.
For example, X1 is the vector of dates and times, its class is POSIXt. Y1
is an environmental parameter, e.g. salinity. X2 is a second vector of
dates and times, also of class POSIXt. X2 has a different length than
X1, but they have the exact same range. Y2 is another environmental
parameter, e.g. stream flow rate.
My approach is
2008 Jun 17
2
color2D.matplot axis names
Hi,
I finally came up with a nice colored matrixplot, using the color2D.matplot
function of the plotrix package. But I can't assign xtics and ytics to this
plot. I made sure that the matrix has correct colnames() and rownames().
Here's what I do:
a=matrix(1:16, 4, 4)
colnames(a) <- c("X1", "X2", "X3", X4)
rownames(a) <- c("Y1",
2011 Mar 12
3
how to label lines
Hello R
I can not figure out, how to add text string or number to lines like on this
image:
http://r.789695.n4.nabble.com/file/n3350452/graph.png
I have some data series in text file.
My script:
require(graphics)
require(stats)
graf=read.table("file",header =FALSE,sep = "", dec = ",",fileEncoding = "",
encoding = "unknown", skip=19,nrows=400)
2010 Jun 02
4
Draw text with a box surround in plot.
text() can draw text on a plot.
Do we have a way/function to draw text with a box surround it?
Thanks,
-james
2011 May 10
2
Leyenda de las series en tsplot
Hola de nuevo:
Sigo enfrascado con mi dichoso procedimiento para generar modelos de
predicción de series temporales.
Llegado un momento pretendo guardar un gráfico en el que se representara:
-En a estarán los puntos obtenidos por el alisado (tanto en el pasado como
las estimaciones a futuro)
-En o estará la serie de datos original.
-En inf los limites inferiores de los intervalos de confianza
2007 Dec 06
2
How can I plot this graph
Hi,
I am having trouble plotting the graph I need given the follow kind of data
> xxx <- data.frame(
"x"=c(1,2,3,4,5),
"y1"=c(2,4,3,5,6),
"y2"=c(3,4,6,3,1),
"y3"=c(1,3,5,7,3),
"z1"=c(1,NA,3,5,NA),
"z2"=c(2,NA,4,6,NA) )
> xxx
x y1 y2 y3
2017 Jun 25
2
Writing my 3D plot function
Hi all,I had a question last week on asking for a function that will help me draw three different circles on x,y,z axis based on polar coordinates (Each X,Y,Z circle are coming from three independent measurements of 1-360 polar coordinates). It turned out that there ?is no such function in R and thus I am trying to write my own piece of code that hopefully I will be able to share. I have spent
2009 Jan 08
2
how to plot histogram plot and fitted distributions on the same graph
Dear:
I am trying to plot the histogram graph for my observed data. Then plot
fitted distribution on the same graph of histogram plot in R.
1. histogram plot y.
2. based on "1", plotting y1 v. x;
3. based on "1", plotting y2 v. x;
4. based on "1", plotting y3 v. x;
All of these four plots must be on the same graph.
However, I found the difficulty is
2005 Jun 15
4
Multiple line plots
Greetings,
I would like to plot three lines on the same figure, and I am lost. There is
an answer to a similar thread… but I tried matplot and it is beyond me. An
example of the data follows:
Year EM IM BM
1983 9.1 16.8 -7.7
1984 12.0 18.0 -6.0
1985 13.6 19.1 -5.5
1986 12.4 17.3 -4.9
1987 14.6 20.3 -5.7
1988 20.6 23.3 -2.6
1989 25.0 27.2 -2.2
1990 28.4 30.2 -1.8
1991 33.3 31.2 2.1
1992 40.6
2017 Jun 25
0
Writing my 3D plot function
Please look at what I see in your code below (run-on code mush) to understand part of why it is important for you to send your email as plain text as the Posting Guide indicates. You might find [1] helpful.
[1] https://wiki.openstack.org/wiki/MailingListEtiquette
--
Sent from my phone. Please excuse my brevity.
On June 25, 2017 2:42:26 PM EDT, Alaios via R-help <r-help at r-project.org>
2005 Aug 16
1
Overall Legend
Hello. I am using R version 2.1.1 on Windows 2000.
I am using a par(mfrow=c(2,2)) statement to produce 4 plots on one screen. I want a single horizontal legend to appear at the top of the four plots. My code is something like this:
par(mfrow=c(2,2))
plot(x,y1)
lines(x,y2)
lines(x,y3)
plot(x,z1)
lines(x,z2)
lines(x,z3)
plot(x,t1)
lines(x,t2)
lines(x,t3)
plot(x,w1)
lines(x,w2)
lines(x,w3)
2008 May 14
2
mfrow
Dear members,
I want to create 8 graphs and write it into one page using mfrow=c(4,2).
How to make all graphs (including the titles, legends, line types) to be
scale down (resized proportionally).
As an illustration, below is the code:
pdf("testmfrow.pdf")
par(mfrow=c(4,2))
x<-seq(1:10)
y1<-rnorm(10)
y2<-rnorm(10,mean=2,sd=1)
y3<-rnorm(10,mean=3,sd=1)
2005 May 24
5
How to break an axis?
Dear list,
I need to plot four almost horizontal lines with y-values around
1,3,4, 400. If I plot them directly, the first three lines will be
indiscernible so I am thinking of breaking y-axis into two parts, one
with range (0,5), another (395,400). Is there an easy way to do this?
I can think of two ways:
1. use two plots and draw axes manually. The plot margins, are however
difficult to
2006 Apr 27
1
plotting multiple graphs in a single plot
Hi,
I would like to plot multiple graphs in a single plot
frame. Something like this:
plot(X, Y1, type='l', col='red')
lines(X, Y2, col='green')
lines(X, Y3, col='blue')
etc. The problem with this approach is, however, that
the range of the y-axis will be set according to the
minimum and maximum values of Y1 only. I would like to
generate a plot that shows all
2007 Nov 19
2
Using windows() and jpeg()
Hello,
I have the following question, which I haven't been able to resolve after days of trying. I used to save my plots as jpegs using the savePlot command. However, that seems to result in lost resolution. So now I'm trying to use the jpeg( ) function, but am having trouble because it seems to be incompatible with the windows (width=, height=) command. It's important for me to