Questions tagged [aesthetics]

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.

210 questions
1
vote
1 answer

geom_dotplot not allowing continuous colour variable?

I'm trying to use dotplots to express both sample data and sample metadata. Both data are continuous, numerical data and grouped into several Accessions. Unfortunately I can't get the continuous 'age' data to work in geom_dotplot unless I change it…
Phil Lewis
  • 33
  • 4
1
vote
1 answer

Pass a variable-length string as an aesthetic to ggplot2 based on number of columns

I'd like to be able to build a string based on the number of columns in my matrix and pass that to ggplot as an aesthetic. This doesn't seem to be covered by the aes_string() function. The reason I want this is that I'm using the ggalluvial package…
data princess
  • 1,130
  • 1
  • 23
  • 42
1
vote
2 answers

facet_grid showing composition in percent with ggplot2

I'm trying to get a facet-grid of my data-frame. The purpose is to summarize the composition (in percent) of each clades (A, B, C, D, E, F) for every individuals (n=24). Also the sum of each clade is not 100%, but ultimately really close to it. None…
Homère
  • 13
  • 3
1
vote
1 answer

Facet plots and line graphs: how to plot and disconnect gaps in lines with groups

Updated to explain how this is not a duplicate question. I would like to remove the lines that connect the "data gaps" between the groups of lines in picture 1: Facet plot to fix, below. I am trying to recreate picture 2. (The lines in picture 2…
1
vote
1 answer

R ggplot2 whitespace in legend key when using override.aes for size

I've recently gotten frustrated by the same issue as reported here regarding the hacks required to make up for ggplot not adding NA fills to the legend (please if anyone knows an update to this, do tell). I therefore created a similar hack, but in a…
Emma Wiik
  • 57
  • 4
1
vote
2 answers

ggplot: geom_polygon - Error in length of Aestetics

I want to draw a scatterplot with three polygons in the background colouring specific areas. It should look like this. The code works fine with 4 variables on the y axis, but throws and error when I add a fifth. I can't figure out the reason. The…
j3ypi
  • 1,497
  • 16
  • 21
1
vote
1 answer

Grouped barplot with errorbars in ggplot2

Intro: I'm running into trouble plotting some errorbars on a grouped barplot. I'm trying to adapt some code that was originally used for a non-grouped barplot that I used to make the following figure: The Problem: Now I am trying to plot multiple…
philiporlando
  • 941
  • 4
  • 19
  • 31
1
vote
2 answers

ggplot: Error: Aesthetics must be either length 1 or the same as the data (10): x, y, group

I have a small dataset and I want to plot it with a line graph: > Gain quantile Positives Total_Examples Positive_Prevalence Lift Cumsum_Positives 1: (0, ] 1 1 1 1.428571 0.1428571 2:…
rf7
  • 1,993
  • 4
  • 21
  • 35
1
vote
0 answers

Drawing choropleth map - 'Aesthetics error' in ggmap

everyone! I am attempting to create a choropleth map of the Denver metro area, showing different housing values by census tract. When I try to map, it gives me 'Error: Aesthetics must be either length 1 or the same as the data (83658): x, y, group,…
1
vote
1 answer

R - parse function doesn't work as expected

In the following example (please notice differences in y-axis labels) I use a variable to fill in an axis label in ggplot2. Interestingly ~ produces much larger spaces, and extra spaces show up around an enlarged -. library(ggplot2) #LabelY <-…
EngBIRD
  • 1,915
  • 3
  • 18
  • 22
1
vote
3 answers

ggplot mapping Aesthetics error

I am trying to use ggplot to map an area and label based on values in the @data slot. My error is the same as in the questions here, here, and here, but I can't translate those answers to my problem. I can plot states from the US maps from getData…
tjr
  • 607
  • 2
  • 7
  • 20
1
vote
1 answer

Multiplot does not work sometimes - receiving Error: Aesthetics must either be length one, or the same length as the dataProblems

I am trying to make one plot consisting of multiple plots. These plots are made with ggplot (library("ggplot2")) inside a loop and saved into two lists. First list has the plots which should be on the left side of the multiplot and second list has…
sebastiann
  • 163
  • 10
1
vote
1 answer

The use of dynamic values in aesthetics doesn't refresh

In the following code, I'm trying to show for each feature of a dataframe, its relation with the rest of features. Thus, using Peter Haschke's multiplot approach, I've been able to show all the…
asuka
  • 2,249
  • 3
  • 22
  • 25
1
vote
1 answer

What is happening with my geom_line() in ggplot2?

I am no expert in R, but I have used ggplot2 many times and never had any problems. Still, this time I am not able to plot lines in my graph and I have no idea why (it should be something really simple though). For instance for: def.percent …
TWest
  • 765
  • 2
  • 6
  • 27
1
vote
0 answers

Aesthetics for graphs in R WITHOUT using ggplot

I looked for the easthetics to make the histogram look better in my R code, nonetheless I was wondering if I could change the size of the bins or maybe the margin or put a color background in the plot WITHOUT using ggplot. Thank you.
user3530361
  • 1,651
  • 2
  • 11
  • 5