similar to: Something similar to layout in lattice or ggplot

Displaying 20 results from an estimated 10000 matches similar to: "Something similar to layout in lattice or ggplot"

2009 Sep 25
3
Problem on plotting TS using GGPLOT
Hi, I have following codes : library(zoo); library(ggplot2); library(plyr) dat <- rnorm(306); vv <- letters[1:6]; dat1 <- data.frame(dat, vv) dat2 = zooreg(rnorm(51), as.yearmon(as.Date("2000-01-01")), frequency=12) ggplot(dat1) + geom_line(aes(y=dat, x=index(dat2), colour=vv), group=vv, size = 1.3) However I got error while plotting them :
2013 Jul 25
1
GGplot 2 – cannot get histogram and box plot axis to match.
Problem: I am trying to get the histogram and box plot x axis to match. I?ve tried using the expand_limits function to make the axis match but that didn?t make the axis match. The histogram?s axis are still consistently larger than the ones for the box plot (though the function did help). Does anyone have a suggestion as to what I should do instead? Background: I am building a Shiny app that
2009 Jul 24
1
ggplot question
In page http://had.co.nz/ggplot2/scale_date.html , there is a time series plot for multiple variables at the bottom. i.e qplot(date, value, data = em, geom = "line", group = variable) + + facet_grid(variable ~ ., scale = "free_y") How can I make different color for different series? Thanks -- View this message in context:
2008 Oct 10
2
ggplot adding points
I would like to do the following in ggplot: what am I missing? River.Mile <-c(202, 198, 190, 185, 179, 148, 119, 61) TSS <- c(1:8) DOC <- seq(2, by= 0.6, length.out=8) z <- data.frame(River.Mile, TSS, DOC) xyplot(TSS+DOC~River.Mile, data=z, auto.key=TRUE) thanks -- Stephen Sefick Research Scientist Southeastern Natural Sciences Academy Let's not spend our time and resources
2009 Jan 22
1
ggplot seq
Hi Hadley: Not sure if you received my email, so I am resending it again. I have dealt with this before and I can't remember how it got resolved. It is too much data to reproduce the example below(49.000 records) but all I am after is trying to get the x axis breaks. I want my x axis to go from 27 to 51 and 1 to 25 by 2. I am trying to concatenate the breaks but it sorts the seq() in ascending
2009 Aug 19
3
ggplot 2 semi-transparency error
Hi, I used the command ggplot as follows... p<-ggplot(a,aes(x=a$V1,colour=a$V2,fill=a$V2)) p + geom_density(alpha = 0.2,xlim=c(-10,10),ylim=c(0,0.5)) when I say, dev.print(device=postscript,file="/alpha/dct.pdf") I get Warning message: In grid.Call.graphics("L_polygon", x$x, x$y, list(as.integer(1L:length(x$x)))) : semi-transparency is not supported on this device:
2009 Aug 10
2
ggplot: colours to geom_segments
Just as an exercise I am tying to add colours to a geom_segment command. I can get one colour but not a sequence of colours. Can anyone suggest how I can get the green lines in the plot below to be different colours? I thought I could use a palatte of colours but that did not seem to work. Thanks ========================================================================= library(ggplot2) xx
2009 Feb 05
1
A way to "lock down" the order of bars for ggplot "dodged" histogram
It appears that ggplot reorder the data for a "dodged" histogram based on whether or not a specific variable has a value in the first bin.   I would like to be able to absolutely force the order of the variables in the bin.  For example, say I have three variables Me, You, and Them.   Me_df<-data.frame(Data = c(1:15), Person = "Me") You_df<-data.frame(Data = c(10:20),
2009 Sep 14
1
ggplot, ribbon not showing up properly
Hi, I'm trying to plot a longitudinal data set, using ggplot and adding some summary info (eg. mean, 1 sd bounds) using geom=ribbon. The summary info is based on a subset of the original data (eg. less an outlier). But I'm having trouble getting the ribbons to show up correctly. It's probably something obvious that I'm missing as a novice at ggplot2, and any help is much
2009 Apr 10
1
png with ggplot on windows xp
Hi Group, I posted this question on the ggplot list and was advised to try here also. The code below produces a plot as a png and pdf. The pdf looks great, and I cannot make the png look this way. I've tried various combinations of height, width, and dpi, but it has not worked out so far. Any suggestions to make the png look like the pdf? I received a response that the problem does not occur
2009 Jun 10
1
ggplot, qplot: alpha channel for colors corresponding to factor
Hi, I have a qplot like the one in the minimal example below, except I also have faceting like this: qplot(jitter(Goodall),jitter(Better.adapt),colour=Second.adapt,facets=~Pol,data=d1) and with the real data I get quite a lot of overplotting, so I would like to add an alpha channel. In addition, I would like to be able to control which colors are used for each value of Second.adapt (which
2010 Sep 16
1
plotting time series using ggplots
Hi, I would like to plot a bunch of tree ring width data (time series) using ggplots, but I'm having trouble figuring out how to do it. My data is in a data.frame, with years as rownames and a distinct tree ring series in each column. So, something like this: rwl<-matrix(rnorm(800), nrow = 100) colnames(rwl) <- paste('V', 1:8, sep = '')
2009 May 19
2
Coord_equal in ggplot2
Dear all, I'm plotting some points on a graph where both axes need to have the same scale. See the example below. Coord_equal does that trick but in this case it wastes a lot of space on the y-axis. Setting the limits of the y-axis myself was no avail. Any suggestions to solve this problem? library(ggplot2) ds <- data.frame(x = runif(1000, min = 0, max = 300000), y = runif(1000, min =
2009 Mar 25
2
[ggplot2] Densityplot, grouping and NAs
Dear all, I do not fully understand how ggplot2 handles NAs. See the following example: library(ggplot2) x <- rnorm(150) g <- as.factor(c(rep(c(0,1,NA),50))) mydf <- data.frame(x,g) m <- ggplot(aes(x = x, group = g, color = g), data = mydf) m + geom_density() How do I get rid of the NAs (i.e. the blue colored curve)? I thought ## m <- ggplot(aes(x = x, group = g, color = g,
2009 Feb 11
2
Label bars in a faceted bar plot in ggplot2
Hi List, I am running R 2.8.0 on a Windows XP machine, running ggplot2 version 0.8.1 I want to label the bars in a faceted grid barplot. Reproducible R code is given below: #### reproducible facet barplot ##### library(ggplot2) # Dataset from which to create the barplot ml <- rep(1:10,2) vals <- rnorm(20,mean = 10, sd=1) type <- c(rep("MAPE",10),rep("AIC",10))
2009 Sep 02
1
Howto Superimpose Multiple Density Curves Into One Plot
I have a data that looks like this: http://dpaste.com/88561/plain/ And I intend to create multiple density curve into one plot, where each curve correspond to the unique ID. I tried to use "sm" package, with this code, but without success. __BEGIN__ library(sm) dat <- read.table("mydat.txt"); plotfn <- ("~/Desktop/flowgram_superimposed.pdf"); pdf(plotfn);
2009 Jul 23
1
Another question on gplot
I am getting following strange error : library(sn) library(ggplot2) dat1 <- as.matrix(rsn(1000, 0, 1, 0))[,1] ggplot() + geom_histogram(aes(x = dat1, y = ..density.., fill = ..count..)) + xlab("Distribution") + scale_y_continuous("") Error: No data for layer Can anyone please tell me why it is coming? -- View this message in context:
2010 Jun 10
2
drawing curve
Sir, I have a problem regarding drawing curve.I pose the problem as follows: suppose I have two vectors: x<-c(1:6) y<-c(.01,.09,.08,.03,.001,.02) plot(x,y) It gives me the plotted points.But I want to draw a smooth curve passing througt these points. How can I do this? Thanks & Regards, Suman Dhara [[alternative HTML version deleted]]
2009 Oct 02
1
ggplot2: proper use of facet_grid inside a function
Hello Again R Folk: I have found items about this in the archives, but I?m still not getting it right. I want to use ggplot2 with facet_grid inside a function with user specified variables, for instance: p <- ggplot(data, aes_string(x = fac1, y = res)) + facet_grid(. ~ fac2) Where data, fac1, fac2 and res are arguments to the function. I have tried p <- ggplot(data,
2009 Aug 21
2
2d color coded line plot
Hi! I'm not experienced very experienced with R and i'm looking for a way doing plots like in this example http://www.mathworks.de/matlabcentral/fx_files/23566/2/color_line3.png, which basically it is a 2d plot in which the 3rd dimension (variable) is color coded. I have only seen elsewhere that it is possible to color code dots in a scatter plot and I tried it with success although I