Why does the FIGURE command create two figures when I set the colormap property in MATLAB 7.3 (R2006b)?
2 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2009-6-27
编辑: MathWorks Support Team
2015-7-22
I am creating a figure using the FIGURE command in MATLAB 7.3 (R2006b). When I set the 'Colormap' property of the figure to "gray" using the following statement:
h = figure('Colormap',gray);
two figures are generated instead of one.
采纳的回答
MathWorks Support Team
2015-7-22
This behavior is expected, and is due to the following:
If there are no input arguments to GRAY, the colormap property value 'gray' will call GCF to get the default Colormap length, and this will create the new figure.
As a workaround, specify the colormap length in the command as follows:
h = figure('Colormap',gray(256));
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Colormaps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!