57,707 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
0
answers
40
views
Customize multiple legends while defining each color individually in a facet_grid
The dataframe df0 below includes the following variables:
site: 3 remote partner laboratories (fixed number),
analyte: biomarkers measured at one or more of these sites (3 analytes in this example ...
1
vote
2
answers
73
views
Adjusting ggplot2 label intervals
I'm using geom_contour_filled + guide_colorsteps to generate a continuous legend, though I'm not entirely sure if this is permitted.
How can I make the labels in the legend appear at intervals?
...
5
votes
1
answer
113
views
Why margins are not considered in grid.arrange when parametrizing the code in R?
I'm using ggplot2 in R to create a set of plots, which I then arrange into a single composite figure using grid.arrange from the gridExtra package. I first created the plot I wanted for a single ...
4
votes
1
answer
140
views
How to repel texts equidistantly on a secondary y-axis of a facet_grid?
It is possible to insert variable names and their specific values between the last column of facets and the strips of a facet_grid, using the scales_y function provided by Stefan.
However, these ...
1
vote
2
answers
73
views
How can I add some text to a ggplot2 graph in R outside the plot area?
I have a simple dataset in R.
horz <- rnorm(100)
letters <- letters[1:10]
dat <- data.frame(horz, letters)
I am plotting a graph using ggplot2.
library(ggplot2)
ggplot(dat, aes(x = horz, y = ...
2
votes
1
answer
113
views
Insert variable names and their specific values between the last column of facets and the strips of a facet_grid in R
The dataframe df includes the following variables:
x and y: the coordinates of concentration y as a function of x,
bmk: the biomarkers for which the x and y coordinates are given,
qc: the quality ...
-1
votes
0
answers
49
views
Error plotting global shapefile over the dateline in R [duplicate]
I am trying to plot a global dataset of seamounts (full shapefile data can be found here).
seamounts <- st_read("YessonEtAl2019-SeamountBases-V2.shp")
I want to plot it centred on the ...
1
vote
0
answers
126
views
Print out plot with unicode symbol to PDF
I am using a Unicode symbol in my plot. It looks fine in RStudio, but when I try to save them to PDF, it disappears. How one can keep the Unicode symbols in PDF?
library(ggplot2)
plot <- ggplot(...
Stataq's user avatar
- 2,461
0
votes
1
answer
96
views
Show all other groups in grey behind each panel [duplicate]
I have this dataframe (see the code below) and the following plot.
What I need is a plot like the mock-up attached (made in PowerPoint): In each facet panel, I want to show in light grey all the data ...
3
votes
2
answers
147
views
Add significant differences in brackets in a half-violin plot
I am trying to make a half-violin plot. I want to add the significant differences as brackets above the halves, with an asterisk indicating significance.
Because I want to group the data into two ...
1
vote
0
answers
33
views
Issue with using ggdist::stat_halfeye() to plot within ggplot in R. Is this a compatibility issue? [duplicate]
I recently updated both ggdist, tidybayes, and ggplot2 in R, and now some code that I had previously running is not longer working. Instead I get the error message:
in self$geom$use_defaults(data, ...
0
votes
0
answers
105
views
How to get both plots on the same scale
Image of two graphs combined together:
I am currently attempting to make a ggplot with a boxplot and a path plot on the same image, the path plot is supposed to intersect with the median areas of the ...
1
vote
2
answers
152
views
Customizing label format in facet nested plots with ggplot2
I am trying to create a series of plots using ggplot2 in R, and I want to customize the labels in the facet nested plots, particularly to include subscripts for the ICC labels. Below is my attempt, ...
-1
votes
0
answers
44
views
How can I combine the two legends of my plot so the corresponding symbol and colour of each specimen are combined into one legend? [duplicate]
I have made a plot of a principle component analysis using ggplot2 (geompoint) and I currently have two legends, one showing the pch shape of each point and one showing the colour of each point. I ...
3
votes
1
answer
71
views
Facet breaks either sjPlot or geom_point
I am trying to produce with faceted sjPlot lines, and geom_points. mtcars data supplied as an example.
fit <- lm(mpg ~ cyl * hp * am, data = mtcars)
I want to have slopes of mpg by hp for each cyl,...