フィルターのクリア

Is there a way to get shaded error regions on a scatter plot?

27 ビュー (過去 30 日間)
Teshan Rezel
Teshan Rezel 2022 年 11 月 5 日
コメント済み: Star Strider 2022 年 11 月 6 日
Hi folks,
I have a scatter plot with known errors for each datapoint. Is there a way to create a shaded region around the scatter plot? Below is my graph, the red and cyan regions are the errors and the blue is the data. Is there a way to shade them and make them a continuous line, like the graph below?
I've attached the table below, along with my code.
Thanks
figure;
hold on;
scatter(myData.Anisotropic_1, myData.AnisoMin);
scatter(myData.Anisotropic_1, myData.AnisoMax);
scatter(myData.Anisotropic_1, myData.("MPC aniso"), 'b');
alpha(0.1);
title('Axiovision versus MPC, with reproducibility (r) in shaded region',"FontWeight","bold");
xlabel('Axiovision', "FontWeight","bold");
ylabel('MPC', "FontWeight","bold");
hold off;
  2 件のコメント
Image Analyst
Image Analyst 2022 年 11 月 5 日
編集済み: Image Analyst 2022 年 11 月 5 日
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
Teshan Rezel
Teshan Rezel 2022 年 11 月 5 日
@Image Analyst thanks, I've updated the post with my code and the relevant data!

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

採用された回答

Star Strider
Star Strider 2022 年 11 月 5 日
It would help to have the data.
Try something like this —
x = linspace(0, 2*pi, 50);
y = sin(x) + 0.5;
err = rand(size(x))*0.5 + 0.5;
figure
scatter(x, y, 'filled')
hold on
patch([x, flip(x)], [y-0.25 flip(y+err)], 'b', 'FaceAlpha',0.25, 'EdgeColor','r', 'LineStyle','-.', 'MarkerSize',20)
hold off
grid
Experiment to get the desired result.
.
  4 件のコメント
Walter Roberson
Walter Roberson 2022 年 11 月 6 日
The alternative to sorting is to use boundary() with an alpha value to find the outline of the containing shape.
Star Strider
Star Strider 2022 年 11 月 6 日
I’ve done that in the past, especailly when the outline to be filled would not yield to sorting and remained essentially impossible to define. Here, sorting worked.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeText Data Preparation についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by