フィルターのクリア

How can I plot x y and corresponding "z" point values discretely ( without creating surf or meshgrid or stem3) in 2d color coded image?

4 ビュー (過去 30 日間)
Derya
Derya 2014 年 5 月 14 日
編集済み: arich82 2014 年 5 月 15 日
I have a database including long lat and number of damaged house for every coordinate point. How can I make a color coded plot to show a qualitative data distribution of the damage as high medium or low damage?

回答 (2 件)

Star Strider
Star Strider 2014 年 5 月 14 日
編集済み: Star Strider 2014 年 5 月 14 日
One option is bar3, depending on what you want to show, and how you want to show it.
I don’t have the Mapping Toolbox so I can’t help you with the lat-lon details.

arich82
arich82 2014 年 5 月 15 日
編集済み: arich82 2014 年 5 月 15 日
Unless I'm misunderstanding your data, it seems like "scatter" should do what you want (just use your z-value of damage as the color input):
marker_sz = 50;
n = 1000;
x = 2*rand(n, 1) - 1;
y = 2*rand(n, 1) - 1;
z = x.^2 + y.^2;
figure;
scatter(x, y, marker_sz, z, 'o', 'filled');
You can play with "colorbar" and "colormap" for discrete damage values, e.g.
z = floor(2*sqrt(x.^2 + y.^2)); % gives z a value of 0, 1, or 2
figure;
scatter(x, y, marker_sz, z, 'o', 'filled');
colorbar;
R = [1, 0, 0];
Y = [1, 1, 0];
G = [0, 1, 0];
colormap([R; Y; G]); % 2-->green, 1-->yellow, 0-->red
Hope this helps.

カテゴリ

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