title: Power vs Effect Size plot
body: <p>I want to do a plot of power vs effect size. I have done one of power vs sample size using:</p>
  
  <pre><code>ptab&lt;-cbind(NULL, NULL)      
  
   for (i in c(1:4588)){
     pwrt&lt;-power.t.test(d=.9,n=c(1:4588),sig.level=.05,type="one.sample",alternative="two.sided")
  
  plot(pwrt$n,pwrt$power,type="b",xlab="sample size",ylab="power")
  </code></pre>
  
  <p>but can't find any instructions for power vs effect size. Any ideas?</p>
  
  <p>Edit: Just looked at Caracal's answer (thanks mate). Looks amazing, but your coding is totally different to my attempts:</p>
  
  <pre><code>plot(pwrt$d,pwrt$power,type="b",xlab="effect size",ylab="power")
  </code></pre>
  
  <p>although this just produces a graph with one point directly in the middle. I tried to convert Caracal's coding to my sample size and although it worked, the graph is crazy!</p>