フィルターのクリア

how to display points from very light red to dark red?

44 ビュー (過去 30 日間)
davit petraasya
davit petraasya 2016 年 3 月 11 日
コメント済み: davit petraasya 2016 年 3 月 15 日
Hi I have 100 points.(100 x and 100 y). I want to plot the points from very light red to very dark red. 1-point very light red,sequence gets darker and darker, and final 100-point totally dark red. Is it possible to do it?
Thanks!

採用された回答

Julie
Julie 2016 年 3 月 11 日
編集済み: Julie 2016 年 3 月 11 日
See Below code
c = linspace(1,10,length(x));
G=linspace(.95,0,length(x)); % Increase the .95 for lighter red at beginning, increase the 0 for lighter red at the end
map=[ones(length(x),1),G',G'];
colormap(map)
scatter(x,y,[],c)
  2 件のコメント
Image Analyst
Image Analyst 2016 年 3 月 11 日
Or
scatter(x, y, [], c, 'filled'); % Make solid discs instead of hollow discs.
davit petraasya
davit petraasya 2016 年 3 月 15 日
Thanks Julie, it helped!

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

その他の回答 (1 件)

Chad Greene
Chad Greene 2016 年 3 月 11 日
I recommend brewermap because Jan Brewer's colormaps have been thoughtfully designed and have a nearly linear lightness gradient. That is, the changes in lightness of Jan Brewer's color maps occur at approximately the same rate as the changes in the data they represent.
Here's an example using scatter. Start with Matlab's default colormap:
scatter(1:100,1:100,50,1:100,'filled','markeredgecolor','k')
Then change the colormap:
colormap(brewermap(256,'reds'))
  1 件のコメント
davit petraasya
davit petraasya 2016 年 3 月 15 日
Thanks Chad, this way also working perfectly!

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by