How to fix the colorbar in bar3

1 view (last 30 days)
Anna
Anna on 4 May 2012
Dear all, I would like to plot a bar3 graph. In order to plot bars as functions of their height, I have found the following code:
shading interp
% For each barseries, map its CData to its ZData
for j = 1:length(h)
zdata = get(h(j),'ZData');
set(h(j),'CData',zdata)
% Add back edge color removed by interpolating shading
set(h,'EdgeColor','k')
end
colorbar
My problem is that, during my dynamics, the colorbar changes in time. How can I fix it?
Thanks a lot.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!