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
- A Scatter, Labeled Scatter, Bubble, or Labeled Bubble visualization, see How to Create a Scatter Plot.
Method
- Select the visualization.
- Temporarily uncheck Calculate automatically in Properties
while making this edit (if the scale is wrong, it can cause the visualization to become very slow).
- In Properties
, click Data > Attributes > Code button.
- In the Code
panel, click Show.
- In the code
panel, scroll to the very bottom and insert the following code 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)
6. Click Yes in the pop-up that appears and asks if you're sure you want to edit the R code.
7. 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.
8. Tick Calculate automatically to recalculate and restore the automatic recalculations.
UPCOMING WEBINAR: Run Research Your Way With AI Skills