# Dots get cut off when I set axes' origins to zero in scatterplots

When I set the X and Y axes origins to 0 on a scatterplot, dots on the edges of the chart get cut off.

```
ggplot(
data = cars,
aes(
x = speed,
y = dist
)
) +
geom_point(
size = 3
) +
scale_x_continuous(
breaks = seq(
from = 0,
to = max(cars$speed),
by = 5
)
) +
scale_y_continuous(
breaks = seq(
from = 0,
to = max(cars$dist),
by = 5
),
expand = c(0,0)
)
```

The code above produces this in RStudio viewer

Dots on the very top and bottom get cut off. How do I show every dot without them getting cut off?

### 1 Answer

You need to use `clip = "off"`

on the coordinate specification.

```
library(ggplot2)
ggplot(
data = cars,
aes(
x = speed,
y = dist
)
) +
geom_point(
size = 3
) +
scale_x_continuous(
breaks = seq(
from = 0,
to = max(cars$speed),
by = 5
)
) +
scale_y_continuous(
breaks = seq(
from = 0,
to = max(cars$dist),
by = 5
),
expand = c(0,0)
) +
coord_cartesian(clip = "off")
```

Created on 2018-09-16 by the reprex package (v0.2.0).

Elio Campitelli
posted this

## Have an answer?

JD