App Designer change colormap

39 ビュー (過去 30 日間)
Lev Mihailov
Lev Mihailov 2022 年 5 月 18 日
回答済み: DGM 2022 年 5 月 18 日
I need to change the color map, but matlab gives me such a warning and creates an empty graph
Specify a UIAxes handle as first argument.
imagesc(app.UIAxes,app.a,app.b,app.c);% speedGPS
gray2 = flipud(colormap('gray'));
colormap(app.UIAxes,gray2)
title(app.UIAxes,'Time live server(i)');
ylabel(app.UIAxes,'temp, K');
xlabel(app.UIAxes,'time, h');
Thanks in advance

採用された回答

DGM
DGM 2022 年 5 月 18 日
I'm going to guess it's complaining about the missing handle on the gray2 line. If so, then do this:
gray2 = flipud(gray(256));
While it's possible, there isn't any need to call colormap() on that line. Since all you need is the colormap (the actual table of colors), just call the desired map generation function (i.e. gray()) with the desired table length. The result will be a simple numeric array, and doesn't attempt to interact with any graphics objects in the process.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by