Python's matplotlib is so convenient that I'm always indebted. I can't sleep with my feet turned, but today I'd like to give a little test on the size of the "dots".
%matplotlib inline
import matplotlib.pyplot as plt
plt.scatter(0, 0, c='k')
plt.scatter(0, 0, c='k', s=1000)
It looks like the size of the dots has changed a little here. The size of the point at the origin should not have changed, but this size is just the size of the display size and does not seem to correspond to the size of the coordinates.
plt.scatter(0, 0, c='k', s=1000)
plt.scatter(0.1, 0.1, c='k', s=700)
plt.scatter(-0.1, 0.1, c='k', s=700)
So, if you change the coordinate range where the image is displayed, it will look completely different. It has become like a water molecule.
plt.xlim([-1, 1])
plt.ylim([-1, 1])
plt.scatter(0, 0, c='k', s=1000)
plt.scatter(0.1, 0.1, c='k', s=700)
plt.scatter(-0.1, 0.1, c='k', s=700)
Even if you change the aspect ratio of the image, the shape will look different as well. It looks like a water molecule.
plt.figure(figsize=(8,8))
plt.xlim([-1, 1])
plt.ylim([-1, 1])
plt.scatter(0, 0, c='k', s=1000)
plt.scatter(0.1, 0.1, c='k', s=700)
plt.scatter(-0.1, 0.1, c='k', s=700)
Even if you change the size of the image, the shape will look different as well. It looks like a water molecule.
plt.figure(figsize=(6,6))
plt.xlim([-1, 1])
plt.ylim([-1, 1])
plt.scatter(0, 0, c='k', s=1000)
plt.scatter(0.1, 0.1, c='k', s=700)
plt.scatter(-0.1, 0.1, c='k', s=700)
Let's move the same thing horizontally and draw a lot of duplicates. that? Ears ... not ... hydrogen atoms? I can't see anything like that.
plt.figure(figsize=(6,6))
plt.xlim([-10, 10])
plt.ylim([-10, 10])
for x in [-5, 0, 5]:
for y in [-5, 0, 5]:
plt.scatter(0 + x, 0 + y, c='k', s=1200)
plt.scatter(0.1 + x, 0.1 + y, c='k', s=700)
plt.scatter(-0.1 + x, 0.1 + y, c='k', s=700)
plt.show()
Mi ... In order to return to the shape of water molecules, it is necessary to review the positional relationship.
plt.figure(figsize=(6,6))
plt.xlim([-10, 10])
plt.ylim([-10, 10])
for x in [-5, 0, 5]:
for y in [-5, 0, 5]:
plt.scatter(0 + x, 0 + y, c='k', s=1000)
plt.scatter(1 + x, 1 + y, c='k', s=700)
plt.scatter(-1 + x, 1 + y, c='k', s=700)
plt.show()
Matplotlib is useful, but it's a bit annoying to get a nice dot size.
Recommended Posts