title: R: adjust scale color gradient in ggplot2
body: <p>First, here is part of mydata(121315*4):</p>
  
  <pre><code>     LONGITUDE LATITUDE NUM_PICKUPS TOTAL_REVENUE
   1   121.6177  38.9124          21         337.0
   2   121.8069  39.0210          16         454.7
   3   121.5723  38.9645          38         696.9
   4   121.6423  38.9258         622       13609.7
   5   121.5647  38.9129         116        2016.7
   6   121.6429  38.8846         120        2417.3
   7   121.5852  38.9279         117        1975.0
   8   121.6616  38.9189          94        1712.4
   9   121.5812  38.9828          50         981.6
   10  121.6411  38.9255         225        4696.2
  </code></pre>
  
  <p>Seeing that, the first and second column is the longitude and latitude.</p>
  
  <p><code>mydata[1,3]=21</code> means that in the palce<code>(121.6177, 38.9124)</code>, there are 21 pickups.</p>
  
  <p>Then, I resort mydata with <code>NUM_PICKUPS</code> desc:</p>
  
  <pre><code>LONGITUDE   LATITUDE    NUM_PICKUPS TOTAL_REVENUE
  121.6019    39.0181        14243    514716
  121.5382    38.9609        13244    443754.7
  121.5381    38.9609         9645    325056
  121.5382    38.9608         8846    294345.6
  121.602     39.0181         6556    232254.5
  121.5383    38.9609         6152    208967.6
  121.5383    38.9608         6014    207677.8
  121.5381    38.9608         5544    185398.3
  121.6018    39.018          4546    167662.1
  121.5382    38.9607         4260    143088.9
  121.5827    38.8948         4133    72202.8
  121.6303    38.9183         3837    67683.6
  121.5966    38.9665         3747    56378.7
  </code></pre>
  
  <p>And there is the summary of mydata:</p>
  
  <pre><code>summary(mydata)
  
  
   LONGITUDE        LATITUDE      NUM_PICKUPS       TOTAL_REVENUE     
    Min.   :121.1   Min.   :38.76   Min.   :   10.00   Min.   :    92.9  
    1st Qu.:121.6   1st Qu.:38.91   1st Qu.:   15.00   1st Qu.:   289.7  
    Median :121.6   Median :38.92   Median :   27.00   Median :   515.1  
    Mean   :121.6   Mean   :38.93   Mean   :   57.03   Mean   :  1067.6  
    3rd Qu.:121.6   3rd Qu.:38.96   3rd Qu.:   59.00   3rd Qu.:  1089.5  
    Max.   :122.0   Max.   :39.32   Max.   :14243.00   Max.   :514716.0
  </code></pre>
  
  <p>Now, I want to draw the map which is colored by <code>NUM_PICKUPS</code>, look at my codes.</p>
  
  <pre><code>g1 &lt;- ggplot() + geom_point(data = mydata,aes(x = LONGITUDE,y = LATITUDE,color=NUM_PICKUPS))
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/XWV4O.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XWV4O.jpg" alt="enter image description here"></a></p>
  
  <p>Yeah, both the codes and graph are right, but look the <strong><em>color</em></strong>, it's hard to indentify where is the place with high <code>num_pickups</code>? And where is less?</p>
  
  <p>I try to modify my codes with <code>scale_colour_gradient()</code>:</p>
  
  <pre><code>g1 + scale_colour_gradient(low = "red",high = "white")
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/UJgCp.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UJgCp.jpg" alt="enter image description here"></a></p>
  
  <p>But look the picture, the <strong><em>color</em></strong> is also hard to classify .</p>
  
  <p><strong>Third try:</strong> This time I add parameters of <strong><code>alpha=I(1/100)</code></strong> and <strong><code>breaks()</code></strong>:</p>
  
  <pre><code>g1 &lt;- ggplot() + geom_point(data = mydata,aes(x = LONGITUDE,y = LATITUDE,color=NUM_PICKUPS),alpha=I(1/100))
  g1 + scale_colour_gradient(low = "red",high = "white", breaks=c(0,2000,4000))
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/VWX19.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VWX19.jpg" alt="enter image description here"></a></p>
  
  <p>But it's still helpless!</p>
  
  <p><strong>Fourth try:</strong></p>
  
  <pre><code>ggplot(data = mydata, aes(x = LONGITUDE,y = LATITUDE, color = NUM_PICKUPS)) + geom_point() + scale_colour_gradient(limits = c(0, 60))
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/XaM3T.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XaM3T.jpg" alt="enter image description here"></a></p>
  
  <p><strong>Fifth Try:</strong>
  According to the post 3 years ago, <a href="https://stackoverflow.com/questions/9811866/ggplot2-color-scale-over-affected-by-outliers">ggplot2 Color Scale Over Affected by Outliers</a>, I try to modify my codes again:</p>
  
  <pre><code>mydata$NUM_PICKUPS1 &lt;- "&gt; 2000"
  mydata$NUM_PICKUPS1[mydata$NUM_PICKUPS &lt;= 2000] &lt;- NA
  
  g2 &lt;- ggplot() + geom_point(data = subset(mydata,NUM_PICKUPS &lt;= 2000),
        aes(x = LONGITUDE,y = LATITUDE,color=NUM_PICKUPS),size=2) +    geom_point(data = subset(mydata,NUM_PICKUPS &gt; 2000),aes(x = LONGITUDE,y = LATITUDE,fill=NUM_PICKUPS1))
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/nHCcB.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nHCcB.jpg" alt="enter image description here"></a></p>
  
  <p>Something did change in the <strong>outliers</strong>, but the color scale is still hard to classify!</p>
  
  <p><strong>So, my question is how to modify my codes to make the color of <code>NUM_PICKUPS</code> easily to identify?</strong></p>