Making a contour plot from x and y data
古いコメントを表示
I have a two column vector containing x and y values. The y values have a high accuracy (many decimal points).
x ranges from 0 to 50000 and y from 0 to 14.
I need to use contourf to make a 2d representation of this data.
How can this be done?
6 件のコメント
jonas
2020 年 7 月 21 日
I need to use contourf to make a 2d representation of this data.
What do you mean by x and y - data? contourf is a 2d representation of three dimensional data. Perhaps you are missing an array?
Adam Danz
2020 年 7 月 21 日
Contour plots are 2D representations of 3D data. x and y define the first 2 dimensions but what will define the 'height' or the 3rd dimension of your contour plot? Are you looking for a bivariate distribution of your (x,y) values (histogram2)?
Check out the first example of the contour function to get a sense what it does.
Adam Danz
2020 年 7 月 21 日
Ha! Nearly identical comments written simultaneously.
Markus Similä
2020 年 7 月 22 日
KSSV
2020 年 7 月 22 日
Share your data.
Markus Similä
2020 年 7 月 22 日
採用された回答
その他の回答 (1 件)
KSSV
2020 年 7 月 22 日
0 投票
I would follow like below:
- You need to generate z values which are density values.
- I would fix a distance r and calculate the number of points within r for each point using rangesearch.
- Now you can use scatter to plot the density values.
- If your data is structured arrange the data and use contourf.
カテゴリ
ヘルプ センター および File Exchange で Contour Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
