1

I am trying to graph a dataframe which is 1100x2 large. Because of the large amount of data, I find that ggplot stacks the labels. Is there a way to avoid this or just delete the labels altogether? Here is my graph:

My graph

and here is my code:

ggplot(data=`Rsa19766.01-s00-m01-1`, 
       aes(x=`Rsa19766.01-s00-m01-1`$Wavelength,
           y=`Rsa19766.01-s00-m01-1`$Reflection, 
           group=1,shape=".")) + 
  geom_line() + 
  ggtitle("Cary Ref")
joran
  • 169,992
  • 32
  • 429
  • 468
naveace
  • 65
  • 1
  • 8
  • 3
    Looks like your data columns are `factor` or `character`. `ggplot` will do an excellent job labeling appropriately if you convert those to continuous data types. (From your graph it looks like you are dealing with continuous rather than categorical data.) – Gregor Thomas Jul 11 '16 at 20:02
  • 2
    ...also, you should never, ever refer to variables in your data frame via `$` when mapping them inside of `aes()`. It should always be `aes(x = Wavelength,...)` etc. – joran Jul 11 '16 at 20:13
  • ...and it's hard to do more than those two pieces of advice without a [reproducible example](http://stackoverflow.com/q/5963269/903061). Can't even tell what data types you currently have... – Gregor Thomas Jul 11 '16 at 20:26
  • I apologize for not giving a repoducible example. Your advice worked though, thank you so much. Do you know how to close a question, or indicate it has been answered? – naveace Jul 13 '16 at 12:05

0 Answers0