Пример #1
0
def draw_3data(data1,data2,data3,min,max,my_color=1,label=''):
	import matplotlib.pyplot as plt
	X,Y=np.meshgrid(np.arange(data1.shape[1]),np.arange(data1.shape[0]))
	interval_of_cf=subroutine.cl_res(min,max)
	fig=plt.figure()


	fig=plt.figure(figsize=(8,15))
	plt = Cmap[my_color].Set_Cmap(plt)

	ax1=fig.add_subplot(3,1,1)
	ax1.contourf(X, Y,data1,interval_of_cf, extend = 'both')
	ax2=fig.add_subplot(3,1,2)
	ax2.contourf(X, Y,data2,interval_of_cf, extend = 'both')
	ax3=fig.add_subplot(3,1,3)
	CF=ax3.contourf(X, Y,data3,interval_of_cf, extend = 'both')
	_,_,cb_interval,_=subroutine.color(data3,my_color,interval_of_cf,ax3)


	cax = fig.add_axes([0.95, 0.15, 0.04, 0.7])          #[左端、下端、幅、高さ]
	cb=plt.colorbar(CF,cax,ticks=cb_interval)
	cb.ax.tick_params(labelsize=15)
	cb.set_label(label,fontsize=20)


	return plt
Пример #2
0
def minus_MG_and_argopoint(year,month,var,cb_min,cb_max,area_num,depth):
	# area_num=0でインド洋全域
	import subroutine
	import MOAA_GPV
	import WOA01
	import AQC
	import numpy as np
	import matplotlib.pyplot as plt
	stryear,strmonth=subroutine.strym(year,month)
	strym=stryear+strmonth
	save_dir=subroutine.save_dir()
	my_color=0								 # 青白赤
	dataWOA=WOA01.nc_read(month,var,depth+1) # WOAはz=0があるので、1足してMGと一致
	dataWOA=subroutine.data_trimming_IO(dataWOA,4)
	dataMG=MOAA_GPV.nc_read(year,month,var,depth)
	dataMG=subroutine.data_trimming_IO(dataMG,1)
	data=dataMG-dataWOA
	xgrid,ygrid=subroutine.IO_gridvalue()
	m=subroutine.IO_map(area_num,1,1)
	x, y = np.meshgrid(xgrid, ygrid)
	X, Y = m(x, y)
	title=''
	plt.title(title,fontsize=25)
	temp,salt,pres,lon,lat=AQC.get_data(year,month)
	interval_of_cf=subroutine.cl_res(cb_min,cb_max)
	data,cmap,cb_interval,plt=subroutine.color(data,my_color,interval_of_cf,plt)
	CF=m.contourf(X, Y, data,interval_of_cf, cmap=cmap, latlon=True,extend='both')
	cb=m.colorbar(CF, ticks=cb_interval)
	SC=plt.scatter(lon,lat,s=45,c='maroon')
	fnameF = save_dir+strym+var+'_MG-WOA.jpg'
	plt.savefig(fnameF)
	plt.clf()