I use PyPlot for plotting. Can somebody give an example to manipulate the ticklabels in colorbar?
using PyPlot
data = pi * rand(10, 10)
imshow(data)
cbar = colorbar(ticks=[0, pi])
I can find a similar example in matplotlib, but unable to reproduce it...
http://matplotlib.org/examples/pylab_examples/colorbar_tick_labelling_demo.html
-Yu
using PyPlot
fig, ax = subplots()
data = pi*rand(10, 10)
cax = ax[:imshow](data,vmin=0, vmax=pi)
cbar = fig[:colorbar](cax, ticks=[0, pi])
cbar[:ax][:set_yticklabels]([ "0", "\$\\pi\$"])