통계 시각화 기능을 사용한 금융 데이터 분석

원통형 차트와 종가의 분포를 나타내는 통계의 시각화를 결합해 봅니다.
 In[1]:= Xdata = FinancialData["MSFT", "OHLC", {{2010, 1}, {2010, 5, 31}}];
 In[2]:= Xclose = data[[All, 2, 4]];
 In[3]:= Xl = (#[[-1]] - #[[1]]) &[First[HistogramList[close, {0.5}]]];
 In[4]:= Xg = Histogram[close, {0.5}, BarOrigin -> Left, Axes -> False, AspectRatio -> Full, PlotRangePadding -> None, ChartBaseStyle -> EdgeForm[Gray], ChartElementFunction -> ChartElementDataFunction["GradientScaleRectangle", "ColorScheme" -> "AvocadoColors"]];
 In[5]:= Xg2 = Graphics[ ChartElementData["SmoothDensity", "Shape" -> "SingleSided", "ColorScheme" -> "DeepSeaColors"][{{0, 1}, {0, 1}}, close], AspectRatio -> Full, PlotRangePadding -> None];
 In[6]:= Xg3 = DistributionChart[close, ChartElementFunction -> "Density", BarSpacing -> 0, Frame -> False, PlotRangePadding -> None, ChartBaseStyle -> Directive[EdgeForm[], Opacity[0.7]], ChartStyle -> ColorData[1][9], AspectRatio -> Full];
 In[7]:= Xg4 = DistributionChart[close, ChartElementFunction -> "FadingQuantile", BarSpacing -> 0, Frame -> False, PlotRangePadding -> None, ChartBaseStyle -> Directive[EdgeForm[], Opacity[0.5]], ChartStyle -> ColorData[14][6], AspectRatio -> Full];
 In[8]:= XGrid[{{Show[{Graphics[Inset[g2, {0.5, 24}, {0.5, 24}, Length[close]]], CandlestickChart[data]}, AspectRatio -> 1, ImageSize -> 250, PlotRange -> {{0.5, Length[close] + 0.5}, {Min[data[[All, 2, 3]]], Max[data[[All, 2, 2]]]} + {-0.15, 0.1} (Max[data[[All, 2, 2]]] - Min[data[[All, 2, 3]]])}, Axes -> False, PlotLabel -> Style["Stock Price Distribuion", 20], Frame -> {Left, Top, Right}, BaseStyle -> {FontFamily -> "Helvetica"}], Show[{Graphics[Inset[g3, {0.5, 24}, {0, 24}, Length[close]]], CandlestickChart[data]}, AspectRatio -> 1, ImageSize -> 250, PlotRange -> {{0.5, Length[close] + 0.5}, {Min[data[[All, 2, 3]]], Max[data[[All, 2, 2]]]} + {-0.15, 0.1} (Max[data[[All, 2, 2]]] - Min[data[[All, 2, 3]]])}, Axes -> False, PlotLabel -> Style["Stock Price Density", 20], Frame -> {Left, Top, Right}, BaseStyle -> {FontFamily -> "Helvetica"}]}, {Show[{Graphics[ Inset[g4, {0.5, 24}, {0, 24}, {Length[close], l}]], CandlestickChart[data]}, AspectRatio -> 1, ImageSize -> 250, PlotRange -> {{0.5, Length[close] + 0.5}, {Min[data[[All, 2, 3]]], Max[data[[All, 2, 2]]]} + {-0.15, 0.1} (Max[data[[All, 2, 2]]] - Min[data[[All, 2, 3]]])}, Axes -> False, PlotLabel -> Style["Stock Price Quantile", 20], Frame -> {Left, Top, Right}, BaseStyle -> {FontFamily -> "Helvetica"}], Show[{Graphics[Inset[g, {0.5, 24}, {0, 24}, {Length[close], l}]], CandlestickChart[data]}, AspectRatio -> 1, ImageSize -> 250, PlotRange -> {{0.5, Length[close] + 0.5}, {Min[data[[All, 2, 3]]], Max[data[[All, 2, 2]]]} + {-0.15, 0.1} (Max[data[[All, 2, 2]]] - Min[data[[All, 2, 3]]])}, Axes -> False, PlotLabel -> Style["Stock Price Histogram", 20], Frame -> {Left, Top, Right}, BaseStyle -> {FontFamily -> "Helvetica"}]}}]
 Out[8]=