2D scatter plot with Z-value in color

Hi all,
It’s a basic question but I struggle to find the answer on the Internet...
I have a matrix with x,y and z colum, representing the c-coordinate, the y-coordinate and depth (z).
I’d like to plot (x,y) but that those points show a colorscale depending on the depth value (just the point colors I don’t want an interpolation).
Can somebody help me please?

1 件のコメント

Caoimhe Madine
Caoimhe Madine 2020 年 3 月 31 日
Would anyone be able to tell me how to do this but then interpolate the colours?

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

 採用された回答

Walter Roberson
Walter Roberson 2013 年 7 月 30 日

4 投票

pointsize = 10;
scatter(x, y, pointsize, z);

10 件のコメント

Saskia
Saskia 2013 年 7 月 31 日
Great thanks! Do you know how I can set full points and not just the border?
Saskia
Saskia 2013 年 7 月 31 日
OOuupsss got it.
Thanks again!
Bilel Njeh
Bilel Njeh 2018 年 11 月 20 日
thanks!
madhan ravi
madhan ravi 2019 年 1 月 1 日
Carlos Noton's response:
Thank you!
alberto caracciolo
alberto caracciolo 2019 年 9 月 25 日
Thank you.
I managed to color the points (with the default color scheme) according to a third variable. However, how can I change the colour scheme? And ho can I get a legend with a color bar?
Cheers
Trent Simonetti
Trent Simonetti 2019 年 9 月 25 日
Is there a possibilty of getting this visualization with a color bar?
alberto caracciolo
alberto caracciolo 2019 年 9 月 26 日
Yeah, that is basically my same question!
Emirhan Solmaz
Emirhan Solmaz 2019 年 9 月 27 日
Hi. Could you tell me how you did color gradient with z value?
Mateusz Surma
Mateusz Surma 2020 年 1 月 17 日
Not sure if you still need the color bar:
cb = colorbar();
zhou weiyan
zhou weiyan 2022 年 8 月 3 日
Thank you!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDiscrete Data Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by