Style dynamic value
Can I a开发者_JS百科pply Style to the output of "Labeled" in the below ?
Manipulate[\[Lambda],
Control@{{\[Lambda], 401,
Style[" \[Lambda]", Black, Bold, 24]},
Range[401, 570, 1],
ControlType -> Slider,
ControlPlacement -> Bottom,
Appearance -> "Labeled",
ImageSize -> 200}]
That is on the right part of the Slider :
You want the option BaseStyle
(which appears in Options[Slider]
). E.g.
Manipulate[
Plot[Cos[k x], {x, 0, 2 Pi}, PlotLabel -> "Cosine"],
{{k, 1, Style["x", Black, Bold, 24]}, 0, 4,
ControlType -> Slider, Appearance -> "Labeled",
ControlPlacement -> Bottom, ImageSize -> 200,
BaseStyle -> {Red, Large, Italic, FontFamily -> "Times"}}]
When looking at this I noticed that you can also use the almost undocumented ControlType -> LabeledSlider
, just for something different.
It seems to be at least partially affected by LabelStyle
and BaseStyle
. (I'm having trouble changing the font, for some reason, but size, weight, color seem to work fine.)
精彩评论