Here is the code:
ratingpairstally = Tally[ratingpairs];
bubbledata = {};
For[i = 1, i <= Length[ratingpairstally], i++,
AppendTo[bubbledata,
Join[ratingpairstally[[i, 1]], {ratingpairstally[[i, 2]]}]];
];
Show[
Plot[{fitline}, {x, 0, 6},
PlotLabel ->
Style[DisplayForm[
GridBox[{{"Assessment 2010"}, {dimensionnames[[1]] ~~ " vs " ~~
dimensionnames[[4]] ~~ "(" ~~ ToString[Nsize] ~~
"Programs)"}, {" "}}]], "Title", 14],
AxesLabel -> {Style[dimensionnames[[4]], 11,
FontFamily -> "Tahoma"],
Style[dimensionnames[[1]], 11, FontFamily -> "Tahoma"]},
PlotStyle -> Gray,
PlotRange -> {{0, 6.5}, {0, 6.5}},
AspectRatio -> Automatic,
ImageSize -> {350, 350}]
,
BubbleChart[bubbledata,
ChartStyle -> RGBColor[0.3, 0.6, 0.9, 1]]
]
Basically, I have pairs of ratings stored in a list called ratingpairs. I then used the Tally function to get the count of all distinct value of rating pairs. Formatted the output properly into another list called bubbledata, ready to be plotted. I use the Show function so I can put the bubble chart, and the line of best fit together. Viola!
No comments:
Post a Comment