New in Wolfram
Mathematica
8: Financial Visualization
◄
previous
|
next
►
Graphics & Visualization
Combine Charts to Create New Presentations
Combine
BubbleChart
and
DateListPlot
to create an unconventional presentation of data.
In[1]:=
X
data = FinancialData["MSFT", "OHLCV", {{2010, 7, 15}, {2010, 8, 20}}]; date = AbsoluteTime /@ data[[All, 1]]; close = data[[All, 2, 4]]; volume = data[[All, 2, 5]];
In[2]:=
X
bubble[colorf_] := BubbleChart[Transpose[{date, close, volume}], AspectRatio -> 1, PerformanceGoal -> "Speed", ColorFunction -> colorf, ChartBaseStyle -> Directive[Opacity[0.8], EdgeForm[Gray]], LabelingFunction -> Tooltip, BubbleSizes -> {0.05, 0.15}];
In[3]:=
X
Labeled[Grid[ Partition[ Table[DateListPlot[Transpose[{date, close}], Joined -> True, Prolog -> First[bubble[colorf]], ImageSize -> 250, AspectRatio -> 1, PlotRangePadding -> Scaled[0.05], BaseStyle -> {FontFamily -> "Helvetica"}], {colorf, {(ColorData["DeepSeaColors"][ 1 - #3] &), (ColorData["BrightBands"][#1] &), (ColorData[ "AvocadoColors"][#3] &), (ColorData[ "AuroraColors"][#2] &)}}], 2]], Style["Stock Price with Volume Bubbles", 20, FontFamily -> "Helvetica"], Top]
Out[3]=