title: R: How plot negative and positive anomaly (for this data) with ggplot?
body: <p>I have this <code>df</code></p>
  <pre><code>               x          acc
  1  1902-01-01  0.782887804
  2  1903-01-01 -0.003144199
  3  1904-01-01  0.100006276
  4  1905-01-01  0.326173392
  5  1906-01-01  1.285114692
  6  1907-01-01  2.844399973
  7  1920-01-01 -0.300232190
  8  1921-01-01  1.464389342
  9  1922-01-01  0.142638653
  10 1923-01-01 -0.020162385
  11 1924-01-01  0.361928571
  12 1925-01-01  0.616325588
  13 1926-01-01 -0.108206003
  14 1927-01-01 -0.318441954
  15 1928-01-01 -0.267884586
  16 1929-01-01 -0.022473777
  17 1930-01-01 -0.294452983
  18 1931-01-01 -0.654927109
  19 1932-01-01 -0.263508341
  20 1933-01-01  0.622530992
  21 1934-01-01  1.009666043
  22 1935-01-01  0.675484421
  23 1936-01-01  1.209162008
  24 1937-01-01  1.655280986
  25 1948-01-01  2.080021785
  26 1949-01-01  0.854572563
  27 1950-01-01  0.997540963
  28 1951-01-01  1.000244163
  29 1952-01-01  0.958322941
  30 1953-01-01  0.816259474
  31 1954-01-01  0.814488644
  32 1955-01-01  1.233694537
  33 1958-01-01  0.460120970
  34 1959-01-01  0.344201474
  35 1960-01-01  1.601430139
  36 1961-01-01  0.387850967
  37 1962-01-01 -0.385954401
  38 1963-01-01  0.699355708
  39 1964-01-01  0.084519926
  40 1965-01-01  0.708964572
  41 1966-01-01  1.456280443
  42 1967-01-01  1.479412638
  43 1968-01-01  1.199000726
  44 1969-01-01  0.282942042
  45 1970-01-01 -0.181724504
  46 1971-01-01  0.012170186
  47 1972-01-01 -0.095891043
  48 1973-01-01 -0.075384446
  49 1974-01-01 -0.156668145
  50 1975-01-01 -0.303023258
  51 1976-01-01 -0.516027310
  52 1977-01-01 -0.826791524
  53 1980-01-01 -0.947112221
  54 1981-01-01 -1.634878300
  55 1982-01-01 -1.955298323
  56 1987-01-01 -1.854447550
  57 1988-01-01 -1.458955443
  58 1989-01-01 -1.256102245
  59 1990-01-01 -0.864108585
  60 1991-01-01 -1.293373024
  61 1992-01-01 -1.049530431
  62 1993-01-01 -1.002526230
  63 1994-01-01 -0.868783614
  64 1995-01-01 -1.081858981
  65 1996-01-01 -1.302103374
  66 1997-01-01 -1.288048194
  67 1998-01-01 -1.455750340
  68 1999-01-01 -1.015467069
  69 2000-01-01 -0.682789640
  70 2001-01-01 -0.811058004
  71 2002-01-01 -0.972374057
  72 2003-01-01 -0.536505225
  73 2004-01-01 -0.518686263
  74 2005-01-01 -0.976298621
  75 2006-01-01 -0.946429713
  </code></pre>
  <p>I would like plot the data in this kind:
  <a href="https://i.stack.imgur.com/HwwLy.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HwwLy.jpg" alt="enter image description here" /></a></p>
  <p>where on x axes there is column x of <code>df</code>, and on y axes column <code>acc</code>.
  Is possible plot it with ggplot?
  I tried with this code:</p>
  <pre><code>ggplot(df,aes(x=x,y=acc))+
  geom_linerange(data =df , aes(colour = ifelse(acc &lt;0, &quot;blue&quot;, &quot;red&quot;)),ymin=min(df),ymax=max(cdf))
  </code></pre>
  <p>but the result is this:
  <a href="https://i.stack.imgur.com/6I0dx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6I0dx.png" alt="enter image description here" /></a></p>
  <p>Please, how I can do it?</p>