Question: For some reason when I use a `zorder` with my scatter plot the edges of the points overlap the axis. I tried some of the solutions from [here] ([matplotlib axis tick labels covered by scatterplot (using spines)](https://stackoverflow.com/questions/32652673/matplotlib-axis-tick-labels-covered-by-scatterplot-using-spines)) but they didn't work for me. Is there a way from preventing this from happening?

I understand I could also add an `ax.axvline()` at my boundaries but that would be an annoying workaround for lots of plots.

```
xval = np.array([0,0,0,3,3,3,0,2,3,0])
yval = np.array([0,2,3,5,1,0,1,0,4,5])
zval = yval**2-4

fig = plt.figure(figsize=(6,6))

ax = plt.subplot(111)

ax.scatter(xval,yval,cmap=plt.cm.rainbow,c=zval,s=550,zorder=20)

ax.set_ylim(0,5)
ax.set_xlim(0,3)

#These don't work
ax.tick_params(labelcolor='k', zorder=100)
ax.tick_params(direction='out', length=4, color='k', zorder=100)

#This will work but I don't want to have to do this for the plot edges every time
ax.axvline(0,c='k',zorder=100)

plt.show()

```

[![enter image description here](https://i.stack.imgur.com/63v6o.png)](https://i.stack.imgur.com/63v6o.png)

Answer: 
You can fix the overlap using the following code with a large number for the `zorder`. This will work on both the x- and y-axis.

```
for k,spine in ax.spines.items():
    spine.set_zorder(1000)

```
This works for me

```
import numpy as np
import matplotlib.pyplot as plt
xval = np.array([0,0,0,3,3,3,0,2,3,0])
yval = np.array([0,2,3,5,1,0,1,0,4,5])
zval = yval**2-4

fig = plt.figure(figsize=(6,6))

ax = plt.subplot(111)

ax.scatter(xval,yval,cmap=plt.cm.rainbow,c=zval,s=550,zorder=20)

ax.set_ylim(-1,6)
ax.set_xlim(-1,4)

#These don't work
ax.tick_params(labelcolor='k', zorder=100)
ax.tick_params(direction='out', length=4, color='k', zorder=100)

#This will work but I don't want to have to do this for the plot edges every time
ax.axvline(0,c='k',zorder=100)

plt.show()

```

Your circle sizes are big enough that they go beyond the axis scope. So we simply change the `ylim` and `xlim`

Changed 

```
ax.set_ylim(0,5)
ax.set_xlim(0,3)

```

to

```
ax.set_ylim(-1,6)
ax.set_xlim(-1,4)

```

Also, zorder doesn't play a role in pushing the points to edges.

[![enter image description here](https://i.stack.imgur.com/qWxoT.png)](https://i.stack.imgur.com/qWxoT.png)