Matplotlib Axis Tick Labels Covered By Scatterplot (using Spines)
I want to have my axis through the origin (0,0) in a scatter plot, which is why I have set the spines positions in the below example. The problem is that my actual data points on t
Solution 1:
You can fix this by setting the zorder
of scatter to something <0
For example:
plt.scatter(x,y,zorder=-5)
Unfortunately, even then they are not very visible in the ggplot
style:
You can see that more clearly if you change the color of the scatter plot and the labels (note that the labels are clearly above the scatter plot in the image below), so you may need to experiment to find something you like
ax.tick_params(labelcolor='r')
plt.scatter(x,y,color='w',zorder=-5)
Post a Comment for "Matplotlib Axis Tick Labels Covered By Scatterplot (using Spines)"