2
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Matplotlibで図同士の間隔を調整する

Last updated at Posted at 2020-04-15

一覧表に戻る

image.png

import matplotlib.pyplot as plt
%matplotlib inline

plt.subplots_adjust(wspace=0.4,hspace=0.6)

plt.subplot(2,2,1)
plt.scatter(1,1)

plt.subplot(2,2,2)
plt.scatter(1,1)

plt.subplot(2,2,3)
plt.scatter(1,1)

plt.subplot(2,2,4)
plt.scatter(1,1)
plt.show()

image.png

import matplotlib.pyplot as plt
%matplotlib inline

plt.subplots_adjust(wspace=0.15,hspace=0.15)
min = 0.8
max = 1.2

plt.subplot(2,2,1)
plt.scatter(1,1)
plt.tick_params(bottom=False,labelbottom=False)
plt.xlim(min,max)
plt.ylim(min,max)

plt.subplot(2,2,2)
plt.scatter(1,1)
plt.tick_params(bottom=False,labelbottom=False,left=False,labelleft=False)
plt.xlim(min,max)
plt.ylim(min,max)

plt.subplot(2,2,3)
plt.scatter(1,1)
plt.xlim(min,max)
plt.ylim(min,max)

plt.subplot(2,2,4)
plt.scatter(1,1)
plt.tick_params(left=False,labelleft=False)
plt.xlim(min,max)
plt.ylim(min,max)
plt.show()
2
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?