import numpy as np
import matplotlib.pyplot as plt
#x,y,z軸値の定義
ax = np.array([0, 2, 4, 6])
x, y = np.meshgrid(ax,ax)
z = np.array([
[ 2, 2, 4, 6],
[ 4, 4, 6, 8],
[ 6, 6, 8, 10],
[ 8, 8, 10, 12]])
#グラフ描画
cont = plt.contour(x, y, z, levels=[4,6,8], colors='black') #等高線を描画
cont.clabel(fmt='%1.1f', fontsize=14) #等高線に値を記載
plt.contourf(x, y, z, levels=[4, 6], colors=['lightblue']) #色を塗る
plt.show()