« View all new features in
Mathematica
9
◄
previous
|
next
►
New in
Mathematica
9
›
Gauges
Gauge Faces
In[1]:=
X
fs = Texture /@ (ExampleData /@ ExampleData["ColorTexture"]);
In[2]:=
X
styles = AngularGauge[RandomInteger[{1, 100}], {0, 100}, GaugeStyle -> GrayLevel[0.2], GaugeFaceStyle -> #] & /@ Flatten[{None, Table[fs[[a]], {a, {11, 27}}], {Texture[ ExampleData[{"ColorTexture", "YellowMarble"}]], Texture[ImageCrop[ Graphics3D[{Sphere[]}, Lighting -> {{"Ambient", Hue[.6, 1, .5]}, {"Directional", Hue[.5, 1, .7], ImageScaled[{1, 1, 2}]}}, Boxed -> False]]], Texture[ ImageCrop[ Graphics3D[{Sphere[]}, Lighting -> {{"Ambient", Hue[.65, .5, .2]}, {"Directional", Hue[.8, .3, 1], ImageScaled[{.5, .5, 5}]}}, Boxed -> False]]]}}];
In[3]:=
X
function = Table[AngularGauge[RandomInteger[{1, 100}], {0, 100}, GaugeFaceElementFunction -> f, GaugeStyle -> GrayLevel[0.2], GaugeFaceStyle -> RandomChoice[ColorData[88, "ColorList"]], GaugeFrameStyle -> None], {f, ChartElementData["AngularGauge", "Face"][[{1, 2, 5, 6, 7, 8}]]}];
In[4]:=
X
Grid[Partition[Riffle[styles, function], 3]]
In[5]:=
X
vstyles = VerticalGauge[RandomInteger[{1, 100}], {0, 100}, GaugeStyle -> GrayLevel[0.2], GaugeFaceStyle -> #, TicksStyle -> Black] & /@ {None, Texture[ExampleData[{"ColorTexture", "YellowMarble"}]], Texture[ImageCrop[ Blur@Image[ Graphics[ Table[{Lighter[RGBColor[0.819715, 0.483345, 1], 3 i], Rectangle[{2 i, 4 i}, {1 - 2 i, 4 - 4 i}, RoundingRadius -> (1 - 4 i)/3]}, {i, 0, 0.2, 0.01}]]]]]};
In[6]:=
X
vfunction = Table[VerticalGauge[RandomInteger[{1, 100}], {0, 100}, GaugeFaceElementFunction -> f, GaugeStyle -> GrayLevel[0.2], GaugeFaceStyle -> RandomChoice[ColorData[92, "ColorList"]], GaugeFrameStyle -> None], {f, {"FadingRectangle", "GlassRectangle", "Rectangle"}}];
In[7]:=
X
Grid[{Riffle[vstyles, vfunction]}]
Specify a color or appearance for the gauge face.
Out[4]=
Out[7]=