I want to use plotly to draw a circular segment with a given centre point and radius.
I found no way in the plotly documentation and tried the following code, which works but I do not want to see the intermediate points.
My current attempt:
library(plotly)
from <- 0
to <- 180
by <- (to-from)/10
t <- seq(from*pi/180, to*pi/180 , by*pi/180)
x0 <- 1
y0 <- 1
r <- 5
y <- y0 + r*sin(t)
x <- x0 + r*cos(t)
plotly::plot_ly() %>%
add_trace(x=~x, y = ~y, line = list(shape = "spline"))
What I want to see:
Any hints? Is it possible to remove the intermediate points afterwards? Or plot a "perfect" circle direct with plotly? Thank you in advance!



