add_text | R Documentation |
All parameters not explicitly described here are simply passed to
geom_text
.
add_text(p, decimals = 2, mapping = NULL, data = NULL, position = "top", ...)
p |
ggplot2 object, output from |
decimals |
Number of decimals to be display if called with default mapping to display labels for each plotted value. |
mapping |
Aesthethics mapping specification for the text created by |
data |
Specify other data source to use label data from. Must contain information
from the data.frame that is plotted and obtained from
|
position |
Position of the geometry layer, either "bottom" or "top". By default text is added above all other layers in the plot to be unobstructed by other geometries, but by setting position to "bottom", text can also be plotted below other geometries. |
Simple wrapper for geom_text
to add
text to nested loop plot. Useful to e.g. annotate special values.
The most simple, default usage is to add the values of the plots (rounded
to two decimals). The plotted values are accessed via the y_coord
variable
of the data.frame returned from nested_loop_base_data
.
More advanced usage and custom labeldata can be introduced to the plots by using the modular functions of this package. See the demo vignette for an example.
A ggplot2 object.
## Not run:
# add values with two decimals to plot
p = add_text(p, aes = aes(labels = round(values, 2)))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.