When plotting points in R, the shape the marker will take in the plot can be specified by setting the "symbol" and "symbols" variable to the required plotting character ("pch") when plotting. In other words, plotting can be done by having something along the lines of
myX = c(1:3);
myY = c(1:3);
p <- plot_ly() %>%
add_trace(
type = "scatter",
mode = "markers",
x = myX,
y = myY,
symbol = c(0, 1, 2), #Comment: PCH characters specified here
marker = list(line = list(width = 1.5)),
symbols = c(0, 1 ,2), #Comment: PCH characters specified here
size = 10,
showlegend = F
)
The above works fine but is there any way I can obtain these marker symbols as strings, I would like to be able to do something along the lines of
firstMarkerString <- paste( "Marker number zero is ", getMarker(pch = 0));
secondMarkerString <- paste( "Marker number one is ", getMarker(pch = 1));