« View all new features in
Mathematica
9
◄
previous
|
next
►
New in
Mathematica
9
›
Gauges
Gauges with Units
Gauges automatically interpret units in the input.
In[1]:=
X
HorizontalGauge[\!\(\* NamespaceBox["LinguisticAssistant", DynamicModuleBox[{WolframAlphaClient`Private`query$$ = "5ft", WolframAlphaClient`Private`boxes$$ = TemplateBox[{"5"}, "QuantityUnit", DisplayFunction -> (TooltipBox[ StyleBox[ RowBox[{#, StyleBox["\"ft\"", "QuantityUnitTraditionalLabel"]}], ShowStringCharacters -> False], "Unit: feet"]& ), InterpretationFunction -> (RowBox[{"Quantity", "[", RowBox[{#, ",", "\"Feet\""}], "]"}]& ), SyntaxForm -> Mod], WolframAlphaClient`Private`allassumptions$$ = {}, WolframAlphaClient`Private`assumptions$$ = {}, WolframAlphaClient`Private`open$$ = {1, 2}}, DynamicBox[ToBoxes[ AlphaIntegration`LinguisticAssistantBoxes["", 1, Dynamic[WolframAlphaClient`Private`query$$], Dynamic[WolframAlphaClient`Private`boxes$$], Dynamic[WolframAlphaClient`Private`allassumptions$$], Dynamic[WolframAlphaClient`Private`assumptions$$], Dynamic[WolframAlphaClient`Private`open$$]], StandardForm], ImageSizeCache->{66., {26., 31.}}], DynamicModuleValues:>{}], BaseStyle->{Deployed -> True}, DeleteWithContents->True, Editable->False, SelectWithContents->True]\), \!\(\* NamespaceBox["LinguisticAssistant", DynamicModuleBox[{WolframAlphaClient`Private`query$$ = "{0m,2m}", WolframAlphaClient`Private`boxes$$ = RowBox[{"{", RowBox[{ TemplateBox[{"0"}, "QuantityUnit", DisplayFunction -> (TooltipBox[ StyleBox[ RowBox[{#, StyleBox["\"m\"", "QuantityUnitTraditionalLabel"]}], ShowStringCharacters -> False], "Unit: meters"]& ), InterpretationFunction -> (RowBox[{"Quantity", "[", RowBox[{#, ",", "\"Meters\""}], "]"}]& ), SyntaxForm -> Mod], ",", " ", TemplateBox[{"2"}, "QuantityUnit", DisplayFunction -> (TooltipBox[ StyleBox[ RowBox[{#, StyleBox["\"m\"", "QuantityUnitTraditionalLabel"]}], ShowStringCharacters -> False], "Unit: meters"]& ), InterpretationFunction -> (RowBox[{"Quantity", "[", RowBox[{#, ",", "\"Meters\""}], "]"}]& ), SyntaxForm -> Mod]}], "}"}], WolframAlphaClient`Private`allassumptions$$ = {{ "type" -> "Clash", "word" -> "m", "template" -> "Assuming \"${word}\" is ${desc1}. Use as \ ${desc2} instead", "count" -> "2", "Values" -> {{ "name" -> "Unit", "desc" -> "a unit", "input" -> "*C.m-_*Unit-"}, { "name" -> "Variable", "desc" -> "a variable", "input" -> "*C.m-_*Variable-"}}}, { "type" -> "Unit", "word" -> "m", "template" -> "Assuming ${desc1} for \"${word}\". Use ${desc2} \ instead", "count" -> "3", "Values" -> {{ "name" -> "Meters", "desc" -> "meters", "input" -> "UnitClash_*m.*Meters--"}, { "name" -> "MinimsUS", "desc" -> "US minims of volume", "input" -> "UnitClash_*m.*MinimsUS--"}, { "name" -> "Minutes", "desc" -> "minutes of time", "input" -> "UnitClash_*m.*Minutes--"}}}}, WolframAlphaClient`Private`assumptions$$ = {}, WolframAlphaClient`Private`open$$ = {1, 2}}, DynamicBox[ToBoxes[ AlphaIntegration`LinguisticAssistantBoxes["", 1, Dynamic[WolframAlphaClient`Private`query$$], Dynamic[WolframAlphaClient`Private`boxes$$], Dynamic[WolframAlphaClient`Private`allassumptions$$], Dynamic[WolframAlphaClient`Private`assumptions$$], Dynamic[WolframAlphaClient`Private`open$$]], StandardForm], ImageSizeCache->{109., {26., 31.}}], DynamicModuleValues:>{}], BaseStyle->{Deployed -> True}, DeleteWithContents->True, Editable->False, SelectWithContents->True]\), GaugeLabels -> "Unit"]
Out[1]=
Specify the unit to use.
In[2]:=
X
HorizontalGauge[\!\(\* NamespaceBox["LinguisticAssistant", DynamicModuleBox[{WolframAlphaClient`Private`query$$ = "5ft", WolframAlphaClient`Private`boxes$$ = TemplateBox[{"5"}, "QuantityUnit", DisplayFunction -> (TooltipBox[ StyleBox[ RowBox[{#, StyleBox["\"ft\"", "QuantityUnitTraditionalLabel"]}], ShowStringCharacters -> False], "Unit: feet"]& ), InterpretationFunction -> (RowBox[{"Quantity", "[", RowBox[{#, ",", "\"Feet\""}], "]"}]& ), SyntaxForm -> Mod], WolframAlphaClient`Private`allassumptions$$ = {}, WolframAlphaClient`Private`assumptions$$ = {}, WolframAlphaClient`Private`open$$ = {1, 2}}, DynamicBox[ToBoxes[ AlphaIntegration`LinguisticAssistantBoxes["", 1, Dynamic[WolframAlphaClient`Private`query$$], Dynamic[WolframAlphaClient`Private`boxes$$], Dynamic[WolframAlphaClient`Private`allassumptions$$], Dynamic[WolframAlphaClient`Private`assumptions$$], Dynamic[WolframAlphaClient`Private`open$$]], StandardForm], ImageSizeCache->{66., {26., 31.}}], DynamicModuleValues:>{}], BaseStyle->{Deployed -> True}, DeleteWithContents->True, Editable->False, SelectWithContents->True]\), \!\(\* NamespaceBox["LinguisticAssistant", DynamicModuleBox[{WolframAlphaClient`Private`query$$ = "{0m,2m}", WolframAlphaClient`Private`boxes$$ = RowBox[{"{", RowBox[{ TemplateBox[{"0"}, "QuantityUnit", DisplayFunction -> (TooltipBox[ StyleBox[ RowBox[{#, StyleBox["\"m\"", "QuantityUnitTraditionalLabel"]}], ShowStringCharacters -> False], "Unit: meters"]& ), InterpretationFunction -> (RowBox[{"Quantity", "[", RowBox[{#, ",", "\"Meters\""}], "]"}]& ), SyntaxForm -> Mod], ",", " ", TemplateBox[{"2"}, "QuantityUnit", DisplayFunction -> (TooltipBox[ StyleBox[ RowBox[{#, StyleBox["\"m\"", "QuantityUnitTraditionalLabel"]}], ShowStringCharacters -> False], "Unit: meters"]& ), InterpretationFunction -> (RowBox[{"Quantity", "[", RowBox[{#, ",", "\"Meters\""}], "]"}]& ), SyntaxForm -> Mod]}], "}"}], WolframAlphaClient`Private`allassumptions$$ = {{ "type" -> "Clash", "word" -> "m", "template" -> "Assuming \"${word}\" is ${desc1}. Use as \ ${desc2} instead", "count" -> "2", "Values" -> {{ "name" -> "Unit", "desc" -> "a unit", "input" -> "*C.m-_*Unit-"}, { "name" -> "Variable", "desc" -> "a variable", "input" -> "*C.m-_*Variable-"}}}, { "type" -> "Unit", "word" -> "m", "template" -> "Assuming ${desc1} for \"${word}\". Use ${desc2} \ instead", "count" -> "3", "Values" -> {{ "name" -> "Meters", "desc" -> "meters", "input" -> "UnitClash_*m.*Meters--"}, { "name" -> "MinimsUS", "desc" -> "US minims of volume", "input" -> "UnitClash_*m.*MinimsUS--"}, { "name" -> "Minutes", "desc" -> "minutes of time", "input" -> "UnitClash_*m.*Minutes--"}}}}, WolframAlphaClient`Private`assumptions$$ = {}, WolframAlphaClient`Private`open$$ = {1, 2}}, DynamicBox[ToBoxes[ AlphaIntegration`LinguisticAssistantBoxes["", 1, Dynamic[WolframAlphaClient`Private`query$$], Dynamic[WolframAlphaClient`Private`boxes$$], Dynamic[WolframAlphaClient`Private`allassumptions$$], Dynamic[WolframAlphaClient`Private`assumptions$$], Dynamic[WolframAlphaClient`Private`open$$]], StandardForm], ImageSizeCache->{109., {26., 31.}}], DynamicModuleValues:>{}], BaseStyle->{Deployed -> True}, DeleteWithContents->True, Editable->False, SelectWithContents->True]\), GaugeLabels -> "Unit", TargetUnits -> "Inches"]
Out[2]=
Values are automatically interpreted in the same units as the range.
In[3]:=
X
AngularGauge[{2173, 981}, {0, \!\(\* NamespaceBox["LinguisticAssistant", DynamicModuleBox[{WolframAlphaClient`Private`query$$ = "3000 Mbps", WolframAlphaClient`Private`boxes$$ = TemplateBox[{"3000"}, "QuantityUnit", DisplayFunction -> (TooltipBox[ StyleBox[ RowBox[{#, StyleBox[ RowBox[{"\"Mb\"", " ", "\"/\"", " ", "\"s\""}], "QuantityUnitTraditionalLabel"]}], ShowStringCharacters -> False], "Unit: megabits per second"]& ), InterpretationFunction -> (RowBox[{"Quantity", "[", RowBox[{#, ",", FractionBox["\"Megabits\"", "\"Seconds\""]}], "]"}]& ), SyntaxForm -> Mod], WolframAlphaClient`Private`allassumptions$$ = {{ "type" -> "Unit", "word" -> "Mbps", "template" -> "Assuming ${desc1} for \"${word}\". Use \ ${desc2} instead", "count" -> "4", "Values" -> {{ "name" -> "MegabitsPerSecond", "desc" -> "megabits per second", "input" -> "UnitClash_*Mbps.*MegabitsPerSecond--"}, { "name" -> "MegabytesPerSecond", "desc" -> "megabytes per second", "input" -> "UnitClash_*Mbps.*MegabytesPerSecond--"}, { "name" -> "MebibytesPerSecond", "desc" -> "mebibytes per second", "input" -> "UnitClash_*Mbps.*MebibytesPerSecond--"}, { "name" -> "MebibitsPerSecond", "desc" -> "mebibits per second", "input" -> "UnitClash_*Mbps.*MebibitsPerSecond--"}}}}, WolframAlphaClient`Private`assumptions$$ = {}, WolframAlphaClient`Private`open$$ = {1, 2}}, DynamicBox[ToBoxes[ AlphaIntegration`LinguisticAssistantBoxes["", 1, Dynamic[WolframAlphaClient`Private`query$$], Dynamic[WolframAlphaClient`Private`boxes$$], Dynamic[WolframAlphaClient`Private`allassumptions$$], Dynamic[WolframAlphaClient`Private`assumptions$$], Dynamic[WolframAlphaClient`Private`open$$]], StandardForm], ImageSizeCache->{118., {26., 31.}}], DynamicModuleValues:>{}], BaseStyle->{Deployed -> True}, DeleteWithContents->True, Editable->False, SelectWithContents->True]\)}, GaugeLabels -> Full]
Out[3]=