Questions tagged [geom-col]

Part of the `ggplot2` library for R, `geom_col` is a chart type using columns to represent data.

169 questions
0
votes
2 answers

problem with axis values at ggplot geom_col

I am quite new in R and now I am working on a long data set for a while and end up with a 2 Columns (Countries and Profit): y <- data.frame(tapply(sub$Profit, sub$Country, sum)) y <- rename(y, Profit = tapply.sub.Profit..sub.Country..sum.) y <-…
0
votes
3 answers

How to insert or create a visual separation between groups of bars within ggplot2 in R?

I would like to create a separation between the groups (D, E, F, G, H, I e J) of slashes inside ggplot. Using the diamonds database. ggplot(diamonds, aes(x = color, y=depth, fill=factor(clarity ))) + geom_col(position = "dodge")+ …
wesleysc352
  • 579
  • 1
  • 8
  • 21
0
votes
1 answer

Slightly change geom_segment's position of x only, but keep position of xend constant

I want to draw a bar chart with three columns, where two arrows start from one column to the other two columns and these arrows do not overlap each other, as shown below. I managed to produce the chart and I used geom_segments to draw the arrows.…
Carlos Luis Rivera
  • 3,108
  • 18
  • 45
0
votes
0 answers

How to display the total on a bar graph as the input changes in r shinyapp

I am working on an app, and right now I want to compare two NBA players' career totals on a bar graph as I pick and choose which players will be compared. For example, when I select Michael Jordan and LeBron James, and career points, I want a bar…
0
votes
1 answer

Moving the y scale in ggplot, geom_col

I want my lowest listed y scale number to be at the bottom of the chart. When I run the code, the lowest number is in the middle of the chart. The…
0
votes
1 answer

How to make specific variable order on geom_col X axis within each Y variable subgroup

I am trying to make specific X axis order within each Y variable on geom_col graph. I have found solutions with factor and it's levels, but it doesn't seem to work for me. Here is data frame 'df_full': df_full<-data.frame(conc=c(NK, 1 µM X, 1 µM, 10…
Simona
  • 87
  • 2
  • 8
0
votes
1 answer

ggplot2 changing fill colors of geom_col (very, very beginner)

I'm a new R Studio User (I've only used this for several months). I love it! I got this table where I'm comparing two poets vocabulary. I would like them to have a different color each one. I tried to change the values but had no luck. Here is my…
0
votes
1 answer

Grouped bar charts for modal split values

I want to plot my data frame containing different modal split values(% of car usage, % of bike usage..) for different path lengths(under 5 km, 5-10km, 10-30km...) Each element in my data frame contains the % of vehicle usage for each path length. My…
meg1234
  • 25
  • 4
0
votes
1 answer

Thinner graph of discreet X-axis in GGplot

I would like for my ggplot2 graph to be thinner. I only have 3 discreet points on the X axis of a barplot with geom_col and it is too thick. this is the code: Lmid <- ggplot(data_est_ci_mid, aes(x=origin, y=Estimate, fill=origin), width = 0.1) + …
0
votes
1 answer

Why is the errorbar placed at the center of the plot (group)?

I wanted to add the errorbar in my plot. The errorbar is not placing for each bar/col. All errorbar is placing in the central of the group. The plot look likes The code I have df <- transform( Result_1, group = reorder(interaction(Result_Name,…
Opps_0
  • 408
  • 4
  • 19
0
votes
0 answers

Why is my geom_col not showing a uniform order?

I am trying to show a simple histogram by cereal producer broken down by whether or not promos were used. However, my third set of columns is out of order with the other two (the "promo" and "no promo" bars are swapped). As you will see in the…
qatvinc
  • 3
  • 2
0
votes
0 answers

ggplot scale_x_discrete drops values in barplot

(Hopefully) simple issue but I haven't found anything on SO that directly addresses the question. I have a ggplot barplot. x-axis are integers 0 through 10, y is percentages. I want the bars to be explicitly labeled as 0, 1, 2, ... 10 on the…
Ralph Asher
  • 192
  • 9
0
votes
1 answer

ggplot2: Value labels in stacked barplot with geom_bar(position = 'fill')

Can someone please help me how I can add the value labels to a stacked barplot in ggplot? Is there a way I can calculate the percentages using geom_bar() or do I have to calculate the percentages manually and then use…
D. Studer
  • 1,711
  • 1
  • 16
  • 35
0
votes
1 answer

Adjusting the position of geom_text label for stacked bar chart

I have plotted data on 50 items (Ranking from 1-5) within a stacked bar chart and want to add the item number to each percentage share of the bar chart. I have created a reproducible example with a smaller dataset to illustrate the issue. It looks…
zepmaya
  • 47
  • 1
  • 9
0
votes
2 answers

How to change the Y range for ggplot (geom_col) in R?

I am trying to create 2 ggplot bar graphs for text analysis to compare frequencies as percentages from the dictionary "loughran". Here is my code for one of the graphs. How can I edit my y range so that both graphs start at 0% and end at 100%? This…
vicxirra
  • 1
  • 1