degrees_to_adj | R Documentation |
Degrees to text adjustment
degrees_to_adj(
degrees,
top = 90,
clockwise = FALSE,
expand = 0,
bias_side = 3,
bias_height = 1,
plot_ranges = FALSE,
...
)
degrees |
|
top |
|
clockwise |
|
expand |
|
... |
additional arguments are ignored |
Utility function to define adj
values suitable
for text plotting, which arranges text relative
to the angle in degrees.
Other venndir spatial:
diff_degrees()
,
display_angles()
,
mean_degree_arc()
,
mean_degrees()
,
rescale_coordinates()
,
spread_degrees()
degrees <- seq(from=1, to=360, by=15);
x <- cos(jamba::deg2rad(degrees));
y <- sin(jamba::deg2rad(degrees));
adjdf <- degrees_to_adj(degrees);
adjdf1 <- degrees_to_adj(degrees, bias_side=1, bias_height=1);
plot(x, y,
pch=20, asp=1,
xlim=c(-1.3, 1.3),
ylim=c(-1.3, 1.3));
jamba::drawLabels(txt=seq_along(degrees),
x=x, y=y, labelCex=0.8,
adjX=adjdf1[,1], adjY=adjdf1[,2])
jamba::drawLabels(txt=seq_along(degrees),
x=x, y=y, labelCex=0.8, boxColor="gold",
adjX=adjdf[,1], adjY=adjdf[,2])
plot(x, y,
pch=20, asp=1, cex=0.4, col="red",
xlim=c(-1.3, 1.3),
ylim=c(-1.3, 1.3));
for (i in seq_along(degrees)) {
text(labels=i,
x=x[i], y=y[i],
adj=unlist(adjdf[i,]))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.