grob Questions
2
Solved
Given the following plot:
library(tidyverse)
p <- ggplot(mtcars, aes(drat, disp)) +
geom_line()
p
layer_scales can be used (here) to extract breaks/break positions from most ggplot objects li...
1
Solved
I am somewhat surprised that this has never caught my attention (I guess I've never drawn much with round line ends until today).
When drawing a segment with round line end, this is "of course...
3
Solved
I am trying to customize a ggplot2 plot containing facets, and would like to change both the colour of the facet strip, as well as the colour of the font. I found some code to change the strip.back...
2
Solved
Is there a way to keep points that are jittered on a map within a boundary of that map? In the example below, where jittered locations in southwestern Connecticut end up in the water or in an adjoi...
Ataxia asked 23/12, 2014 at 14:37
3
Solved
This is a follow up to my previous question where I was looking for a solution to get the axis drawn first, then the data. The answer works for that specific question and example, but it opened a m...
1
Solved
How can I get the x, y coordinates of a geom_point in a ggplot, where the reference frame is the entire plotted image?
I can create a ggplot with some geom_points using:
library(ggplot2)
my.plot...
1
Solved
I'm drawing several ggplot2 objects and placing them on a grid.arrange inside a call to a 'pdf' device. I've found that the PDF performs about a billion times better (generates faster, renders fast...
Jorrie asked 28/4, 2016 at 20:2
3
Solved
I have a function which manipulates a ggplot object, by converting it to a grob and then modifying the layers. I would like the function to return a ggplot object not a grob. Is there a simple way ...
1
I am using grid_arrange_shared_legend to combine plots with the same legend into one plot with one legend. Is there a way to edit the function slightly so it also shares the x and y axis labels? Fo...
2
Solved
I aiming to draw a pyramid plot, like the one attached.
I found several example using ggplot, but I am still struggling with the adoption of my example to my data (or the data that I want to plo...
2
Solved
I am trying to apply a clipping mask to a geom from a ggplot to mask part of the data, but keep the axis, the grid, other geoms and the legend visible. I do not want to create a specific plot, and ...
1
Solved
I'm attempting to plate two plots in the same .jpg using arrangeGrob().
I've only just started learning about grids and grobs and I think I know what the problem is: pheatmap is a grid object and c...
1
Solved
I have some ggplot functionality, but I want to give users a warning in case they abuse it heavily. The problem is this: if there are many groups and the group names are long, the legend becomes so...
2
Solved
In plots with multiple facet variables, ggplot2 repeats the facet label for the "outer" variable, rather than having a single spanning facet strip across all the levels of the "inner" variable. I h...
1
1
Solved
I have created an extensive theme to plot in ggplot similar to Five Thirty Eight. Without using ggthemes, how can I utilize linesGrob to draw a line above my footer that is centered and goes 85% of...
2
Solved
I can't get the answer to this question to work.
What both me and that user want is to add axis ticks and labels to all columns when using facet_grid().
Display y-axis for each subplot when face...
Mila asked 3/6, 2016 at 16:40
1
I have been trying to make a 2 to 3-line figure caption below the combined plots using the following script:
library(grid)
library(gridExtra)
library(ggplot2)
g1 <- ggplotGrob(pl) #pl is my pl...
3
Solved
I am attempting to use grobs and gtable to arrange 4 (ggplot2) plots into a 2x2 grid. I don't know how to set widths, and also a non- 1xn, or nx1 arrangement.
Using this code:
data(iris)
a <- ...
1
Solved
b <- ggplot(cars,aes(x=speed,y=dist))+geom_line()
grid.arrange(
b,
plot(cars),
ncol=1
)
gives me the following error
Error in gList(list(grobs = list(list(x = 0.5, y = 0.5, width = 1, he...
3
Solved
I have some relatively simple code to create a table for printing to a PDF:
library(gridExtra)
df <- head(iris)
tableGrob(df, gp = gpar(fontsize = 8), rows = NULL)
I'd like to make the last r...
2
Solved
I would like to remove the large spacing that is inserted by default between the plots and the table in a grid.arrange, as shown in the MWE hereafter:
require(ggplot2)
require(gridExtra)
list1=da...
1
I am attempting to create and export, as a PNG file, with several plots arranged in a 3 X 2 matrix. Each row (containing two plots) has its own X axis. I can add the additional axes via a grid.text...
1
Solved
I am trying to plot a number of graphs next to each other using grid.arrange. Specifically, I would like the plots to have a shared x axis label and a legend at the bottom. Here is the code I am us...
3
Solved
corrplot plots a correlation matrix, but it does not return a graphical object (grob)
I would like to plot several correlation matrices on a single page. For normal plots, I would use grid.arrange...
Conchita asked 13/1, 2015 at 18:56
1 Next >
© 2022 - 2024 — McMap. All rights reserved.