EVOLUTION-MANAGER
Edit File: annotation_custom.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Annotation: Custom grob</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for annotation_custom {ggplot2}"><tr><td>annotation_custom {ggplot2}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Annotation: Custom grob</h2> <h3>Description</h3> <p>This is a special geom intended for use as static annotations that are the same in every panel. These annotations will not affect scales (i.e. the x and y axes will not grow to cover the range of the grob, and the grob will not be modified by any ggplot settings or mappings). </p> <h3>Usage</h3> <pre> annotation_custom(grob, xmin = -Inf, xmax = Inf, ymin = -Inf, ymax = Inf) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>grob</code></td> <td> <p>grob to display</p> </td></tr> <tr valign="top"><td><code>xmin, xmax</code></td> <td> <p>x location (in data coordinates) giving horizontal location of raster</p> </td></tr> <tr valign="top"><td><code>ymin, ymax</code></td> <td> <p>y location (in data coordinates) giving vertical location of raster</p> </td></tr> </table> <h3>Details</h3> <p>Most useful for adding tables, inset plots, and other grid-based decorations. </p> <h3>Note</h3> <p><code>annotation_custom</code> expects the grob to fill the entire viewport defined by xmin, xmax, ymin, ymax. Grobs with a different (absolute) size will be center-justified in that region. Inf values can be used to fill the full plot panel (see examples). </p> <h3>Examples</h3> <pre> # Dummy plot df <- data.frame(x = 1:10, y = 1:10) base <- ggplot(df, aes(x, y)) + geom_blank() + theme_bw() # Full panel annotation base + annotation_custom( grob = grid::roundrectGrob(), xmin = -Inf, xmax = Inf, ymin = -Inf, ymax = Inf ) # Inset plot df2 <- data.frame(x = 1 , y = 1) g <- ggplotGrob(ggplot(df2, aes(x, y)) + geom_point() + theme(plot.background = element_rect(colour = "black"))) base + annotation_custom(grob = g, xmin = 1, xmax = 10, ymin = 8, ymax = 10) </pre> <hr /><div style="text-align: center;">[Package <em>ggplot2</em> version 3.3.2 <a href="00Index.html">Index</a>]</div> </body></html>