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

조회 수: 15 (최근 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 CenterFile Exchange에서 Exploration and Visualization에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by