Skip to content

Commit 838175b

Browse files
author
Jeff Whitaker
committed
use new colorbar method
1 parent fa5d192 commit 838175b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

doc/users/figures/plotprecip.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
lat_0 = nc.variables['true_lat'].getValue()
2020
# create figure and axes instances
2121
fig = plt.figure(figsize=(8,8))
22-
ax = fig.add_axes([0.05,0.05,0.9,0.9])
22+
ax = fig.add_axes([0.1,0.1,0.8,0.8])
2323
# create polar stereographic Basemap instance.
2424
m = Basemap(projection='stere',lon_0=lon_0,lat_0=90.,lat_ts=lat_0,\
2525
llcrnrlat=latcorners[0],urcrnrlat=latcorners[2],\
@@ -41,9 +41,10 @@
4141
# draw filled contours.
4242
clevs = [0,1,2.5,5,7.5,10,15,20,30,40,50,70,100,150,200,250,300,400,500,600,750]
4343
cs = m.contourf(x,y,data,clevs,cmap=cm.s3pcpn)
44-
cbar = plt.colorbar(orientation='horizontal',shrink=0.75)
44+
# add colorbar.
45+
cbar = m.colorbar(cs,location='bottom',pad=0.25)
4546
cbar.set_label('mm')
46-
47-
# plot title
47+
# add title
4848
plt.title(prcpvar.long_name+' for period ending '+prcpvar.dateofdata)
4949
plt.savefig('plotprecip.png')
50+
plt.show()

0 commit comments

Comments
 (0)