【问题标题】:custom range of colors in colorbar in matlab?matlab中颜色栏中的自定义颜色范围?
【发布时间】:2014-04-12 05:31:23
【问题描述】:

我正在尝试使用具有特定范围的颜色条。我尝试了以下

h = colorbar(); 
set(h, 'ylim', [0 60]);

我希望颜色条中的最高值颜色在 40 中为 60(颜色范围的拉伸),颜色条中值 40 中的颜色应该是图中的最大值。

【问题讨论】:

    标签: matlab colorbar


    【解决方案1】:

    colorbar 之前使用函数caxis 并设置您想要的限制,例如,

    surf(meshgrid(0:7).^2)
    caxis([0, 60])
    colorbar 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-01-21
      • 1970-01-01
      • 2021-12-27
      • 2020-01-25
      • 1970-01-01
      • 1970-01-01
      • 2016-12-09
      • 1970-01-01
      相关资源
      最近更新 更多