similar to: multiple plots using a loop

Displaying 20 results from an estimated 10000 matches similar to: "multiple plots using a loop"

2011 Mar 08
4
minimum distance between line segments
Dear R helpers, I think that this may be a bit of a math question as the more I consider it, the harder it seems. I am trying to come up with a way to work out the minimum distance between line segments. For instance, consider 20 random line segments: x1 <- runif(20) y1 <- runif(20) x2 <- runif(20) y2 <- runif(20) plot(x1, y1, type = "n") segments(x1, y1, x2, y2)
2011 Feb 16
2
distance between consecutive points
Dear R users, I have two coloumns of data, say x and y, referring to a list of points in 2D space. I am trying to develop a code that will give me the distances (using Pythagoras) between consecutive points (xi,yi) and (xi+1,yi+1). So far I have come up with the following: for (i in 1:length(x)) d<-sqrt((x[i+1]-x[i])^2+(y[i+1]-y[i])^2) For example, if I use the two points (note, I have
2011 Mar 08
3
allocating factor levels
Dear R users, I am working on allocating the rows within a dataframe into some factor levels.Consider the following dataframe: Start.action Start.time 1 Start.setting 2010-12-30 17:58:00 2 Start.setting 2010-12-30 18:40:00 3 Start.setting 2010-12-31 22:39:00 4 Start.setting 2010-12-31 23:24:00 5
2012 Jun 25
3
Loop for multiple plots in figure
Hello, I have longitudinal data of the form below from N subjects; I am trying to create figure with N small subplots on a single page, in which each plot is from only one subject, and in each plot there is a separate curve for each value of param1. So in this case, there would be four plots on the page (one each for Bob, Steve, Kevin and Dave), and each plot would have two separate curves (one
2011 Oct 07
1
How to change the scale of the Y axis?
I am currently trying to create 3 histograms from 3 sets of data and in order to compare them I need them all to have a common scale, the Y axis is the only place its a problem, as one histogram only goes up to 4, another 5, and another 7 on the Y axis and obviously they all need to be in the same scale to allow comparisons. Can anyone help? Thanks, Feargal -- View this message in context:
2004 Feb 05
2
Histograms by two factors
Hi I am trying to print out means, STDs and histograms under two sets of factors. I can manage it for one set - see below but not for two sets. That is, I want ot print out the mean STD and Histogram for each ITEM code within each DELIVERABLE code. In addition I can only get to view the histogram for the last item. How do you get R to stop overriding the histogram for eg level 1 for factor 1
2008 Feb 27
2
multiple plots per page using hist and pdf
Hello, I am puzzled by the behavior of hist() when generating multiple plots per page on the pdf device. In the following example two pdf files are generated. The first results in 4 plots on one pdf page as expected. However, the second, which swaps one of the plot() calls for hist(), results in a 4 page pdf with one plot per page. How might I get the histogram with 3 other scatter
2009 Feb 09
2
How to plot multiple graphs each with multiple y variables
I am new to R and have a problem that I haven't been able to find the answer to in the guides or online. I have multiple datasets, D1, D2, D3, D4, D5, D6, D7 and D8, and I would like to produce two plots side by side using mfrow.  The first plot should contain data from D1-D4, the second should contain D5-D8. I can plot these separately using the code, par(mfrow=c(1,1))
2008 Jul 19
2
Title for graph with multiple plots
Dear R Users, I am attempting to place a title to a graph with multiple plots that should go across the top of all the graphs, and not just one of them. I am using mfrow in par to plot. Can anyone suggest if and how this could be done ? Thanks in advance, Tolga
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
2009 Nov 24
4
Graphic Device - View/get all graphics
Hi Listers, I am producing some graphics that the commands are in a FUNCTION... The problem is that I end up viewing just last graphic and in my FUNCTION there are 4 graphics with the PAR command function... Like those below... How do I view/get the other 3 graphics? Any help? Thanks in advance... histogram<-par(mfrow=c(1,2)) hist(rw_mean_app,main='Bootstrap Method
2009 Jan 07
2
can the pdf output page break be controlled manually?
I would like to control where to make a page break in my pdf file. The following code renders three pages of output. But I would like to be able to control the page breaks. pdf(file="test.pdf", paper="a4") par(mfrow=c(2,2)) hist(rnorm(100)) hist(rnorm(100)) hist(rnorm(100)) plot.new() par(mfrow=c(1,1)) hist(rnorm(100)) hist(rnorm(100)) dev.off() It
2006 Dec 27
3
stacked plots
Dear helpeRs, Is there a better method of producing stacked charts than par(mfrow(3,1)), plot(x), plot(y), plot(z)? What I would like to do is produce a chart of several panes stacked vertically with no space between them so they appeared to be a single figure. I've attached a small example, though it is not clear that it will make it, as the posting guide doesn't say which sort of images
2008 Sep 04
2
Adding a legend to R graph device with several plots (no to individual plots!)
Dear Users, I already posted this question: it either went unnoticed, or it is to basic (if this is so, please sent me a hint). I would like to know if there is a way to add a common legend to an arrangement of plots. In the example below, I get four plots in my device. each one has a density for 1995 and one for 2006. I have found that using legend or smartlegend I can add a legend to each plot,
2004 Feb 13
4
How to plot a blank plot
Hello everyone, In plotting several graphics, I'd like to be able to plot a blank plot as in: par(mfrow=c(2,1)) plot(BLANK) hist(rgamma(100000,6463.7,scale=0.015471),xlim=c(0,120),main="Emergence") I realize screen allows me to do this, but I figure the functionality must be there. Is there an equivalent to plot(BLANK)? thanks, adrian PS. please reply direct as I'm not
2013 Feb 08
6
Add text A, B, C and D on multiple ordered plot
Dear list, Is there a elegant way to name multiple ordered plot as A, B, C and D? Just put A, B, C and D on the top left corner of each plot. Usually I do it in Illustrator, but I think in R should there is a way. Could you please provide a example? Thank you very much in advance.
2010 Nov 10
1
par mfrow in "function" problem
Hi all, I defined the following ############################# myhist=function(x){ hist(x,xlab="",main="") h=hist(x) xfit=seq(min(x),max(x),length=100) yfit=dnorm(xfit,mean(x),sd=sd(x)) yfit=yfit*diff(h$mids[1:2])*length(x) lines(xfit, yfit, col="blue", lwd=2) } ############################# individually, it worked fine however, if I used par(mfrow=c(2,2))
2010 Feb 11
1
histogam plots
Hi all, I want to draw a histgram for each row of a matrix and compare them. However the plot I got does not have the same y range and x range, which makes it difficult to make the comparison. Is there a easy way to fix the x range and y range in a xy plot for several plots, instead of specifying them for each plot. The following is my code for generalizing the matrix and draw the histogram.
2009 Nov 17
1
Plotting graphs using FOR loop
I have the following codes but can anyone make it shorter i.e making these FOR loop into one loop ... thanks... par(mfrow=c(2,4)) for(i in 16:23){ hist(data[,i],main=paste(colnames(data)[i],sep=""),ylab="Frequency",xlim=c(1,5),xlab="Score",ylim=c(0,100)) } png("histogram.png") dev.off() par(mfrow=c(2,4)) for(i in
2007 Apr 13
3
labels cut partially on hist
Dear List, I have the following function where I plot on one page a histogram and a boxplot. I use option labels = TRUE in hist to show labels. However the label on the highest bar in the histogram is not showing entirely. How can I correct this? Thanks for any suggestions? histtst <- function(n = 100,...){ set.seed(15) # makes rnorm reproducible par(mfrow = c(2,1)) x <-