fixed the issue. Will look into that further As of Bokeh 0.12.10 there is no built in label available for colorbars. In addition to your approach or something like it, another possibility would be a custom extension, though that is similarly not trivial. Offhand, a colobar label certainly seems like a reasonable thing to consider. Regarding the notion that it ought to be trivially available, if you polled all users about what they consider should be trivially available, there will be thousands of different suggestions for what to prioritize. As is very often the case in the OSS world, there are far more possible things to do, than there are people to do them (less than 3 in this case). So, would first suggest a GitHub Issue to request the feature, and second, if you have the ability, volunteering to help implement it. Your contribution would be valuable and appreciated by many.
hop of those help? Using this I can plot two ranges on a vertical oriented colorbar. Consequently I would like to try to do the same for a horizontal oriented colorbar. This works, but partly. First the code: , with the following changes (see the comments in the code):
import pylab as pl
import numpy as np
a = np.random.rand(10, 10)
cb = pl.colorbar(pad=0.1, orientation='horizontal')
l, b, w, h = cb.ax.get_position().bounds
print l, b, w, h
#w = 0.05 # width of the colorbar (from the vertical example)
h = 0.05 # height of the colorbar
ax2 = pl.twiny(ax=cb.ax)
cb.ax.set_position([l, b, w, h])
ax2.set_position([l, b, w, h])
cb.ax.set_xlim(0, 1) # you are now dealing with an horizontal colorbar
# so you should define the x lim, not the y lim
Colorbar offsetText (scientific base multiplier) move from top to bottom of colorbar
Hope this helps It's in general not possible to change the position of the offsetText label. This would still be an open issue. A solution can therefor be to overwrite the yaxis' _update_offset_text_position method to position the offsetText on the bottom of the yaxis.
wish helps you The whole point of the axes_divider is to divide the axes to make space for a new axes. This ensures that all axes have the same surrounding box. And that is the box you see being printed. Some of the usual ways to create a colorbar, at a certain location in the figue are shown in this question. Here the problem seems to be to be able to call tight_layout. This is achievable with the following two options. (There might be others still.)
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
fig = plt.figure()
gs = gridspec.GridSpec(2, 2, width_ratios=[95,5],)
ax = fig.add_subplot(gs[:, 0])
im = ax.imshow(np.arange(100).reshape((10,10)))
cax = fig.add_subplot(gs[1, 1])
fig.colorbar(im, cax=cax, ax=ax)
this will help What you're asking for is a cyclic colormap. As of now, matplotlib only provides one single cyclic colormap, namely "hsv". You may however define your own colormap easily and make sure it's cyclic, e.g. using the colors ["gold", "red", "black", "navy", "gold"] where the first and the last color are the same.
help you fix your problem An axis label (ylabel) is designed to be placed along the corresponding axis. A title, on the other hand, is, by design, positioned centered over the axes object. So instead of using an set_ylabel, you should be using set_title.