View source: R/utility_crosshairs.R
ggplot_addcrosshairs | R Documentation |
Function takes an existing ggplot and add points and/or crosshairs to the plot to show the position of points
ggplot_addcrosshairs( plt, x, y, group = NULL, legend_title = NULL, legend_position = "none", crosshairs = TRUE, add_colour_scale = FALSE, xlim = 0, ylim = 0, arrow_x = TRUE, arrow_y = TRUE, arrow_length = 0.1, palette = "Set1", label_size = 4, label_hjust = 0, label_vjust = 0, label_nudge_x = 0, label_nudge_y = 0, label_parse = FALSE )
plt |
a ggplot object |
x |
x-coordinates for all points |
y |
y-coordinates for all points |
group |
names of group, for all points - this is plotted in the label |
legend_title |
title for legend |
legend_position |
legend position. If 'NULL', no legend is drawn |
crosshairs |
if 'TRUE', plot crosshairs for each data point |
add_colour_scale |
if 'TRUE', add new color scale for different crosshairs |
xlim |
start point of x crosshairs |
ylim |
start point of y crosshairs |
arrow_x, arrow_y |
if 'TRUE', point x or y-arrows towards the point. If 'FALSE', points towards the axis |
arrow_length |
length of arrow heads |
palette |
RColorBrewer color palette to use |
label_size |
text size in label |
label_hjust |
horizontal justification of labels |
label_vjust |
vertical justification of labels |
label_nudge_x |
x-offset of labels |
label_nudge_y |
y-offset of labels |
label_parse |
if 'TRUE', parse label text |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.