search for: qplot

Displaying 20 results from an estimated 465 matches for "qplot".

Did you mean: plot
2009 Jul 18
7
Question on qplot
..., 500); dat <- zooreg(dat, start = as.Date("01/01/01", "%m/%d/%y"), frequency=1); plot(dat) head(dat); month.no <- format(index(dat), "%m"); dat1 <- cbind(coredata(dat), as.numeric(month.no)) x <- dat1[,1]; y <- dat1[,2]; z <- dat1[,3] Now I draw a qplot like : qplot(x, z) It is ok........ However if I reverse that like qplot(z, x) I am getting strange plot. I expected it should look just like transpose of above plot. Can anyone please clarify me why I am getting that? -- View this message in context: http://www.nabble.com/Question-on-qplot-tp...
2008 Feb 21
2
jpeg() creating empty files with qplot() in a loop
...llo all, I'm stuck with a strange issue with writing jpegs of plots to a folder in a loop. This works: for (step in 1:length(steps)) { jpeg(filename=paste("frame_",sprintf("%05d",step),".jpg",sep="")) plot(steps[[step]]) dev.off() } But if I use qplot to generate the plot (which is my aim): for (step in 1:length(steps)) { jpeg(filename=paste("frame_",sprintf("%05d",step),".jpg",sep="")) qplot(x, y, data=steps[[step]], geom="tile", fill=rgb(V1,V2,V3)) + scale_fill_identity() + opts(aspect.ratio...
2009 Mar 12
3
Unable to run smoother in qplot() or ggplot() - complains about knots
I get the following error when I run qplot() qplot(grade, read,data = hhm.long.m, geom = c("point", "smooth")) Error in smooth.construct.cr.smooth.spec(object, data, knots) : x has insufficient unique values to support 10 knots: reduce k. I am not sure how to tackle this problem. When I take a subsample (< 1000...
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...
2011 Dec 21
3
black and white in qplot? layout 4 graphs in one screen
Hello, I am trying to plot means and standard errors conditioned by a factor, using qplot. I am successful at getting the bar graph I want with a error bar, however I have tried many things and cannot get the bars to change colors. Currently showing as red and blue, but need it to be black and white for publication. Any suggestions please? Using a data set June, which is str: '...
2009 Jan 29
2
Adding vertical line to histogram and qplot "stacked" plot
R-users it appears I am leaning on your knowledge once again.  Is there any way to add a vertical line to a histogram and qplot "stacked" plot?  Here is my current attempt:   "qplot" approach attempt: qplot(Run, data = data_dataframe, breaks = breaks, fill = Temperature, main = short_title) + scale_x_continuous("Data") + scale_y_continuous("Freq") +  scale_fill_discrete("Temperat...
2011 Jun 06
2
qplot fill and colour not working as expected
I am just learning to use qplot and can't get the fill/colour to work. Below is the R code for a scatter plot and bar graph. library(ggplot2) x<-c(1,2,3,4,5,6,7) y<-c(1,2,3,2,5,6,3) qplot(x,y, main="Scatter Plot Test", xlab="X Label Test", ylab="Y Label Test", colour="blue")z<...
2011 Jul 12
4
qplot and for loops
...the 4 columns using a for loop. I tried the following command in RStudio and when I type x in the console I get just the 4th graph instead of all four graphs. I did not define what x is before hand. I was not sure what it would be. Any suggestions on how you would properly define x? for(i in 1:4){ qplot(x[i]<-mydata[,i]) } The headers of the columns are Trial.1 Trial.2 Trial.3 and Trial.4. Also note that I can easily make any of the four graphs by i=1 or i=2, etc. qplot(x<-mydata[,i]) I just need to figure out how to make it loop correctly. The ultimate goal would also be to save these g...
2008 Mar 04
1
qplot (ggplot2) faceting histogram with missing values
Hi, I've run into a difficulty with qplot function (in the ggplot2 package). I can facet histograms even when the faceting variable contains missing values, but only so long as the faceting variable is not a factor. Example: y1 <- rnorm(10) x1 <- c(rep(1,5), rep(2,4), NA) x2 <- factor(c(rep(1,5), rep(2,4), NA)) library(ggp...
2007 Jul 12
1
ggplot2 / reshape / Question on manipulating data
...ngs$VoteMean, list(Year = ratings$Year), mean) > plot(byYear) Having just discovered gglot2, I wanted to create the same graph but augment it with a color attribute based on the total number of votes in a year. So first I tried to see if I could reproduce the above: > library(ggplot2) > qplot(Year, x, byYear) This did not work as expected because the x-axis contained labels for each and every year making it impossible to read whereas the plot created with basic R had nice x-axis labels. How do I get 'qplot' to treat the x-axis in a similar manner to 'plot'? After play...
2012 Jun 27
3
qplot and colors (Please Help)
Please help: I am using qplot as below and want to specify a different color scheme for race but dont know how, can someone show me. Thanks in advance Code and input file below: library(ggplot2) library(gridExtra) d<-read.table("results", header=TRUE, fill=TRUE) plot2<-qplot(X,Y,data=d,color=race,facets=...
2006 Oct 27
2
qplot of ggplot package how to plot different size according to the values and not to the weights?
...levels $ obserror : num 6.2 6.2 5.6 6.6 6.6 ... $ Mon : num 2.2 2.0 1.0 3.2 2.0 ... $ inc.comp : num 4 5 2 5 5 5 5 5 4 4 ... all I wanted to do is plotting Mon against obserror, the colors should be by step45 and the size of the symbol should be according to inc.comp so I did this: qplot(obserror,Mon,data=obscomp,col=inc.comp,col=step45) unfortunately the size of the is something I do not want it to be, the legend for inc.comp says: 4, 2.25, 1 ,0.25 , 0 I suppose this are weights? I got closer to what I want specify a different symbol instead of a different size: qplot(obserror,...
2010 Aug 23
2
change order of plot panels in faceted ggplot/qplot
Hi, I have a 5-paneled figure that i made using the facet function in qplot (ggplot). I've managed to arrange the panels into two rows/ three columns, but for the sake of easy visual comparisons between panels in my particular dataset, I want to have the two plots on the bottom align on the right hand side of the figure instead of the left. Here's an example...
2010 Mar 23
2
Creating pdfs using qplot in qqplot2
...<- data.frame(datadate=1:4, spread=5:8) pdf() for (i in 1:3) { plot(gg$datadate, gg$spread, main=i) } dev.off() I am trying to learn more about ggplot2 so I try a slight modification and it doesn't work. Anyone know how to do this using qplot in ggplot2? gg <- data.frame(datadate=1:4, spread=5:8) pdf() for (i in 1:3) { qplot(gg$datadate, gg$spread, geom="line", main=i) } dev.off() *************************************************************** This message i...
2009 Jul 13
1
Strange error in qplot
Hi all, whenever I try to plot a histogram using qplot() function of "ggplot2" library, I get error like this : > qplot(rnorm(1000), geom="histogram", binwidth=0.2, main = "", xlab="", > ylab="") Error in scale[[1]] : subscript out of bounds However if I remove ylab="" argument, then i...
2011 Jan 14
2
bug in qplot (library ggplot2)
Hello, this following code give a nice png: /library(ggplot2) i <- 1 png(file=paste('test ',i,'.png',sep='')) qplot(carat, data=diamonds, fill=color,geom='histogram')+scale_y_continuous(i) dev.off() / I would like to get more files, but the following code doesn't make any file: /library(ggplot2) for (i in 1:2) { png(file=paste('test ',i,'.png',sep='')) qplot(carat...
2012 Jul 18
1
ggplot2 qplot pch not working anymore
Is there a way to use a continuous variable to pch in qplot? I believe this worked in previous version. I need to specify certain values of a shape for particular points so that multiple graphs all show the same shapes for the same streams. I have gone to the original data and added a pch column that I would like to use to specify the shapes to pch i...
2010 Feb 14
2
Problems with boxplot in ggplot2:qplot
Dataframe closed contains balances of closed accounts: each row has month of closure (Date-type column month) and latest balance. I would like to plot by-month distributions of balances. A qplot call below produces several warnings and no output. Can anyone help? Thank you. PS. A really basic task, very similar to the examples on p. 71 of the ggplot2 book, apart from a Date grouping column; I am quite surprised to have problems with it. lattice package to the rescue? > qplot(facto...
2009 Apr 21
3
ggplot2 - boxplot of variables / columns
Hi, ggplot/qplot is great - it has really helped me do some nice things. However, simple boxplot of different columns/variables is a bit tricky, because of (i think) qplot's generic Y conditional on X input form. Se below. # Some data: a <- rnorm(100) b <- rnorm(100,1,2) c <- rnorm(100,2,0.5) # normal...
2009 Jan 28
1
Changing histogram stack in qplot
I've been using qplot pretty successfully to generate stacked histograms.  However, it appears that I need to tweak the colors a little.    I've got three temperature variables (characters not numeric) and I need to change from the default qplot colors to the following: Low = Blue Middle = black High = Red   Here i...