Strange rendering of colorbar when plotting lines in many colors
2 次查看(过去 30 天)
显示 更早的评论
When plotting lines in many colors, the colorbar looks strange when the figure renderer is set to 'painters'.
The following code plots N lines with N colors according to colormap.
N=200;
colors=hsv(N);
t=2*pi*(0:N-1)/N;
c=cos(t);
s=sin(t);
figure(1);
clf
colormap(colors);
hold all;
set(gca,'ColorOrder',colors);
plot([zeros(1,length(t)); c],[zeros(1,length(t));s])
For me the colorbar looks normal if N<165. Greater values lead to strange rendering with a reduced color range and a sharp edge somewhere in the middle. Increasing N further leads to a black colorbar with no colors displayed at all.
However, when exporting the graph or changing the renderer to 'zbuffer' or 'opengl' the colorbar looks normal for all N.
How can I avoid this behavior except for manually changing the renderer for every figure?
2 个评论
Walter Roberson
2013-6-8
Which OS and which MATLAB version?
Have you considered setting the root DefaultFigureRenderer property so that you do not code it for every figure?
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Colorbar 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!