Convenience function for meme text position in a meme plot.

text_position(n)

Arguments

n

integer, number of meme text labels.

Value

a list of meme text label position arguments: w (width), h (height), and x and y coordinates.

Details

This function takes an integer 1 or 2 and returns, respectively, top or symmetrical top and bottom meme text position arguments. This function is used as the default for the label_pos argument in meme. It is provided if you do not want to bother with specifying coordinates and exact placement does not matter. It is not intended for placement of more than two meme text labels and any value other than 1 or 2 returns an error.

Examples

text_position(1)
#> $w #> [1] 0.9 #> #> $h #> [1] 0.3 #> #> $x #> [1] 0.5 #> #> $y #> [1] 0.9 #>
text_position(2)
#> $w #> [1] 0.9 0.9 #> #> $h #> [1] 0.3 0.3 #> #> $x #> [1] 0.5 0.5 #> #> $y #> [1] 0.9 0.1 #>