2016-11-28 16 views
0
import matplotlib.pyplot as plt 
from mpl_toolkits.axes_grid1 import ImageGrid 
import numpy as np 

im = np.arange(100) 
im.shape = 10, 10 

fig = plt.figure(1, (4., 4.)) 
grid = ImageGrid(fig, 111, 
      nrows_ncols=(2, 2), 
      axes_pad=0.1, 
      ) 

for i in range(4): 
    grid[i].imshow(im) 

plt.show() 

答えて

0

fig.text()を使用してアノテーションを追加するには、axes.set_title()をタイトル軸に使用してください。

例:

import matplotlib.pyplot as plt 
from mpl_toolkits.axes_grid1 import ImageGrid 
import numpy as np 

im = np.arange(100) 
im.shape = 10, 10 

fig = plt.figure(1, (4., 4.)) 
grid = ImageGrid(fig, 111, 
       nrows_ncols=(2, 2), 
       axes_pad=0.4, 
       ) 

for axes in grid: 
    axes.set_title("TITLE", fontdict=None, loc='center', color = "k") 
    axes.imshow(im) 


fig.text(0.7,0.2,"Anotation", color ="k") 
fig.text(0.2,0.7,"Anotation", color ="k") 


plt.show() 

enter image description here

+0

はありがとうございました! – Wolf

関連する問題