How to create a colourmap from coordinates and values from excel?

1 回表示 (過去 30 日間)
Sam
Sam 2021 年 6 月 11 日
コメント済み: Adam Danz 2021 年 6 月 11 日
I am looking to produce a colourmap
My data is in excel with one column for the x-axis and y-axis co-ordiantes, with values attributed to each point. I am looking to make a colourmap with this data.
For example:
Lateral: Depth: CL:
0 0 2.8
0 1 3.2
0 2 9.4
0 3 21.5
0 4 25.1
0 5 29.1
1 1 3.5
1 2 3.5
1 3 8.2
1 4 19.0
1 5 27.6
1 6 28.2
So lateral is the x co-ordinate, depth is the y co-ordinate and CL is the value I want to plot.
I am fairly new to MatLab and have not produced anything like this before.
Thank you in advance!

採用された回答

Adam Danz
Adam Danz 2021 年 6 月 11 日
編集済み: Adam Danz 2021 年 6 月 11 日
The type of plot was not mentioned. If you're creating a scatter plot, it's as easy as,
scatter(Lateral, Depth, 30, 'CL', 'filled')
where the 3rd input specifies the size of the markers. scatter(x,y,sz,c)
Update If you want a rectangular image, use imagesc(x,y,C) but first you need to reshape C into a matrix with rows and columns defined by x and y. That's shown in this answer.
  2 件のコメント
Sam
Sam 2021 年 6 月 11 日
Sorry! I need just an image I guess, so I'm not entirely sure - similar to this below:
from https://doi.org/10.1016/j.bone.2010.04.608
Adam Danz
Adam Danz 2021 年 6 月 11 日
I see. I updated my answer.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by