The standard R plotly scatter/line graph comes with both vertical and horizontal grid lines. I cannot find the command to select only vertical or horizontal lines. I want the latter. So far I have found the following commands in the offiial guide:
showgrid = FALSE/TRUE
gridcolor = ...
gridwidth = ...
Any idea which is the command to select subset of grid lines?
How do you remove gridlines in Plotly? Toggling Axis grid lines Axis grid lines can be disabled by setting the showgrid property to False for the x and/or y axis. Here is an example of setting showgrid to False in the graph object figure constructor.
Plotly is a free and open-source graphing library for R. We recommend you read our Getting Started guide for the latest installation or upgrade instructions, then move on to our Plotly Fundamentals tutorials or dive straight in to some Basic Charts tutorials.
Edit: The showline
argument is indeed for the axes. showgrid
should work for the gridlines, called within each axis agrument in layout()
.
plot_ly(x = c(1,2), y = c(1,2)) %>%
layout(xaxis = list(showgrid = FALSE),
yaxis = list(gridcolor = "black"))
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