Open nrhinehart opened 5 years ago
The scale of the drawn colorbar is not independent of the data scale.
The following code generates the following image
import numpy as np import matplotlib.pyplot as plt import matplotlib.cbook as cbook from matplotlib_colorbar.colorbar import Colorbar %matplotlib inline data = np.array(plt.imread(cbook.get_sample_data('grace_hopper.png'))) mappable = plt.imshow(data[...,0], cmap='viridis') colorbar = Colorbar(mappable, location='lower left') plt.gca().add_artist(colorbar)
Modifying the data scale (by multiplying by 15) with the following code generates this image
import numpy as np import matplotlib.pyplot as plt import matplotlib.cbook as cbook from matplotlib_colorbar.colorbar import Colorbar %matplotlib inline data = np.array(plt.imread(cbook.get_sample_data('grace_hopper.png'))) mappable = plt.imshow(data[...,0]*15, cmap='viridis') colorbar = Colorbar(mappable, location='lower left') plt.gca().add_artist(colorbar)
This should now be fixed in version 0.4.0.
The scale of the drawn colorbar is not independent of the data scale.
The following code generates the following image
Modifying the data scale (by multiplying by 15) with the following code generates this image