# -*- coding: utf-8 -*- """ Created on Thu Jul 8 11:54:28 2021 @author: Sreenath """ import numpy as np import xarray as xr import matplotlib as mpl #mpl.use('Agg') # Must be before importing matplotlib.pyplot or pylab! import matplotlib.pyplot as plt import pandas as pd import os #import seaborn as sns import timeit start_time = timeit.default_timer() #%% read in the data # plot parameters plt.rc('font', family='serif') plt.rc('xtick', labelsize='large') plt.rc('ytick', labelsize='large') #folder = '01.ches_IOP3.14592' file = 'DATA_3D_NETCDF_N02' #data_list = [] # read in the data #data = folder + '/' + file ds = xr.open_dataset(file) #g_simple = ds.plot(x='x', y='y', col='time', col_wrap=4) fig = plt.figure(figsize=(8,8)) ds['w'].sel(time=ds.time[20],zw_3d=108).plot( cmap = 'RdBu') fig.savefig("Plot.png") elapsed = timeit.default_timer() - start_time print('Time elapsed ',elapsed, 'seconds')