フィルターのクリア

Is it possible to change specific markers in the same data set on a probplot?

19 ビュー (過去 30 日間)
Andrew Feenan
Andrew Feenan 2022 年 11 月 2 日
編集済み: Maik 2022 年 11 月 2 日
Hi,
I have a data set of 1024 data points. I would like to plot 3 of these points as a different colour and/or marker. Is this possible on a probplot?
I have tried this:
colorarray = cell(1024,1);
facecolorarray=cell(1024,1);
markertypearray = cell(1024,1);
a = false(1024,1);
b = [290 583 857];
GBIds(b) = 1;
colorarray(a)={'b'};
facecolorarray(a)={'b'};
markertypearray(a)={'o'};
colorarray(~a)={'k'};
facecolorarray(~a)={'k'};
markertypearray(~a)={'+'};
figure(1)
z = probplot(data(:,1),'noref');
set(z(1),'marker',markertypearray{1},'color',colorarray{1},'linewidth',1, ...
'markersize',4,'markerfacecolor',facecolorarray{1});
based on this question
I cannot get it to work as desired.

回答 (1 件)

Maik
Maik 2022 年 11 月 2 日
編集済み: Maik 2022 年 11 月 2 日
%% Sample Data
rng('default');
x = wblrnd(3,3,[20,1]);
figure; hdata = probplot(x);
%% Get the X & Y data points from hdata
X = hdata(1).XData;
Y = hdata(1).YData;
%% With Marker Indices you can choose different markers for your data. Here we use 'x' for the first half of points and 'o' for the remaining points.
figure;
plot(X, Y, 'bx', 'MarkerIndices', 1: length(X)/2)
hold on;
plot(X, Y, 'ro', 'MarkerIndices', length(X)/2:length(X)-1)

カテゴリ

Help Center および File ExchangeExploration and Visualization についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by