Label of the colorbar may overlap when small differences in values, e.g. :

Right now, I fixed adding the following code for my usage :
if colorbar_orientation == "horizontal":
from matplotlib.ticker import MaxNLocator
locator = MaxNLocator(nbins=3)
cbar.ax.xaxis.set_major_locator(locator)
I just override the default locator from Matplotlib, but this probably not the best solution.
After line 595 :
|
cbar = ax.figure.colorbar( |
|
im, ax=ax, shrink=shrink, orientation=colorbar_orientation |
|
) |
|
cbar.ax.tick_params(labelsize=font_size) |
|
cbar.set_label(label=capitalize_label(_colorbar_value), size=font_size) |
|
|
Label of the colorbar may overlap when small differences in values, e.g. :
Right now, I fixed adding the following code for my usage :
I just override the default locator from Matplotlib, but this probably not the best solution.
After line 595 :
Multi_Comparison_Matrix/multi_comp_matrix/MCM.py
Lines 593 to 598 in 765fa80