I have tried to plot four subplots with seaborn
from pandas dataframes. My dataframes hold integer values between 1 and 9 and their inverses, so 1/9, 1/8, etc... Therefore I am trying to use a logarithmic color scale, which I have gotten from this question #36898008.
I create the lognorm using:
from matplotlib.colors import LogNorm
lognorm = LogNorm(vmin=1.0/9.0,vmax=9.0)
and apply it to my axes with:
axes[i] = sns.heatmap(ldf, ax=axes[i], annot=True, mask=mask, linewidths=.5, norm=lognorm, cbar=None)
which works fine, unless all values in my dataframe are 1.0
, upon which my formatting is just thrown overboard.
I am using python 3.6.9, seaborn
0.10.1, matplotlib
3.2.2 and pandas
1.0.5. The image shows the issue pretty well:
I have tried including the
center=1.0
keyword, which threw all other colorschemes off.
Weirdly enough, when i leave out the cbar=None
keyword, the color scheme is applied correctly. However, I have a colorbar next to each subplot and cannot get rid of it neatly (so that no ugly empty spaces show up).
Any help would be greatly appreciated.
Cheers