title: how to prevent text from going out of view in ggplot using annotate
body: <pre class="lang-r prettyprint-override"><code>p &lt;- ggplot(mtcars, aes(x = wt, y = mpg)) + geom_point()
  p + annotate(&quot;text&quot;, x = 5, y = 25, label = &quot;Some looooooooooooooooooooooooooong text&quot;)
  
  </code></pre>
  <p>Also, I must assume that the range of the x and y axis are unknown. Hence, I can't even hardcode the x and y values like example above.</p>