similar to: How to plot two graphs on one single plot?

Displaying 20 results from an estimated 20000 matches similar to: "How to plot two graphs on one single plot?"

2009 Dec 15
1
Help in R
Hello, Can anyone give me some suggestion in term of calculating the sum below. Is there a function in R that can help doing it faster? x1, x2, ...xn where xi can be 0 or 1. I want to calculate the following: sum{ beta[a+sum(xi), b+n-sum(xi) ]* [ (1-x1)dnorm(0,1)+x1dnorm(2,1) ]* [ (1-x2)dnorm(0,1)+x2dnorm(2,1) ]* ...* [ (1-xn)dnorm(0,1)+xndnorm(2,1) ] } The sum in the beginning is over all
2009 Nov 18
1
[LLVMdev] Question about program debugging after code duplication
Hi, I am not sure where I should submit the question to. But I think it is llvm related. I ran into a problem when debugging my code. Here is the problem: my optimization (a pass in LLVM) takes bitcode file as input, duplicate part of the original code, put the duplicated code in a separate function, then run both of them. I took the steps: 1. use llvm-gcc to compile .c files to bitcode files
2007 Oct 24
2
Graphics - plotting two graphs
Hi, I wanted to plot 2 lines on a single graph. Each graph has one axis that can be common. The code that I'm using is: ------------------------------------------------------- par(mfrow=c(1, 1)) x1 <- c(2, 4, 6, 8, 10, 12) x2 <- c(10, 20, 30, 40, 50, 60) y1 <- c(10,12,15,22,34,21) y2 <- c(40, 130, 150, 145, 40, 30) par(las=1, mar=c(4, 4, 2, 4)) plot.new()
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 =
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
2012 Jan 31
2
Generate data - function
Hi All, I want generate data using R that follows the shape of graphs (A and B) in the attached file. Can anybody suggest me what function fits for each graph? Your help is highly appreciated in advance Val -------------- next part -------------- A non-text attachment was scrubbed... Name: graphs.pdf Type: application/pdf Size: 19430 bytes Desc: not available URL:
2010 Sep 05
1
Add y-title to a plot with two y axis
Hi all, We managed to plot two series on the same graph, with two y-axis, however, we haven't managed to add a title to the second y-axis x1=rnorm(25, mean=0, sd=1) y1=dnorm(x1, mean=0, sd=1) x2=rnorm(25, mean=0, sd=1) y2=dnorm(x2, mean=0, sd=1) plot(x1, y1, type='p', xlab='x', ylab='y') par(new=TRUE) plot(x1, y2, type='p', axes= FALSE,
2003 Apr 10
1
how to estimate parameters of multimodal distribution
Dear all Please, is there any function or package for dealing with multimodal distributions? I try to fit multimodal distribution or more precisely to find out mixture of normal distributions which can lead to my actual data. I use optim to find (in that case) two parameters but what I want is to let the function find out arbitrary number of normal distributions underlaying my actual data
2008 Feb 27
4
plot y1 and y2 on one graph
Dear all I have a code like x<-1:10 y1<-x+runif(10)*2 y2<-seq(0,50,length.out=10)+rnorm(10)*10 par(mfrow=c(1,2)) plot(y1~x) plot(y2~x) Now I would like to plot y1 and y2 on the same graph, with its two scales (y1 on left and y2 on rigth side). Any help are welcome. Kind regards Miltinho Brazil [[alternative HTML version deleted]]
2006 Sep 27
3
t-stat Curve
Number of subjects = 25 Mean of Sample = 77 Standard Deviation (s) = 12 sem = 2.4 df = 24 The claim is that population mean is less than 80 * > 80 So our H0 (null hupotheis) is * > 80 > qt(.95,24) [1] 1.710882 > qt(0.05, 24) [1] -1.710882 tstat = -1.25 on t24 falls between 1.711 (.95,24) and *1.711 (.005,24) How Could I sketch t curve for the above data where my * would be at the
2007 Sep 17
4
graphs with gradients of colors
Hi All, I would like to fill the area under a curve with a gradient of colors. Are there any packages or trick I could use Thanks Stefan Stefan Van Dongen Antwerp [[alternative HTML version deleted]]
2006 Jun 13
2
plot two graphs with different length of data
Hi I am trying to plot two data set in the same picture window without overlapping with each other. I am using the format plot(x1,y1,x2,y2) but get the following error message: >plot(as.numeric(r0[,4]),as.numeric(r0[,7]),as.numeric(r0[,4]),as.numeric(r0[,7][ind[,1]])) Error in plot.window(xlim, ylim, log, asp, ...) : invalid 'ylim' value Can anyone tell me what went wrong?
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
2005 Jan 21
2
Selecting a subplot of pairs
Hello, I'm trying to plot a set of 3 dependant variables (y) against 4 predictors (x) in a matrix-like plot, sharing x- an y-axis for all the plot on the same column/line : y1/x1 y1/x2 y1/x3 y1/x4 y2/x1 y2/x2 y2/x3 y2/x4 y3/x1 y3/x2 y3/x3 y3/x4 In fact, this plot is a rectangular selection of the result of pairs(), limited to the relations between x's and y's
2007 Mar 25
1
eliminating panel borders from lattice plots
I am trying to eliminate panel borders from my lattice plots. By default, they always print. For example: library(lattice) x <- seq(-3,3,length=1000) y1 <- dnorm(x) y2 <- dnorm(x, sd=.5) data <- data.frame(x=rep(x,2), y=c(y,y2), panel=rep(c(1,2), each=1000)) dplot <- xyplot(y~x | panel, data=data, strip=F, scales=list(draw=F))
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
2001 Aug 13
2
printing lattice plots
Hi I'm trying to print several plots to a multi-page postscript file. Some plots are output of basic commands, some are produced by "trellis" commands (from the package lattice). Right now I'm not able to get a straightforward black and white color scheme for the latter kind: when I open the postscript file the "trellis" plots are invisible, or parts of them are
2008 Jan 24
2
plot help
Hi, Suppose I already have two plots on the same screen, and I want to draw lines in each of them. Is that possible in R? It seems that once you have two plots on the screen, you can only draw lines in the the last plot, never the 1st. Here is what I mean: #some data y1=rnorm(1:3) y2=rnorm(1:3) #draw two plots on the same screen par(mfrow=c(2,1),oma = c(6, 0, 5, 0)) par(mar=c(0, 5.1, 0, 5.1))
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)
2011 Feb 27
3
accessing variables inside a function, inside a loop
dear list! I KNOW this has been answered a million times before. But, as some might remember from their "freelance" times as a statistic consultant, sometimes you're blinded by the facts. I KNOW I have seen this problem solved, but due to the mental blockade i have been suffering from the last 3 hours, I can neither find the answer on the mailing list nor on google. I wrote a