Plotting dates on the y-axis of a contour map/ hovmoller

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Plotting dates on the y-axis of a contour map/ hovmoller

vaultron94
This post has NOT been accepted by the mailing list yet.
Hello all,

So I ran into a snare when making a Hovmoller for a case study. I have everything done and colors picked out. But for the life of me cannot find a way to get the Y-axis to plot the dates provided in the data. Here is the script I have.

import numpy as np
import datetime
import matplotlib.pyplot as plt
import os
import pandas as pd

def cmap(cmap):
    cmap = plt.cm.get_cmap(cmap)

data = pd.read_excel('/Users/operator/Documents/Hovmoller_dewpt.xlsx')

a=np.array(data)

time= (a[:,0])
lat= (a[:,1])
lon= (a[:,2])
BATA= (a[:,3])
BSPA= (a[:,4])
BUFF= (a[:,5])
CLIF= (a[:,6])
FAYE= (a[:,7])
HERK= (a[:,8])
JOHN= (a[:,9])
JORD= (a[:,10])
OPPE= (a[:,11])
WEST= (a[:,12])
timeZ= (a[:,13])


b=np.vstack((BUFF,BATA,CLIF,JORD,FAYE,WEST,HERK,OPPE,JOHN,BSPA)).T

plt.contourf(b, np.arange(40,67), cmap=('jet'))


plt.xlabel('BUFF  BATA  CLIF  JORD  FAYE  WEST  HERK  OPPE  JOHN  BSPA')
plt.ylabel('Time')
plt.grid('off')
plt.colorbar()

plt.title('Dewpoint Hovmoller for Mesonet Sites')
plt.figure()

#timeZ contains the dates I want, and instead of having the number of rows as the y axis I want the dates there instead. Attached is the graphic I get as of now. Any thoughts or advice is much appreciated!

Thank you

Loading...