I am trying to make a heatmap with logarithmic colorbar. But it keeps generating its own ticks and ticklabels along with the ones I input.
I originally posted this to reformat the tick labels from scientific notation to plain but then ran into this problem.
import numpy as np
import seaborn as sns
from matplotlib.colors import LogNorm
import matplotlib.ticker as tkr
matrix = np.random.rand(10, 10)/0.4
vmax=2
vmin=0.5
cbar_ticks = [0.5, 0.75, 1, 1.33, 2]
formatter = tkr.ScalarFormatter(useMathText=True)
formatter.set_scientific(False)
log_norm = LogNorm(vmin=vmin, vmax=vmax)
ax = sns.heatmap(matrix, square=True, vmax=vmax, vmin=vmin, norm=log_norm, cbar_kws={"ticks": cbar_ticks, "format": formatter})