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...
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=...
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...
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...
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...
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'...
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...
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...
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...
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 ...
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=...
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...
2
Solved
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(...
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)...
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...
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 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...
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...
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...
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...
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...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.