Questions tagged [geom-col]

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

169 questions
1
vote
0 answers

R geom_col label cutoff either above or below

Does anyone have a solution to this graph? The labels above the bar graph are cutoff either at the top or at the bottom, depending on how I do the vertical adjustment. I don't think I can reduce the size of the font enough to fit and be readable. On…
hachiko
  • 671
  • 7
  • 20
1
vote
1 answer

ggplot2 and dplyr, visualize a column which is a character

i am currently trying to make a beautiful geom_col plot on a huge sample size. The names of the samples (which should be on the x-axis) are both numeric and characters, since i include "N" for negative control. sample_names <-…
CoDa
  • 132
  • 10
1
vote
1 answer

Highlight bars >= 5 in one column only, geom_col(), R

I created the following column plot using ggplot geom_col and highlighted the columns that are >= 5. The goal is to only highlight values >= 5 in the Structure column and leave the other columns not highlighted. The data frame FC_TS has three…
Theresa_S
  • 329
  • 1
  • 11
1
vote
2 answers

Geom_errorbar in ggplot doesn't show the correct standard error

I want to add error bars to my geom_col ggplot. The error bar is indeed added to my plot, but the error bars are not correct. Can someone please help me figure out how to adapt my code? I think that the y-values is wrong. It should probably not be…
1
vote
2 answers

How to correct a different distance between bars in geom_col

I am making a geom_col in ggplot2. The x-axis is a numerical vector of timepoints (0, 6, 18, 24, 32, 44). There is a difference between each column corresponding to the numerical difference between each timepoint. But i want an equal distance…
1
vote
1 answer

Position labels in geom_col() outside of bars

Code for my bar plot: library(ggplot2) data <- data.frame(vars = c("pos1", "neg1", "pos2", "neg2", "pos3", "pos4"), values = c(164182, -72705, 1023777, -75002, 756206, 564523), sign = c("p", "n", "p", "n", "p",…
1
vote
1 answer

I can't get label=sprintf to force my labels to show 2 decimal places

I have the following dataframe: Q <- data.frame("PERC" = c(1.1, 2.1, 8.3, 7.0, 9.8, 3.1, 4.1, 11.3, 9.0, 3.0, 4.0, 11.0, 1.1, 2.1, 8.3, 7.0, 9.0, 3.0, 8.3, 7.0), "Corp" = c("Aus",…
YNP97
  • 15
  • 4
1
vote
0 answers

When I use aes(shape) in geom_jitter, the individual points no longer line up with their respective groups in an overlayed geom_col graph

I am trying to visualize a change in serum concentration of a certain protein over a time-period of 6 days. I am able to very easily obtain the bar graph I would like, however, the journal I am trying to publish in requires individual data points…
Afausey
  • 11
  • 2
1
vote
1 answer

How to plot conditional colored outlines of barplots according to some variable?

I have the following data structure(list(date = structure(c(1L, 1L, 2L, 2L, 3L, 3L, 4L, 4L, 5L, 5L, 6L, 6L, 7L, 7L, 8L, 8L, 9L, 9L, 10L, 10L), .Label = c("2011", "2012", "2013", "2014", "2015", "2016", "2017", "2018", "2019", "2020"), class =…
Alessandro
  • 129
  • 1
  • 8
1
vote
1 answer

How to pass chosen input values of checkboxGroup to be used as an argument in ggplot2 interaction of geom_col() when using shiny?

I am using Shiny to build a simple dashboard to use in my job. Everything was fine until I found that I couldn't pass chosen input to be used as an argument in ggplot geom_col() interaction arguments. My purpose is to change interaction plot based…
deny1110
  • 13
  • 3
1
vote
1 answer

Create a plot with geom_col and show only part of the graph

I have a dataset similar to this and have created a bar graph with ggplot to show how many times a person says a certain word. name <- c('Luca', 'Marco','Alberto', 'Luca', 'Marco', 'Luca', 'Alberto', 'Marco') word <- c('pizza', 'cola',…
GIORIGO
  • 49
  • 2
1
vote
1 answer

ggplot2 Reorder Data that is in minutes:seconds Format

The first five entries (out of twenty) of my dataset: >head(data) Name SDC 1 Feuerman 1M 37S 2 Solis 1M 52S 3 Osborne 1M 47S 4 Frizzell 1M 58S 5 Moran 1M 59S Also: >…
jfeuerman
  • 177
  • 9
1
vote
2 answers

How to remove/ delete the space between bars and the panel in ggplot2?

The following code produces the attached plot. How to get rid of/ remove the regions marked in RED? df <- data.frame(trt = c("a", "b", "c"), outcome = c(2.3, 1.9, 3.2)) ggplot(df, aes(trt, outcome)) + geom_col() I modified the code as…
Mainul Islam
  • 1,196
  • 3
  • 15
  • 21
1
vote
2 answers

Plotting a bar/colum plot in R

I am trying the following plotting. I have this data set: Pathway Value Col.Code AKTSig 1 r HRAS 2 r Lbind 3 h GPCRact 4 r ACHsig 5 h ACEest -2 r MRNAspl…
1
vote
1 answer

geom_col is not using stat_identify when values are rounded to whole numbers

I'm trying to use geom_col to chart columns for values in time series (annual and quarterly). When I use Zoo package's YearQtr datatype for the x-axis values and I round the y-axis values to a whole number, geom_col appears to not use the default…
LeoBley
  • 13
  • 2