 <p>I would prefer to first exclude (or replace them by <code>NA</code>) all such values (i.e. <code>n==1</code> &amp; <code>out==1</code>) and then plot it. This is many time useful if one want to show zeros in the plot. For e.g.</p> <blockquote> <p>Something like your plot</p> </blockquote> <pre><code>test.data = data.frame ( sample (1:10,100,replace=TRUE), sample (1:10, 100, replace=TRUE) ) names (test.data) &lt;- c("out","n") ggplot(test.data,aes(log(out),log(n)))+geom_point(aes(color="red")) + xlim (0, 2.5) + ylim (0, 2.5) # just to get same range </code></pre> <p><a href="https://i.stack.imgur.com/GTkR4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GTkR4.png" alt="enter image description here"></a></p> <blockquote> <p>(Probably) something you want </p> </blockquote> <pre><code> dd = apply (test.data,1,function(row) all (row!=1)) # find when neither out nor n is 1 df = test.data[dd,] # take only ggplot(df,aes(log(out),log(n)))+geom_point(aes(color="red")) + xlim (0, 2.5) + ylim (0, 2.5) # just to get same range </code></pre> <p><a href="https://i.stack.imgur.com/rRkoa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rRkoa.png" alt="enter image description here"></a></p>