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
1
vote
1 answer
ggplot2 missing aesthetics with dichotomous variable
Edit: I have plotted a likert scale with 15 different categories (Q002_1 - Q002_15) to answer, see graph down below.
What I now want is to plot this graph (code below) as dichotomous variable with ggplot2, see this question for further details.
I…

Til Hund
- 1,543
- 5
- 21
- 37
1
vote
1 answer
The fill legend is not updated when used with other aesthetics in ggplot2?
In the below bubble plot, my intention is to have legends for shape, size, and fill aesthetics.
The first two went well, but the fill aesthetic for cluster was lost and all clusters appeared as black dots, is this a bug in ggplot2 or what? please I…

doctorate
- 1,381
- 1
- 19
- 43
1
vote
3 answers
How can I make this plot for each column in my data frame using sapply and ggplot2?
I would like to make the same plot for each column of data in a data frame below called df.
Edit: to clarify, I would like to make a new plot for each column (Cop, CopN, Harp) etc as in my actual data I have many (i.e. far to many to try and grid…

wonderoustree
- 87
- 2
- 11
0
votes
1 answer
Dodge geom_points based on only a single grouping variable when there are multiple grouping variables
I am having an issue with trying to dodge points only by the color aesthetic when I am also using another aesthetic for shape. When I add the option to dodge, it dodges the points such that each shape+color option is dodged. Is there a way to…

Jeff
- 3
- 1
0
votes
1 answer
How do I access data of ggplot2 / gganimate object from ggplot geom_* or arrange data in reliable order
I have an issue with ordering of rows from source filtered dataset used for building gganimate object.
Here is the sample data:
df <- data.frame(grName = c("red", "red", "orange", "yellow", "green", "green", "orange",
…

asd-tm
- 3,381
- 2
- 24
- 41
0
votes
1 answer
How to set different colours for the lines representing different group membership in geom_smooth
My group variables (group_var) has two levels. I have produced a scatterplot with "Y" = blue and "N" = red. Since I have a lot of points, if I don't set a colour for the line in the geom_smooth argument, it's hard to pick out the two lines (one red…

Jess
- 11
- 2
0
votes
0 answers
Adding vertical gene connection lines and improving color palette in ggplot2 and gggene
I am currently working on visualising a gene dataset using the ggplot2 and gggene package in R to showcase the conservation of gene neighbourhood or synteny across evolution. I have successfully created a gene plot with arrows representing genes,…

Rohan Nath
- 11
- 2
0
votes
1 answer
plot_model() keeps returning NULL in theme features
I am making use of the plot_model() predictive function for a multiple linear regression and am not able to modify aesthetics. I have read both that it is a part of the sjplot package as well as a wrapper for ggplot. While I have gotten pretty…

lisaohhh
- 3
- 2
0
votes
1 answer
how to plot side by side histogram for two different groups
I want to plot histogram for two different group in R.
I tried using ggplot2 package and base R hist function.
I want to plot the groups value side by side and not a stacked histogram.
I am able to do it using basic hist function but since my values…

Rhea Bedi
- 123
- 6
0
votes
1 answer
ggplot_2 geom_smooth dropped aesthetics
Suppose the data are as follows: 2 continuous variables (variable_1 and variable_2), a group factor with 4 levels and a treatment factor with 2 levels.
df <- structure(list(group = structure(c(1L, 1L, 1L, 1L, 1L, 2L, 2L,
2L, 2L, 2L, 3L, 3L, 3L, 3L,…

Istrel
- 2,508
- 16
- 22
0
votes
2 answers
facet_grid, extra unintended NA line in plot
I´m creating a plot using the facet_grid function of ggplot2 where every panel consists of a scatterplot with connected lines of 5 variables.
My data can be found here.
I used this code from the referred link to create the output…

Kevin
- 47
- 6
0
votes
0 answers
ggplot: Setting fill and color to the same factor variable
I'm plotting some points on a map of the US like this:
gmed2 <- ggplot()
gmed2 <- gmed2 + geom_map(data = us, map = us, aes(x = long, y = lat,
map_id = region), fill = "white", color = "black", alpha = 0.7)
gmed2 <- gmed2 + geom_map(data =…

Karl Wolfschtagg
- 425
- 2
- 10
0
votes
2 answers
Incorrect mapping of group aesthetic in geom_line() to a variable
I am trying to plot the results of a study with within-subjects experimental manipulations in ggplot2. I would like geom_line() to connect the points of the same subject between different trial types but not between conditions (see figure below).…

Nolandinoparty
- 3
- 2
0
votes
0 answers
While using ggplot with Titanic dataset I am getting the error "Problem computing aesthetics. Error occurred...object not found
Here is the code followed by the error code. The variable new.title was created and then used in the code, but for whatever reason I am getting the error and cannot find what I have missed.
data.combined$new.title <- as.factor(titles)
…

Woody
- 1
0
votes
1 answer
Plot linear mixed-effects model using function ggemmeans
Say, I have a linear mixed-effects model:
## create data
iris$group = c(rep('A', each = 75),
rep('B', each = 75))
iris$id = rep(c(1:10), each = 15)
## assign contrasts
iris$group <- factor(iris$group, levels=c('A',…

Alex M
- 129
- 1
- 7