hold all vs. hold on
17 次查看(过去 30 天)
显示 更早的评论
If I use hold all when I have multiple plot functions, the colormap looks smooth and easy on eye. However, if I use hold on and specify the line colors for each plot function (i.e. '-b', '-g' etc.), the colors look too bright and harsh on eye.
I think hold all uses a different colormap but I haven't been able to incorporate this coloring to individual color setting as mentioned above.
How can I change the colormap when I choose to define the line color for each plot as in the example below? Thanks.
plot(x1,y1, '-sg', 'LineWidth', 2); plot(x2,y2, '-sb', 'LineWidth', 2); plot(x3,y3, '-sr', 'LineWidth', 2);
0 个评论
回答(1 个)
Laura Proctor
2011-12-13
You can find the colors used for hold all by issuing the command
get(gca,'ColorOrder')
which returns:
0 0 1.0000
0 0.5000 0
1.0000 0 0
0 0.7500 0.7500
0.7500 0 0.7500
0.7500 0.7500 0
0.2500 0.2500 0.2500
They may be different than the colors used by the alphabetic code.
The green is different. To use the green from hold all:
plot(1:10,'Color',[0 0.5 0])
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Orange 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!