diff --git a/cran-comments.md b/cran-comments.md index 7ee27e2..00fea0c 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -4,7 +4,14 @@ * local OS X install x86_64-apple-darwin13.4.0 (64-bit), R 3.2.3 ## R CMD check results -There were no ERRORs, WARNINGs, or NOTEs. +There were no ERRORs or WARNINGs. + +There is one NOTE, about spelling: +Possibly mis-spelled words in DESCRIPTION: + Wilke (11:55) + Wilke's (12:45) + +Both spellings are correct. ## Downstream dependencies None exist at this time. diff --git a/vignettes/plot_grid.Rmd b/vignettes/plot_grid.Rmd index 62d27ab..caf1c32 100644 --- a/vignettes/plot_grid.Rmd +++ b/vignettes/plot_grid.Rmd @@ -52,25 +52,6 @@ plot_grid(plot.iris, plot.mpg, labels = "AUTO", ncol = 1, align = 'v') # aligning does not work here ``` -In cases where `plot_grid()` cannot automatcially align plots, you can still align them manually if you have some knowledge of gtable, the internal layouting mechanism used by ggplot2. You simply have to convert both graphs into gtable objects and then adjust the relevant widths or heights. For the plot from the previous example, for example, you could do the following: -```{r, message=FALSE, fig.width=4.25, fig.height=5.1} -require(grid) # for unit.pmax() -g.iris <- ggplotGrob(plot.iris) # convert to gtable -g.mpg <- ggplotGrob(plot.mpg) # convert to gtable - -iris.widths <- g.iris$widths[1:3] # extract the first three widths, - # corresponding to left margin, y lab, and y axis -mpg.widths <- g.mpg$widths[1:3] # same for mpg plot -max.widths <- unit.pmax(iris.widths, mpg.widths) # calculate maximum widths -g.iris$widths[1:3] <- max.widths # assign max. widths to iris gtable -g.mpg$widths[1:3] <- max.widths # assign max widths to mpg gtable - -# plot_grid() can work directly with gtables, so this works -plot_grid(g.iris, g.mpg, labels = "AUTO", ncol = 1) -``` - -Notice how now the y axes in plots A and B are located at exactly the same horizontal position. - # Fine-tuning the plot appearance You can adjust the label size via the `label_size` option. Default is 14, so larger values will make the labels larger and smaller values will make them smaller: diff --git a/vignettes/shared_legends.Rmd b/vignettes/shared_legends.Rmd index 4240534..9f0d103 100644 --- a/vignettes/shared_legends.Rmd +++ b/vignettes/shared_legends.Rmd @@ -69,7 +69,7 @@ legend_b <- grobs[[which(sapply(grobs, function(x) x$name) == "guide-box")]] # add the legend underneath the row we made earlier. Give it 10% of the height # of one plot (via rel_heights). -p <- plot_grid( prow, legend_b, ncol = 1, rel_heights = c(1, .1)) +p <- plot_grid( prow, legend_b, ncol = 1, rel_heights = c(1, .2)) p ```