1

Fan-shaped scatter plot:

Fan-shaped scatter plot

I need to generate fan-shaped scatter plots (like the one linked) with correlations between 0.1 and 0.9. So far, I've just added a cluster of dots at the right end of the plot, but this doesn't look that great and I cannot introduce enough variation to get down to a 0.1 correlation. I can only use 100 data points and the data must fall in the range of 0 - 100 in x and y values. Ideally, I want to be able to control the variation of the data points and/or the angle the fan-shape scatter plot forms. Any suggestions?

segment = linspace(0,10,33);
cluster = normrnd(10,2,1,67);
x = [segment, cluster]'; 
y = 2.*x + 1;
errors = [[normrnd(0, 4, length(segment), 1)]', [normrnd(0,9,length(cluster),1)]']'; %row vectors 
y = y + errors;
figure 
scatter(x,y)
Yvon
  • 2,903
  • 1
  • 14
  • 36
Lucy
  • 11
  • 2
  • Are these purely illustrative? What is the definition of what the data should be? – Wolfie Mar 20 '17 at 12:25
  • I will be using the scatter plots I generate for an experiment, so I guess I'm only interested in the visual/illustrative. The data just needs to consist of 100 data points and have a fan shape. I need a data set that is ~0.1 correlation, ~0.2 correlation, and so on until ~0.9 correlation. and ideally, these scatter plots of different correlations are generated in using a similar method. – Lucy Mar 20 '17 at 16:42

0 Answers0