title: How to plot CCDF graph on a logarithmic scale?
body: <p>I want to plot a CCDF graph for some of my simulated power-law tail data on a log-log axis, below is my R code of plotting a CCDF graph on a normal axis, I used the code on the link: (<a href="https://stackoverflow.com/questions/20391477/how-to-plot-a-ccdf-gragh">How to plot a CCDF gragh?</a>)</p>
  
  <pre><code>&gt; load("fakedata500.Rda")
  &gt; x&lt;-fakedata500
  &gt; f&lt;-ecdf(x)
  &gt; f
  Empirical CDF 
  Call: ecdf(x)
   x[1:500] = 0.50174, 0.50307, 0.50383,  ..., 81.674, 140.63
  &gt; plot(f)
  </code></pre>
  
  <p>Below is the ECDF graph:</p>
  
  <p><img src="https://i.stack.imgur.com/GGDKk.png" alt="enter image description here"></p>
  
  <pre><code>&gt; plot(sort(x), 1-f(sort(x)), type="s", lwd=1)
  </code></pre>
  
  <p>and this command gives me the CCDF graph:</p>
  
  <p><img src="https://i.stack.imgur.com/YMREx.png" alt="enter image description here"></p>
  
  <p>However, I would like to plot my CCDF graph on a log-log axis to produce a graph like the picture below:
  (graph from "Minimizing errors in identifying Lévy flight behaviour of organisms.")</p>
  
  <p><img src="https://i.stack.imgur.com/TZm84.png" alt="enter image description here"></p>
  
  <p>Is there a way to do it in R? </p>
  
  <p>If so, how to do a linear regression on the CCDF graph as well? I have tried using command below but that just not working for me.</p>
  
  <pre><code>a&lt;-plot(sort(x), 1-f(sort(x)), type="s", lwd=1)
  &gt; a
  NULL
  &gt; res=lm(a)
  Error in terms.formula(formula, data = data) : 
    argument is not a valid model
  </code></pre>
  
  <p>Much appreciate.</p>
  
  <hr>
  
  <p>UPDATE:</p>
  
  <p>I used the code given by @BondedDust and successfully generated a CCDF graph:</p>
  
  <pre><code>(plot(sort(x) , 1-ecdf(x)(sort(x) ), log="xy"))
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/dctBY.png" alt="enter image description here"></p>
  
  <p>Below is the code of how I generated my dataset:</p>
  
  <pre><code>u&lt;-runif(500)
  fakedata500&lt;-((2*(1-u))^(-1))
  </code></pre>