Issue
I have a simple grid of dots which I make with:
import numpy as np
import matplotlib.pyplot as plt
# Add blue dots
for x in np.arange(0, 10, 1):
for y in np.arange(0, 10, 1):
plt.scatter(x, y, color='blue', s=20) # Adjust the size (s) as needed
# Customize plot
ax = plt.gca()
ax.set(xlim=(0, 9), ylim=(0, 9), xlabel='', ylabel='')
ax.set_xticks(np.arange(0, 9.01, 1))
ax.set_yticks(np.arange(0, 9.01, 1))
ax.invert_yaxis()
ax.set_aspect('equal', adjustable='box')
ax.tick_params(left=False, bottom=False)
ax.grid()
This looks like:
The dots on the edge of the grid are cut off. How can I show them complete without changing anything else about the picture? I don't want to extend the grid lines for example.
Solution
You can try turning-off the Clipping by setting clip_on
to False
:
for x in np.arange(0, 10, 1):
for y in np.arange(0, 10, 1):
plt.scatter(x, y, color='blue', s=20, clip_on=False) # << here
Answered By - Timeless
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.