0

I have a some data that I want to display graphically. Here's what it looks like:

data<- c(0.119197746, 0.054207788, 0.895580411, 0.64861727, 0.143249592, 
0.284314897, 0.070027632, 0.297172433, 0.183569184, 0.713896071, 
1.942425326, 1)

Using this command:

barplot(data, main="Ratio of Lipidated and Unlipidated LC3 I & II forms\nNormalized
to GAPDH", names.arg = c("PT250", "PT219", "PT165", "PT218", "PT244", "PT253", "PT279", "PT281",    
"PT240", "PT262", "PT264", "CCD"), ylab = "Fold LC3 II/LC3I/GAPDH")

I produced this graph:

Graph

I would like to position the X-axis at 1 so that all values less-than-one will appear as down bars. I could achieve the desired affect by simply subtracting 1 from all of the values and plotting again but this would cause the numbers on the y-axis to be inaccurate. Is there some way to get R to plot values less than 1 as down bars?

Slavatron
  • 2,278
  • 5
  • 29
  • 40
  • I'm not sure what your data looks like. Is `data$LC3.Ratio.GAPDH` a vector that contains the height of the corresponding bars? – blakeoft Oct 08 '14 at 20:41
  • Subtracting 1 from everything and then adjusting the y-axis appropriately seems like a nice and easy solution. Not sure why you want something else... – Gregor Thomas Oct 08 '14 at 21:10
  • @Gregor I've actually explored that solution but have found adjusting the y-axis to be just as baffling as moving the x-axis. If you know how to change the values on the y-axis I will gladly accept that as a solution. – Slavatron Oct 08 '14 at 21:45

1 Answers1

1

Solution with custom axis.

barplot(data - 1, main="Ratio of Lipidated and Unlipidated LC3 I & II forms\nNormalized
to GAPDH", names.arg = c("PT250", "PT219", "PT165", "PT218", "PT244", "PT253", "PT279", "PT281",    
                         "PT240", "PT262", "PT264", "CCD"), ylab = "Fold LC3 II/LC3I/GAPDH",
         axes = F, ylim = c(-1, 1)
my_labs <- seq(-1, 1, by = 0.5)
axis(side = 2, at = my_labs, labels = my_labs + 1)

enter image description here

Gregor Thomas
  • 136,190
  • 20
  • 167
  • 294