Aes, short for "aesthetics" is an R Library, used to "Generate aesthetic mappings that describe how variables in the data are mapped to visual properties (aesthetics) of geoms." The aesthetics tag should **not** be used to reference software's artistic merit.
Questions tagged [aesthetics]
210 questions
2
votes
1 answer
Is there any way to add a color palette into the size aesthetic?
I am working in the next code: ggplot()+ geom_sf(data = DPEst_DH, aes(size = di1a), col="orangered") that works.
But I want a colored legend.
In other words, I want apply the same field at two aesthetics, size and color but keeping one legend.
...+…

3_catsmx
- 35
- 5
2
votes
1 answer
How to prevent R from alphabetically ranking data in ggplot and specify the order in which data is plotted (Data + Code + Graphs provided)?
I'm trying to fix an issue with my GGBalloonPlot graph with regards to how R processes the axis labels.
By default R plots the data using the labels ranked in reverse alphabetical order but to reveal the pattern of the data, the data need to be…

Etienne
- 23
- 4
2
votes
1 answer
How can I highlight specific genes in Bioconductor Enhancedvolcano?
I like the package EnhancedVolcano. My data is RNAseq and I analyse it with DESeq2. I want to plot the results as a volcanoplot where I highlight a list of genes of my choice picked_genes. I have succeded in changing pointSize and I am using…

Malin
- 41
- 3
2
votes
1 answer
geom_violin using the weight aesthetic unexpectedly drop levels
library(tidyverse)
set.seed(12345)
dat <- data.frame(year = c(rep(1990, 100), rep(1991, 100), rep(1992, 100)),
fish_length = sample(x = seq(from = 10, 131, by = 0.1), 300, replace = F),
nb_caught = sample(x =…

jordan_oplante
- 75
- 8
2
votes
1 answer
error in R plot_usmap() when trying to color counties by outcome variable
I'm trying to map an outcome measured at the county-level in Idaho. I'm not understanding the error message below. The following code reproduces the error. I've tried limiting map.data to just one row per county, but this also results in an…

rem342
- 23
- 3
2
votes
0 answers
Trouble with ggplot in R - "Error in f(...) : Aesthetics can not vary with a ribbon"
I am trying to plot the plot the data of three constituents on the same plot using ggplot. Specifically, I am trying to get a stacked line/area plot that represents the data distribution. The three constituents each have 451 values, hence why I have…

Kelsee Bratley
- 21
- 1
- 2
2
votes
1 answer
Aesthetics must be either length 1 or the same as the data issue is ggplot
I am trying to plot a line graph in ggplot. But I am geeting this error:
Aesthetics must be either length 1 or the same as the data (9): y, x, group
This graph contains 4 lines. I have one more graph which makes use of same data frame but…

qwww
- 1,313
- 4
- 22
- 48
2
votes
1 answer
Swimmer survival plot ggplot_Events color coded by time duration
One question regarding the time axis for Swimmer waterfall plot.
I generated the swimmer plot using the code below>
However, I would like to have the bars for each subject colored by the responseType (rather than "Stage") based on the…

rk123
- 67
- 1
- 8
2
votes
1 answer
Color and shape aesthetics in facet_grid when margins presented
Consider the following data:
n <- 1000
data <- data.frame(id = 1:n,
a = sample(c("a1", "a2"), n, replace = T),
b = sample(c("b1", "b2", "b3"), n, replace = T),
x = rnorm(n),
y =…

Matiasko
- 187
- 9
2
votes
1 answer
ggplot aes fill not working for no discernible reason
I have made ggplot figures hundreds, if not thousands of times, and set the fill to be based on a variable in the df using aes about 99% of the time. For some reason the fill color is not working (points are black every time) and I cannot figure out…

Ed2122
- 37
- 1
- 1
- 7
2
votes
2 answers
How to mix aes_() and arithmetic calculation in ggplot2?
I am trying to adjust x and ymax in the following script in ggplot2 package in R to adjust plotting coordinates of errorbar, however it returns errors.
gplot <- function(prd) {
ggplot() +
…

HSJ
- 687
- 6
- 16
2
votes
1 answer
ggplot size aesthetic with smaller dots
This is probably a simple question, but I don't know the answer off the top of my head. Is it possible to rescale the dots in ggplot, without ruining your size aesthetic?
Basically, let's say I have the following:
data <- data.frame(size=c(1, 1, 2,…

Eric
- 946
- 2
- 12
- 25
2
votes
1 answer
Change legend order ggplot bar
I made a barplot in ggplot, but, purely for aesthetic reasons, I want to change the order of the Legend categories. Here's my script:
library(ggplot2)
df <- data.frame(Month = c(4, 5, 6, 7, 8, 9, 10, 11),
variable = rep(c("Outlier",…

SHW
- 461
- 7
- 26
2
votes
1 answer
Changing color of data points in ggplot
First I run this code and it works perfectly (all data points turn blue):
ggplot(data = mpg) + geom_point(mapping = aes(x = displ, y = hwy), color = "blue")
But when I try move around the mapping like below, the data points turn black instead of…

Thewalkindude
- 41
- 2
2
votes
1 answer
Aesthetic error in R ggplot2
I'm trying to fill watersheds by amount of water used by fracking. I have the dataset(well_watershed_ok) and the variable(H2O_BBL_T). There is one value for each watershed. This was the code I was using.
ggplot() +
geom_polygon(data =…

AU95
- 21
- 1
- 3