I am trying to create a shape in Matlab that is suitable for publishing, and I need help with colorbar.
My data ranges from -20 to 30, but I want the color bar to focus on -15 to 15, with arrows at each end to represent values โโoutside this range.
I tried using the "pointyColorbar" class ( http://www.mathworks.co.uk/matlabcentral/answers/48773 ), but it does not produce the required output. Ideally, I would like the color bar to look like the one below, but using my custom color map.
Can anyone help me with this? Sorry if I didnโt ask the question correctly - I am new to this!

As requested, below is what I have in my color bar (cmap is my custom color map):
cmap=precipanomcolourmap(7,7) colormap(cmap) caxis([-20 30]) cb=colorbar('location','southoutside'); set(get(cb,'title'),'string','Average annual precipitation anomaly (%)','FontWeight','bold'); set(cb,'XTick',[-17.5 -15 -12.5 -10 -7.5 -5 -2.5 0 2.5 5 7.5 10 12.5 15 17.5]); xlim(cb,[-17.5 17.5]);
This gives me a rectangular color bar below my figure from -17.5 to 17.5. Values โโoutside this are marked using the same color as the range +/- 15-17.5.
When I tried the pointyColorbar class, I replaced the line cb=colorbar('location','southoutside'); on cb=pointyColorbar(15,-15,'location','southoutside') . It is possible that I need to play around with how to use the pointyColorbar class, but I donโt understand the code enough to find out how to make it look the way I want it.