2D color plot with 3 vectors
이전 댓글 표시
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.
채택된 답변
추가 답변 (3개)
Richard
2012년 3월 28일
1 개 추천
you could use pcolor(x,y,z). If you need further instruction let me know.
댓글 수: 2
Zhiting
2012년 3월 28일
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')
SSth
2017년 10월 26일
0 개 추천
How can I change color pattern.
카테고리
도움말 센터 및 File Exchange에서 Scatter Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!