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
0
votes
1 answer

Changing colors of color=as.factor() in geom_line aestetics

Good evening everyone, this is my first post on stack overflow so I hope you'll forgive me for my level of english and if I made some "rules" mistake. I am working, for a school project, on some cool visualization with ggplot2 on the dataset…
0
votes
0 answers

How to have two Tkinter sliders interact in an aesthetically pleasing way

I've been working to create a random character generator for D&D that uses probability based of data entered by the user, and I've hit a snag where it comes to the use of sliders. In my code, the aim is to have the user enter information about a…
0
votes
1 answer

R - Coloring the area under/above a line in different colours using geom_ribbon

I have a simple line graph which fluctuates around zero. Using geom_ribbon, I would like to color the area between the line and zero in two different colors, depending on whether the line is above or under zero. Using a single color to fill the area…
Rasul89
  • 588
  • 2
  • 5
  • 14
0
votes
3 answers

programming with ggplot using aes_ or aes_string with special characters in column names

I need to run ggplot in a function. The input data.frame/tibble passed to the function has special characters (white spaces, commas etc.) in the columns with data to be plotted. The column names to be plotted are passed as arguments to the function.…
jmf11
  • 1
0
votes
1 answer

R - Aesthetics must be either length 1 or the same as the data

I can't seem to get around this error where it says the aesthetics must either be length 1 or the same as the data, which in my case is 368. I have created two variables from the data, both of which are 18 values. These are my x and y values, where…
redleg_64
  • 39
  • 1
  • 8
0
votes
2 answers

ggraph can't select columns for geom_node or geom_node_text aes variables

When I try using variables for geom_node_point or geom_node_text I keep getting errors, no matter what I do. Here's what I was trying at first. library(igraph) library(ggraph) library(tidyverse) graph3 <- graph_from_data_frame(test, directed =…
0
votes
1 answer

Addition of errorbars in line graph in R (ggplot)

I have been trying to create a graph that includes the replicates of some measurements (showed with points), the averages, and how they changed with time (showed with a line) and then I wanted to add errorbars to the graph. Here it is what I have: A…
Juli P
  • 1
  • 1
0
votes
1 answer

Can ggplot2 geom_segment size be specified as a proportion of the axis size?

I have a geom_segment in a plot and would like its size to scale relative to the y axis. For example: iris %>% group_by(Species) %>% summarise(avg_sepal_length = mean(Sepal.Length)) %>% ggplot(aes(x = Species, y = avg_sepal_length)) + …
dankshan
  • 55
  • 5
0
votes
1 answer

Error: Invalid input: date_trans works with objects of class Date only // Not sure how to fix

I keep getting the following error and can't figure out what's going wrong. Please helps! Error: Invalid input: date_trans works with objects of class Date only My code is below. #Problem 3b: Plot a line graph of the average monthly consumption in…
Morgan
  • 1
  • 1
0
votes
1 answer

Error: Aesthetics must be either length 1 or the same as the data (9): label

I get this error after I filter a simple datafarme, from 12 obs to 9, both with 2 variable... tmp_Type <- c("A", "B", "C","D", "E", "F", "G", "H", "I", "J", "K", "L") tmp_Sum <- c(380000.2,0,1500,4532,2,34567,29344,545,838.5,1000,0,0) tmp_Sum <-…
user14610463
0
votes
0 answers

Is it possible to shorten several layers of 'for in' with actions at each layer?

I am solving a Sudoku kata on Codewars and here is my code: def valid_solution(S): s=[];L=[];l=[];S1=S[:3];S2=S[3:6];S3=S[6:] def verif(S): for i in S: if len(set(i))!=9 or 0 in set(i): return False for z in…
user13911186
0
votes
1 answer

Warning gets to Error in RShiny: Ignoring unknown aesthetics: text

I'm doing the following: ## Get the world map: ## worldMap <- getMap() ## Define vector with all European countries: ## v.europe <- c("Norway", "Sweden", "Finland", "Denmark", "United Kingdom","Ireland", "Greece", "Belgium",…
MikiK
  • 398
  • 6
  • 19
0
votes
0 answers

How can I change the appearance of axis labels in plot from ggpredict?

I am creating a plot using ggpredict and would like to alter the notation used for the y-axis labels (they are displayed using exponential+00 notation - it looks ugly). The code I am using looks like this: Model <- glm(Proportion ~ poly(Year,2) *…
Jennifer
  • 13
  • 4
0
votes
1 answer

"Aesthetics must be either length 1" with different x, y and colour arguments

I have a problem that should be quite simple to fix but I haven't found any answers that are directly applicable to my situation. I am trying to create a plot with geom_point in which the points shown are a filtered value from a character vector. y…
0
votes
1 answer

How to change legend size with multiple aesthetics/ increase space between variables within legends in R

My question has two parts. Below I've provided example data and the code to create a representative plot using ggplot structure(list(x = c(2.93131952459005, 3.21275054434318, 1.36466997175509, 2.13626543532502, 1.45889556823722, 1.94598707699052,…
ljh2001
  • 391
  • 3
  • 17