I'm trying to create a plotly
scatter plot with border around points.
The ideal thing is:
plot_ly(data = iris, x = ~Sepal.Length, y = ~Petal.Length,
marker = list(size = 10,
color = 'rgba(255, 182, 193, .9)',
line = list(color = 'rgba(152, 0, 0, .8)',
width = 2)))
But in my (much more complicated) case I'm creating the plot with add_markers
function like that:
plot_ly(data = iris) %>%
add_markers(x = ~Sepal.Length, y = ~Petal.Length,
color = 'rgba(255, 182, 193, .9)')
With that the line
argument gives the line instead of border around points:
Adding symbol = "circle-open"
as parameter doesn't help either.
Please help.
You have to provide these properties as a list
to the argument marker
:
plot_ly(data = iris) %>%
add_markers(x = ~Sepal.Length,
y = ~Petal.Length,
marker = list(
color = 'rgba(255, 182, 193,0.5)',
line = list(color = 'rgba(152, 0, 0, .8)',
width = 2)
)
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With