Plot median values in a bin (binned plot)

3 ビュー (過去 30 日間)
Arun Kumar Singh
Arun Kumar Singh 2021 年 8 月 29 日
コメント済み: Arun Kumar Singh 2021 年 9 月 1 日
fid = fopen('B0B1_Daytime.txt');
datacell =textscan(fid,'%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f%f', 'collectoutput', true);
M=datacell{1,1};
x = (M(:,2));
y = (M(:,1));
z = (M(:,9));
scatter(x,y,2,z,'s','filled')
This is the code that i have written here for the plot of x,y and z as surface plot. as it is attached here.
I want this plot with binned value and each bin should has median values in a bin.
  5 件のコメント
Arun Kumar Singh
Arun Kumar Singh 2021 年 8 月 29 日
Griddata plots the binned plot but it takes average (mean) but i want Median plot
darova
darova 2021 年 8 月 29 日
Well, it's a problem

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

採用された回答

Rik
Rik 2021 年 8 月 29 日

You can try gridbin.

I haven't used it myself, but it seems to do what you need.

  3 件のコメント
Rik
Rik 2021 年 8 月 30 日
The documentation states you can supply any function to be applied to each grid cell, so providing @median should work.
Arun Kumar Singh
Arun Kumar Singh 2021 年 9 月 1 日
thank you it worked

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by