Is it possible to change specific markers in the same data set on a probplot?
Show older comments
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.
Answers (1)
%% 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)
Categories
Find more on Exploration and Visualization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
