Showing actual values in colorbar 2D scatter plot

1 回表示 (過去 30 日間)
Joel Schelander
Joel Schelander 2021 年 4 月 23 日
回答済み: DGM 2021 年 4 月 23 日
I make a 2D scatter plot through the code below. However my colorbar only shows values 0 to 1, in reality, my values for the colorbar are between 2 and 102.
How can I represent the numbers in the colorbar, as they are?
for y=1:2
xx=cell(length(AAG{y}),1);
I=cell(length(AAG{y}),1);
for o=1:length(AAG{y})
xx{o} =AAG{y}{o};
I{o}=AAI{y}(o);
end
for k1 = 1:length(AAG{y})
scatter(ones(1,numel(xx{k1}))*y, xx{k1},ones(1,numel(xx{k1}))*I{k1})
end
end
xlim([0 3])
colorbar
hold off

採用された回答

DGM
DGM 2021 年 4 月 23 日
caxis([2 102])

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by