r-grid Questions

1

Solved

I am investigating the new pattern functionality of grid. So far, I can cross-hatch a rectangle: library(grid) # Note that using absolute coordinates like "cm" for # x and y does not wor...
Prolix asked 2/11, 2023 at 14:56

2

Solved

Several functions in R's base graphical system, including rect() and polygon(), support cross-hatching via their angle= and density= arguments: x = c(0, 0.5, 1, 0.5) y = c(0.5, 1, 0.5, 0) par(mar=...
Treachery asked 29/9, 2014 at 22:51

3

I have 4 leaflet objects: A, B, C, D. I would like to plot them in a 2 by 2 grid, but I have been having a difficult time trying to do this. My initial thought was to use ggplot and facet_grid, b...
Melody asked 18/7, 2017 at 19:1

5

Solved

With grid.arrange I can arrange multiple ggplot figures in a grid to achieve a multi-panel figure by using something like: library(ggplot2) library(grid) library(gridExtra) generate some ggplot2...
Schock asked 13/11, 2011 at 14:26

2

Solved

I need to put Greek letters into facet labels using facet_wrap() in ggplot2. I found a Link describing the same for facet_grid(). I applied this for my data, using the following code: levels(param...
Scrawly asked 29/6, 2011 at 19:4

2

Solved

I just updated R, R Studio, and a bunch of packages including ggplot2 and gridExtras on my Mac. Now gridExtras is failing in basic plotting with the error: "only 'grobs' allowed in "gList"" Here'...
Ophthalmia asked 17/1, 2016 at 13:31

2

I would like to save multiple plots (with ggplot2) to a list during a large for-loop. And then subsequently display the images in a grid (with grid.arrange) I have tried two solutions to this: 1 s...
Mounts asked 11/8, 2015 at 16:59

3

Solved

I am trying to combine facet strips across two adjacent panels (there is always two adjacent ones with the same first ID variable, but with two different scenarios, let's call them "A" an...
Czechoslovakia asked 30/6, 2020 at 7:27

1

Solved

This is mostly a follow-up question on a previous one. Given that in ggplot2 and grid there are different linetypes and spacings vary between line sizes, what is their relationship? There are two t...
Uniformize asked 25/7, 2020 at 12:58

2

Solved

I've been attempting to plot lines in either ggplot2 or grid with equal spacing between line segments when the sizes differ. However I've not been succesfull so I ask you for help. In the examples ...
Walworth asked 23/7, 2020 at 19:16

1

Solved

I have a plot like this below: library(ggplot2) library(ggh4x) # remotes::install_github("teunbrand/ggh4x") df1 <- data.frame(x = rep(1:12, times=4, each=1), y = rep((1:12)^2, times=4, each=...
Hawser asked 26/5, 2020 at 19:4

4

Solved

I'd like to add colors to certain words in titles to my graphs. I've been able to find some precedent here. Specifically, I'd like the text that's wrapped in apostrophes (in the output, below) to c...
Tweeze asked 4/9, 2016 at 21:4

2

Solved

I just built a grid with package cowplot (to label the plots from A-D). The plots are made with package ggplot2: pfour<-ggplot(four, aes(x=Concentration, y=Percentage, fill=Phenotype)) + geom...
Wry asked 19/5, 2016 at 23:34

1

Solved

How do I edit a common legend title (make it bold font and enlarge the font size) using ggarrange? Based on the six plots I have (p1 to p6), I thought the following would work: p6 <- p6 + theme(...
Trilateration asked 3/12, 2019 at 17:57

2

Solved

My problem is somewhat related to Convert units from npc to native using grid in R . I'm trying to figure out the location of certain plot elements start in a ggplot2 object (axes, main plot, etc)...
Selenaselenate asked 15/10, 2019 at 9:51

3

Solved

I am having a hard time making the title of a legend center-aligned relative to the legend keys when the legend title is long. There is a question from a year ago that works for short titles, but i...
Leatherback asked 28/12, 2017 at 0:46

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 want longer tick marks for those with labels in a facet grid. So I worked through this attempt and tried to adapt it to facet gridded plots like so: Defining breaks and labels, minor and major: ...
Statampere asked 6/12, 2018 at 22:32

2

Solved

I have made a plot like the one described by the code below resulting in the posted image. I can not figure out how to set the entire background to the same "grey80"-color I have used when defining...
Eighth asked 12/1, 2016 at 22:56

2

Solved

I am using grid.arrange from gridExtra package to put two graphs on one page and save it to a png file. I like to change the background colour of the final png file that is produced by grid.arrange...
Labarum asked 3/12, 2012 at 20:47

1

I've got a polar plot which uses geom_smooth(). The smoothed loess line though is very small and rings around the center of the plot. I'd like to "zoom in" so you can see it better. Using somethin...
Livorno asked 5/2, 2016 at 13:29

2

Solved

At Facebook research, I found these beautiful bar charts which are connected by lines to indicate rank changes: https://research.fb.com/do-jobs-run-in-families/ I would like to create them usin...
Liebman asked 17/10, 2018 at 22:24

2

Solved

as a new ggplot2 user, I am a bit lost with the amount of possibilities, and struggle to find on the net a simple answer to what I consider a simple problem. I would like to display multiple plots...
Russ asked 16/2, 2012 at 17:3

1

Solved

Using VennDiagram package I'm generating two graphs in the following manner: # First graph VennDiagram::draw.pairwise.venn( area1 = 100, area2 = 70, cross.area = 30, category = c("A1", "B1"), ...
Leaguer asked 28/5, 2018 at 17:13

1

I'm wondering if there's an efficient way to map data onto legend text color in ggplot2, just like we can do with axis text. Reproducible example follows. First, let's make a plot: library(ggplot...
Mesothorium asked 26/12, 2017 at 17:7

© 2022 - 2024 — McMap. All rights reserved.