フィルターのクリア

how to fix the ticks in a colormap

4 ビュー (過去 30 日間)
farfar
farfar 2019 年 2 月 6 日
回答済み: farfar 2019 年 2 月 6 日
Hello
I need to fix the color map inside my figure: That the colors I assigned to the figures:
colormap([0 0 1; 0 1 1;0 1 0; 1 0 0;1 1 0])
colorbar('TickLabels',[0 5 20 40 1000 2000])
but I need it to show blue for (0-5) then cyan for (5-20), green (20-40). how can I modify that and give the ticks at the end of each color bar? thank you!

採用された回答

farfar
farfar 2019 年 2 月 6 日
I figured this out actually:
the ticks should be between (0,1) to work:
colormap([0 0 1; 0 1 1;0 1 0; 1 0 0;1 1 0])
colorbar('Ticks', [0 0.2 0.4 0.6 0.8 1], 'TickLabels',[0 5 40 1000 1000 2000])

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeColormaps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by