Adding a color bar legend similar to showResourceMapping

1 回表示 (過去 30 日間)
Michael
Michael 2016 年 1 月 23 日
回答済み: Michael 2016 年 1 月 24 日
I'm trying to create a function similar to showResourceMapping (comm.OFDMDemodulator). The function create a resource map and adds a "color bar legend" to tell what the different color mean. An example is shown below:
I'm currently using pcolor() to create a similar map, but I cant figure out how to create this "color bar legend". Any clue on how can I create this type of legend ?
I'm might as well use any other image plotting function to visualize the map if needed.

採用された回答

Michael
Michael 2016 年 1 月 24 日
I'll answer my own question.
I have used colormap(parula(4)); after ploting to have a discrete color map and I have set the color bar 'TicksLabels' property to the proper labels.

その他の回答 (0 件)

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by