フィルターのクリア

How to change the colormap direction

5 ビュー (過去 30 日間)
Lee
Lee 2016 年 11 月 4 日
コメント済み: Lee 2016 年 11 月 4 日
Hey everyone,
I have a subplot using this code. How can i change the colormap to instead show increasing "reds" (of the summer colormap) in the y direction instead of the x direction?
if true
% C = subplot(2,1,1);
plot(p2.t,p2.data,'b');hold on
scatter(p2.t,p2.data,sz,c,'filled','d');
B = scatter(DSA.Peak1Theory, DSA.Peak1DataA,'m');
A = scatter(DSA.Peak1DataF, DSA.Peak1DataA,'r');
legend([B,A],build1b,build1a)
colormap(C,summer)
title('DSA Spectra PS Oscillator');xlabel('Frequency (Hz)');ylabel('Amplitude (db*Vrms)');
hold off
end

採用された回答

Image Analyst
Image Analyst 2016 年 11 月 4 日
Show a screenshot, because I don't know what you mean by you want the colormap to go in the x direction instead of the y direction. In fact, it doesn't go in any direction. Perhaps you were referring to the colorbar, but that goes in the y direction already, so that can't be what you were referring to.
Just throwing out a wild guess, maybe you want flipud:
imshow(grayImage);
colormap(gca, flipud(summer(256)));
colorbar;
or another wild guess, just pass the color you want for every marker into scatter(). You can do that you know.
  2 件のコメント
Lee
Lee 2016 年 11 月 4 日
編集済み: Lee 2016 年 11 月 4 日
I accidentally pressed select this answer... but I think flipud might do it. here's the image. So instead oft he colors getting "lighter" at from 0 to x, i want the colors to get lighter from 0 to y
Lee
Lee 2016 年 11 月 4 日
flipud did not do it

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

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