This article describes how to set the increments for gridlines in a scatterplot or bubble chart. For example, you can override the default axis gap below:
to a different value i.e. 10 on the y-axis and 15 on the x-axis:
Requirements
Please note this requires the Data Stories module or a Displayr license.
- A Scatter, Labeled Scatter, Bubble, or Labeled Bubble visualization, see How to Create a Scatter Plot.
Method
1. Select the visualization.
2. In the object inspector, click Data > Show Advanced Options > R Code > Edit Code button.
3. Temporarily uncheck Calculate automatically while making this edit (if the scale is wrong, it can cause the visualization to become very slow).
4. In the code editor that appears above the page, scroll to the very bottom and insert the following code highlighted in red on the second to last line to adjust the x (x.tick.distance) and y (y.tick.distance) axis increments:
background.fill.color = get0("formBgColor", ifnotfound = "transparent"),
background.fill.opacity = get0("formBgOpacity", ifnotfound = 1.0),
append.data = TRUE,
x.tick.distance = 15,
y.tick.distance = 10,
warn.if.no.match = FALSE)
5. Click Yes in the popup that appears and asks if you're sure you want to edit the R code.
6. Adjust the increments to the numbers you desire. Note for scales that are on percentages, you will need to use decimal values, i.e. .10 for 10% increments.
7. Check the Calculate automatically setting to recalculate and restore the automatic recalculations.