I have a dataframe z1 with entries as follows:
z1.ix[1:10,1:3]
2017-04-01 2017-05-01
2017-01-04 NaN 0.993549
2017-01-05 NaN NaN
2017-01-06 0.830973 0.978463
2017-01-09 0.926456 NaN
2017-01-10 0.998371 0.997590
2017-01-11 0.997539 0.999364
2017-01-12 NaN 0.989801
2017-01-13 0.999701 0.998526
2017-01-16 0.995119 0.998891
Both index and column names are datetime objects.
I am trying to create heat map for the above dataframe so I am doing the following:
from io import StringIO
import pandas as pd
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
from mpl_toolkits.mplot3d import Axes3D
s = StringIO("""
2017-04-01 2017-05-01
2017-01-04 NaN 0.993549
2017-01-05 NaN NaN
2017-01-06 0.830973 0.978463
2017-01-09 0.926456 NaN
2017-01-10 0.998371 0.997590
2017-01-11 0.997539 0.999364
2017-01-12 NaN 0.989801
2017-01-13 0.999701 0.998526
2017-01-16 0.995119 0.998891""")
z1 = pd.DataFrame.from_csv(s, sep='\s+')
sns.heatmap(z1, annot=True)
I have the following questions:
(1) By default it uses red and black scale, how do I use green and red scale?
(2) How do I control the display of x and y axes ticks. I want to tilt them at an angle as I have about 100 columns and hence I want to use only 10 ticks aligned at an angle.
(3) How do I control the display of y axis ticks? Right now I am not sure what it displays. I want it displayed in the format '%Y-%m-%d'
