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...
Burthen asked 24/10 at 18:52

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...
Phalange asked 16/11, 2023 at 11:28

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...
Copper asked 24/11, 2018 at 4:14

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...
Phaeton asked 30/4, 2021 at 12:40

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...
Liris asked 22/3, 2020 at 18:35

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 ...
Wellmeaning asked 22/10, 2014 at 2:54

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...
Lymanlymann asked 13/9, 2017 at 15:12

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...
Urbanity asked 29/5, 2019 at 9:45

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 ...
Heady asked 6/8, 2018 at 21:30

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...
Gon asked 20/9, 2016 at 9:46

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...
Subsolar asked 21/8, 2017 at 9:52

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...
Meingoldas asked 22/11, 2016 at 1:49

1

I would like to generate ggplot’s with gradient coloring, filling both plot panel and its background, as herein shown. As you can see the gradient background coloring encompasses both plot panel...
Garotte asked 22/9, 2016 at 7:9

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...
Strapless asked 29/8, 2016 at 21:33

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...
Claresta asked 15/3, 2016 at 1:21

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 <- ...
Oldwife asked 28/1, 2016 at 17:31

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...
Triennial asked 20/11, 2015 at 12:2

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...
Prophase asked 24/8, 2015 at 3:5

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...
Archangel asked 21/8, 2015 at 13:20

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...
Roberto asked 23/6, 2015 at 21:3

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...
Boomerang asked 18/7, 2014 at 13:50

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

© 2022 - 2024 — McMap. All rights reserved.