similar to: ggplot2 - Problem with grid plot

Displaying 20 results from an estimated 3000 matches similar to: "ggplot2 - Problem with grid plot"

2009 Oct 29
1
multiple pages with ggplot2 facet_wrap?
I currently use lattice functions to produce multiple pages of plots using the "layout" argument to specify the number of rows and columns of panels, e.g., xyplot(price ~ carat | clarity, diamonds, layout = c(2, 2)) This results in 2 pages of 4 panels each. "diamonds" is a data.frame distributed with ggplot2. I would like to do the same with ggplot2 but have been
2010 Apr 07
1
ggplot2, density barplot and geom_point layer
Hi, Please consider the example below. How can I manage to overlay the points the way I want in the second case? Thanks, Joh library(ggplot2) # Modify data to match "real" case myDiamonds <- diamonds myDiamonds[["clarity"]] <- as.character(myDiamonds[["clarity"]]) myDiamonds[myDiamonds[["clarity"]]=="I1","clarity"] <- 1
2011 Jan 18
2
ggplot2, geom_hline and facet_grid
Hi I have a long data set on which I want to do Bland-Altman style plots for each rhythm type Using ggplot2, when I use geom_hline with facet_grid I get an extra set of empty panels. I can't get it to do it with the "Diamonds" data supplied with the package so here is a (much abbreviated) example: > lvexs cvd_basestudy ecd_rhythm fixed_time variable_time 1 CBP05J02
2012 Mar 12
1
Faceted bar plot shows wrong counts (ggplot2)
I have encountered a problem with faceted bar plots. I have tried to create something like the example explained in the ggplot2 book (see pp. 126-128): library(ggplot2) mpg4 <- subset(mpg, manufacturer %in% c("audi", "volkswagen", "jeep")) mpg4$manufacturer <- as.character(mpg4$manufacturer) mpg4$model <- as.character(mpg4$model) base <-
2018 Feb 08
2
sparse.model.matrix Generates Non-Existent Factor Levels if Ord.factor Columns Present
Good day, Sometimes, sparse.model.matrix outputs a dgCMatrix which has column names consisting of factor levels that were not in the original dataset. The first factor appears to be correctly transformed, but the following factors don't. For example: diamonds <- as.data.frame(ggplot2::diamonds) > colnames(sparse.model.matrix(~ . -1, diamonds)) [1] "carat"
2008 Dec 03
2
ggplot2 - suggestion for facet_wrap/grid
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20081203/26bd4ac1/attachment.pl>
2010 Nov 09
1
ggplot2: facet_grid with different vertical lines on each facet
Hello, I am plotting many histograms together using facet_grid in ggplot2. However, I want to then add a vertical line to each histogram, or facet, each of which vertical lines are at different x-values. The following example adds all vertical lines to each facet: ggplot(data,aes(values)) + geom_histogram() + facet_grid(.~variable) + geom_vline(xintercept=c(5,10,15)) How can I add a vertical
2009 Sep 11
1
bar chart with means - using ggplot
Like this? # example using qplot library(ggplot2) meanprice <- tapply(diamonds$price, diamonds$cut, mean);meanprice cut <- factor(levels(diamonds$cut), levels = levels(diamonds$cut)) qplot(cut, meanprice, geom="bar", stat="identity", fill = I("grey50")) dev.new() # create a new graph to compare with qplot # Example using ggplot ggdata <-
2011 Jun 01
1
Plotting from functions
I can plot to png's fine when i run this directly from the top-level script/console: png('diamonds.png');qplot(carat,price,data=diamonds);dev.off() But for some reason it's not working when that's in a function: (function(){png('diamonds.png');qplot(carat,price,data=diamonds);dev.off()})() I suspect this is because the qplot's return value must be
2009 May 07
1
I updated/reinstalled ggplot2 and the trouble started...
Hi Ian, Per your suggestion, I reinstalled R 2.9.0, then I reinstalled ggplot2 on top. The problem persists. Here's the what happens after the installation: > qplot (carat, price, data = diamonds, alpha = I(1/10)) Warning message: In grid.Call.graphics("L_points", x$x, x$y, x$pch, x$size) : semi-transparency is not supported on this device: reported only once per
2008 Oct 28
1
does qplot works with Sweave?
Hi Hadley: I'm practicing writing a document using MikTex but can't make qplot to execute. It works when using 'plot' though. Is this a normal behaviour? \documentclass[9pt]{article} \title{ggplot2 example} \begin{document} \maketitle \section*{Examples of using ggplot2} The goal is to be able to import ggplot2 graphics into the annual report. Hadley Wickham has done a great
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
2007 Nov 08
1
ggplot2 facets as rows and columns
Does anyone (Hadley??) know if there's a straightforward way in ggplot2 to get data divided by a single factor to plot as a rectangular grid of subplots? So far I've only been able to get such data plotted as a single row or single column of skinny subplots. The code below gives an example implemented with lattice, and my best attempt in ggplot2 cheers Ben Bolker ------------ g=
2013 Jan 25
1
could not find function "qplot" after install.packages("ggplot2")
On OS X 10.8.2, after I installed ggplot2, and picked mirror of Singapore. it could not find qplot function. Could anyone pls help me ? Thank you. Pls see: > install.packages("ggplot2")--- Please select a CRAN mirror for use in this session ---also installing the dependencies ¡®colorspace¡¯, ¡®stringr¡¯, ¡®RColorBrewer¡¯, ¡®dichromat¡¯, ¡®munsell¡¯, ¡®labeling¡¯, ¡®plyr¡¯,
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
2010 Apr 02
1
Plots don't update with xlab, etc. What am I doing wrong.
Hi, I've been struggling with this problem the last few days and finally discovered it's happening at a very fundamental level. Going through Stephen Turner's tutorial on ggplot2, I entered these base graphics commands: > with(diamonds, plot(carat,price)) > with(diamonds, plot(carat,price), xlab="Weight in Carats", ylab="Price in USD",
2011 May 26
1
Question about ggplot2
Hi all, Is there any way for me to to string in the argument of qplot or ggplot? for example qplot(x='carat',y='price',data=diamonds,geom=c('point','smooth')) instead of qplot(x=carat,y=price,data=diamonds,geom=c('point','smooth')) Thanks!! Regards, TszKin Julian [[alternative HTML version deleted]]
2010 Sep 10
3
ggplot bar geom: control the filling in the colour legend
Hi all, Is it possible to change the filling of the squares used to represent the colour legend in a bar plot with ggplot? in this example, fillings are raven black, I'd like them white. ggplot(diamonds, aes(clarity, colour = cut)) + geom_bar() Regards -- ------------- Benoit Boulinguiez Ph.D student Ecole de Chimie de Rennes (ENSCR) Bureau 1.20 Equipe CIP UMR CNRS 6226 "Sciences
2010 Feb 26
1
ggplot2 : bug in coord_equal() ?
Hello, I think there is a bug in coord_equal when x s a factor : ggplot(diamonds, aes(clarity, fill=cut)) + geom_bar() ggplot(diamonds, aes(clarity, fill=cut)) + geom_bar() + coord_equal(1/2) David
2012 Aug 07
1
Styling gridExtra's title and left labels
Hi, I'm using the gridExtra package to combine some graphs like in the arrangeGrob example. Each of the graphs has a title but they appear much larger than the overall combined plot title and left axis label. Does anyone know how I can control the style / size of the gridExtra labels? library(gridExtra) library(ggplot2) dsamp <- diamonds[sample(nrow(diamonds), 1000), ] p1 <-