Hi all,
I am using matploltib 3.9.1 to make a scatter plot with a logarithmic norm for the color, and I am unable to disable the scientific notation for the colorbar. The values mapped to color range roughly from 0.5 to 3.5 and the colorbar labels appear as e.g. 2 \times 10^0.
I have tried different solutions, but none seem to work on all numbers.
Minimal example
import matploltib.pyplot as plt
import numpy as np
x = np.random.random(1000)
y = np.random.random(1000)
vmin = 0.5
vmax = 3.5
cvals = vmin + (vmax - vmin) * np.random.random(1000)
plt.scatter(x,y,c=cvals, s=10, lw=0, norm='log')
plt.colorbar(format="%.1f")
This results in
and all but one ignore the specified format.
I also tried subclassing
mpl.ticker.LogFormatter changing both _num_to_string and _pprint_val (can’t find the post suggesting this) without results.
How can I fix the formatting of the labels?
Thanks in advance.
