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

Stacked bar plot with points, but with different aestetics length - ggplot2

I have a dataframe which I used the melt function to get to this (length = 118): record_id value Values 1 8 int_to_out 20 2 14 int_to_out 32 3 5 int_to_out 22 4 6 …
Lucas Lazari
  • 119
  • 9
0
votes
0 answers

Legend in aes_string for a Loop rstudio

I have a problem with displaying the legend on the chart. Using aes_string does not appear to me. Could you help me to show some kind of legend on the chart? The data I have is the following: > head(rev_countries) US China …
GFHR
  • 11
  • 1
0
votes
1 answer

Get the unquoted value of a string variable inside of aes() call

I would like to generate a hovertext for ggplotly() using aes() along the lines of mapping <- aes(text = paste0( "Value: ", columnName )) where columnName is a variable containing a column name as a string. Now, I don't want columnName…
NiklasvMoers
  • 309
  • 2
  • 13
0
votes
1 answer

Set geom_vline line types and sizes with aes mapping in ggplot2

I'm trying to create a histogram with vertical lines overlaid on top of it. One of the vertical lines shows a target, the rest show percentiles. I would like the line representing the target to be different than the other lines. I have the data for…
TomAdair
  • 321
  • 1
  • 10
0
votes
1 answer

remove the break in the line being caused by lty

I have a time series I would like to plot in ggplot. I want to show that there's a break in the data at a certain point. I believe a good way to do this is by varying the line type (ie lty). However, doing so makes an annoying break in the plot. Is…
user1713174
  • 307
  • 2
  • 7
0
votes
1 answer

How to hide legend for geom_label only in ggplot?

I have a ggplot object to plot an outcome by days of the week as such: ggplot(weekdays, aes(x=weekday, fill=weekday, y=outcome_mean, ymin=outcome_lci, ymax=outcome_uci)) + geom_col() + geom_errorbar() + theme_bw() + …
Mel
  • 700
  • 6
  • 31
0
votes
1 answer

How to manually set colours *conditionally* in aes() AND local geom_xxx() in ggplot?

I'm trying to make a function that can take either a single group, or several groups, while using a single colour argument. However, there seems to be a problem in specifying colour both globally (in aes()) and locally (in geom_smooth()). Looks like…
rempsyc
  • 785
  • 5
  • 24
0
votes
1 answer

Is there anyway to change the size of values in ggplot in R (geom_point)?

The values are automatically set as 0.25, 0.50, 0.75, and 1. However, I would like to change these ranges, specifically make them smaller numbers. Here is my code. I also added some sample data, as you can see the p-values (the variable I am…
Josh
  • 23
  • 5
0
votes
1 answer

ggplot2: adding both a size legend and a colour legend: only one appears automatically

Dataset (originalRfiltered3): https://www.dropbox.com/s/fekw0o7ybdilnpr/originalRfiltered3.xlsx?dl=0 or dput output here: http://txt.do/15k69 I am trying to plot the following plot To achieve this i did the following: ggplot(originalRfiltered3,…
Lasse Eli
  • 13
  • 4
0
votes
1 answer

two different legends from one dataset

I am trying to have two legends: one based on variable c and the other on variable d, defined by their own shape and size. I do know if this is possible in ggplot2? Maybe it is not fitting to the philosophy behind the use of ggplot2. If I transform…
user1157485
0
votes
1 answer

Set Ticks in Seaborn Countplot

I have used the following code to set xticks in seaborn but this is not working. My xticks labels are coming from a list and they are already sorted correctly. [i[0] for i in jobs] ['admin.', 'blue-collar', 'entrepreneur', 'housemaid', …
Odisseo
  • 747
  • 1
  • 13
  • 32
0
votes
1 answer

Plotting several lines in one diagramm

I have a time series which shows the electricity load for every 15min during one year. I already filtered to show only one specific weekday. My dataframe: Date Timestamp Weekday Load 2017-01-02 00:00:00 Monday …
Solar
  • 1
  • 2
0
votes
1 answer

ifelse() condition not working correctly for ggplot

I have data as shown below that I want to plot using ggplot: > C State C1 C2 1 var1 -5.3458708 2.4959909437 2 var2 -5.1344963 2.4385834964 3 var3 -5.0972730 2.8425796581 4 var4 0.3743154 -0.2244166193 5 var5 0.4102937…
0
votes
0 answers

How to subset labels to a ggplot graph without printing Aesthetics error?

This line of code is not working. The problem is when I add this geom_text line that is meant to filter out certain points of the data and label them. This is the code: ggplot(data=bg_total_df, aes(x = bg_total_num, y = bg_total$bloodGlucose)) + …
Jack Thomas
  • 37
  • 1
  • 5
0
votes
1 answer

How to customise dates (years) on the x-axis in R

I am struggling to customise the jump size on the x-axis in R. Current code: par(mfrow = c(2,2)) r.star.ts.sp <- ts(r.star.sp, frequency = 4, start = c(1978,1), end = c(2018, 1)) # Big drop in r* around 123th quarter equivalent to 2008:Q4 /…
Sean
  • 15
  • 1
  • 9