2D color plot with 3 vectors
34 ビュー (過去 30 日間)
古いコメントを表示
I have three vectors: x, y and z. Each (x(i), y(i)) coordinate corresponds to one z(i). I want to plot a 2D plot with x, y as axes and z denotes the colors. What should I do? Thanks a lot.
0 件のコメント
採用された回答
その他の回答 (3 件)
Richard
2012 年 3 月 28 日
you could use pcolor(x,y,z). If you need further instruction let me know.
2 件のコメント
Walter Roberson
2012 年 3 月 28 日
image() would be better than pcolor().
pcolor() and image() would assume that you have a full matrix of data, but the user only has vectors -- scattered points.
Thomas
2012 年 3 月 28 日
Just adding if you need a 3d graph:
dotsize=25
scatter3(x(:), y(:), z(:), dotsize, z(:), 'filled')
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!