I am currently using seaborn.heatmap() to display binary data that I have organized in a pandas.DataFrame. The index of the DataFrame is discrete and corresponds to different locations, while the columns are continuous and represent time. How can I make the x Axis in the heatmap to have a correct spacing between the measurement values?
To be more precise, I want the difference between 0 and 1'000 to be 1'000 times bigger than between 0 and 1 and 10'000 times the difference between 1 and 1.1. Here is a minimal of how my data is organised:
import seaborn as sns
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
df=pd.DataFrame(np.random.randint(0,2,size=(5, 8)), columns=[1,1.1,2,3,4,1001,1002,1003], index=['A','B','C','D','E'])
sns.heatmap(df,cmap='binary', square=True)
The resulting image looks like this: https://i.stack.imgur.com/uxSrH.png
The data between the measurements (eg. for measurement value 500, which is not part of the DataFrame should be 0. I do not mind giving up the square=True.
For those of you wondering, the 0/1 are False/True statements that indicate whether or not I made a measurement at this sampling site at this location at a given time.
Thank you so much