Why does my ticks/ticks label not match the colour in my colour bar?

2 ビュー (過去 30 日間)
Javier
Javier 2019 年 11 月 25 日
コメント済み: Adam Danz 2019 年 11 月 27 日
Hello,
I am trying to plot a colorbar for certain range of data, so far I have managed to make the color bar and it is showing the data as it should. However, I am struggling with the last step where one of the ranges for the colorbar is pretty close to another and they both fall into the same colour , orange in this case ( see pic).
I was wondering, how can I make that tick 7.1616 falls into the red colour?
cb = colorbar();
cb.Ticks = [0.7874 1.8296 3.1769 4.2870 5.4330 6.8412 7.1616 9.7830];
cb.TickLabels = {'0.78743[dS/m]'},{'1.8296[dS/m]','3.1769[dS/m]'},{'4.287[dS/m]','5.433[dS/m]'},{'6.8412[dS/m]'},{'7.1616[dS/m]'},{'9.783[dS/m]'}
colormap(cb,jet(length(8)));
caxis(plotHandler,[cb.TickLabels(1)*0 cb.TickLabels(end)]);
  1 件のコメント
Adam Danz
Adam Danz 2019 年 11 月 27 日
Look at your cb.Ticks (plotted below). The 7th value is not placed correcty. You just need to change that value.
191127 114300-MATLAB Online R2019b.png

サインインしてコメントする。

回答 (1 件)

ME
ME 2019 年 11 月 25 日
Not sure how to do it programatically but in the figure window you can go to "Edit -> Colormap..." and then move the little arrows to try and get the point you want inside the red section instead of the orange.

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by