similar to: Strange error in qplot

Displaying 20 results from an estimated 4000 matches similar to: "Strange error in qplot"

2010 Jun 30
2
ggplot qplot bar removing bars when truncating scale
I'm having problems with this example, it is posted with reproduceable code below, both with the normal 0-6 scale and the desired 3-6 scale (with bars removed). How can I get the graph to have the desired 3-6 scale without removing the bars. Thanks! #Data
2009 Mar 02
3
ways to put multiple graphs on single page (using ggplot2)
Hi, Here are three plots: library(ggplot2) data(diamonds) randind <- sample(nrow(diamonds),1000,replace=FALSE) dsmall <- diamonds[randind,] qplot(carat, data=dsmall, geom="histogram",binwidth=1) qplot(carat, data=dsmall, geom="histogram",binwidth=.1) qplot(carat, data=dsmall, geom="histogram",binwidth=.01) What are ways to put these three plots on a single
2009 Jul 21
1
legend title in qplot
Hi, I've used the following command in qplot qplot(a$V1,geom="histogram",binwidth=0.15,fill = factor(a$V2),ylab="Frequency",xlab="Rate"); but the title in the legend shows up as factor(a$V2)...how can i change this? -- Rajesh.J [[alternative HTML version deleted]]
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
2009 Jan 30
1
Using ggplot2 I need to move the location of legend to on the plot
  Thanks again for the hints about adding the vertical line to the hist plot and in ggplot.  That worked great.    Based on that advice I've been flipping through the ggplot2 doc and ggplot-static\index.html webpage more looking for the answer to the next question.    Unfortunately, I haven't stumbled on a description of how to move around the location of the legend.    Here is what I
2008 May 12
1
Converting qqplot2 qplot() to grammar?
Hello all, I've been using the following qplot command: qplot(pixX,pixY, data=som, geom="tile", fill=rgb) + scale_fill_identity() + opts(aspect.ratio = .75) + facet_grid(unitX ~ unitY) Now I would like to convert it into the explicit ggplot grammar, so I can remove the extras: axes, labels, background, borders, facet labels, and extra white-space around the plot. (If anyone has
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")
2012 Sep 14
1
Adding annotations to qplot from a data frame
I have the following data frame: > algaedata = year DIV cellsperml 2001 BAC 72.808 2001 CHL 3.273 2002 BAC 14.002 2002 CYA 220.896 2002 UNI 464.699 2003 BAP 0 2003 BAC 1.782 2004 CYA 315.799 2005 UNI 222.532 2005 BAP 0.2 2005 CYA 163.627 2005 BAC 324.949 2006 CHL 1.636 2006 BAC 199.145 2007 CHL 19.635 2007 CYA 134.174 2007 BAC 485.405 2007 CHL 11.454 2007 CYA 104.721 ...which makes a fine
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 is pseudo code of what I have currently:qplot(Run, data = TestData, breaks =
2010 Nov 30
2
ggplot2 histograms
Hi With ggplot2 I can very easily create beautiful histograms but I would like to put two histograms on the same plot. The histograms may be over-lapping. When they are overlapping the bars are shown on top of each other (so that the overall height is the sum of the two). Is there any way to get them to display overlapping (with smaller value in front, larger value behind) so that the overall
2010 Jul 29
2
ggplot2 histograms... a subtle error found
Hello all, I have a peculiar and particular bug that I stumbled across with ggplot2. I cannot seem to replicate it with anything other than my specific data set. Here is the problem: - when I try to plot a histogram, allowing for ggplot2 to decide the binwidths itself, I get the following error: - stat_bin: binwidth defaulted to range/30. Use 'binwidth = x' to
2011 Jun 21
2
qplot/ggplot2 Questions
I took some data from an online poll about which R GUI people used most and I am messing around with it to learn how to use qplot. Specifically I am making a horizontal bar graph and I have two questions. 1. The categories are ordered in rather strange way at least to me. It is not alphabetical or ascending/descending order of votes cast so i had to manually state the order I wanted which is
2008 Jul 22
1
scatter plot using ggplot
I used ggplot to create a scatter plot : library(ggplot) library(mnormt) Sigma = matrix(c(1, 0.6, 0.6, 1), 2, 2) x = rmnorm(20, c(0,0), Sigma) xx = x[order(x[,1]),] y = xx[,1] z = xx[,2] qplot(z, y, type="point", main="x-y plot", xlab="x", col="blue") However I want following: 1. Plot color must be Blue (where it is displaying as red) 2. There should not
2011 Jul 25
4
ggplot question: changing the label for the Y axis on a histogram
Some help with how to re-label the vertical axis in a histogram would be appreciated. qplot(off.sc,weight=rel.freq,binwidth=.29,main="test Figure"+ylab("New from inside"))+ylab("New from outside")+ xlab("off.sc\nAggregated frequency plots for 17 equal intervals.") The code
2011 Jun 07
1
ggplot2 Histogram with density curve
I am learning ggplot2 commands and I have figured out how to create histograms and density curves but I am not sure how to add a density curve on top of a histogram. Here are the two graphs that I created. ## Histogram t<-rnorm(500) w<-qplot(t, main="Normal Random Sample", fill=I("blue"), colour=I("black"), geom="histogram") w ##Density Curve
2008 Mar 25
2
ggplot2 - facetting
Dear All, After having overcome the issue of legends (thanks, Thierry, once more), I am trying to use facetting, but here also I can not find how to do this. I do not want to use qplot, but rather the more flexible options. However, it seems I am doing still something pretty stupid, because I always get an error, even if it seems I am doing everything like the examples. My code is below.
2010 May 21
2
multiple qplot histograms in one plot
Hi, I wish to plot multiple histograms(representing different data so different range along xaxis but y axis is the same) horizontally in ggplot2. I'd like it to look like facets. Is this possible? -- Rajesh.J [[alternative HTML version deleted]]
2008 Oct 11
5
Extracting subset of a vector
I have 2 vecros : x<-c(100,96,88,100,100,96,80,68,92,96,88,92,68,84,84,88,72,88,72,88) x1 = sample(x, 5, replace=FALSE) Now i want to get remaining values of vector "x" those are not member of vector "x1". Can anyone please tell me how to do that?
2008 Jan 11
1
ggplot2, coord_equal and aspect ratio
Hi everyone, Hi Hadley, I am a heavy user of coord_equal() in ggplot2 since most of my data is spatial, on x,y coordinates. Everything works. However by enforcing an aspect ratio of 1 for the plotting region, coord_equal() usually wastes a lot of space if the region of interest is not a perfect square. For example: x=runif(10) a=data.frame(x=x*3,y=x) ggplot(data=a, aes(x=x,y=y)) +
2008 Feb 21
2
jpeg() creating empty files with qplot() in a loop
Hello 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)) {