I have a plot that I made in ipython's notebook using two imported datasets and an array that I made for the x axis, but the color bar is a bit thick to my liking. Is there any way to make it more subtle?
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
th = np.loadtxt("MT3_th.dat")
pi = np.loadtxt("MT3_pi.dat")
k = np.loadtxt("MT3_z.dat")
i = np.linspace(-16.,16.,81)
x, z = np.meshgrid(i, k)
th[th == 0.0] = np.nan
clevels = [0.5, 1, 1.5, 2, 2.5, 3.]
fig = plt.figure(figsize=(12,12))
thplot = plt.contourf(x, z, th, clevels, cmap=plt.cm.Reds, vmin=0., vmax=3.)
ax2 = fig.add_subplot(111)
piplot = ax2.contour(x, z, pi, 6, colors='k')
plt.axis([-16.,16, 0, 16.])
plt.xticks(np.arange(-16,16.001,4))
plt.yticks(np.arange(0,16.001,2))
plt.colorbar(pad=0.05, orientation="horizontal")
plt.xlabel("x (km)", size=15)
plt.ylabel("z (km)", size=15)
plt.title("Initial temp. & pres. perturbations (K, Pa)", size=20)
plt.grid()
plt.show()
source
share