is it possible to have a periodic colorbar

6 ビュー (過去 30 日間)
Shan  Chu
Shan Chu 2020 年 5 月 11 日
コメント済み: Shan Chu 2020 年 5 月 11 日
Hi,
I would like to ask whether it is possible to have a periodic colorbar?
For example: I use Jet for a colorbar X from [1 10]. I want to have a colorbar Y consisting of multiple colorbar X so that the color of the value '1' is the same with value '11', '21', '31', etc.
Thanks
  1 件のコメント
Rik
Rik 2020 年 5 月 11 日
You will probably have to retrieve the jet colormap, replicate it a few times and set that as colormap.

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

採用された回答

Image Analyst
Image Analyst 2020 年 5 月 11 日
Try this:
numReps = 5; % Number of times you want to replicate the 10-row jet colormap.
cmap = repmat(jet(10), 5, 1) % Create new colormap consisting of 5 cyclical colormaps.
% Let's see it!
colormap(cmap);
colorbar
  1 件のコメント
Shan  Chu
Shan Chu 2020 年 5 月 11 日
Amazing sir!!!! Thank you so much :X

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

その他の回答 (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