Style dynamic value
Asked Answered
A

2

7

Can I apply 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 :

enter image description here

Arce answered 16/10, 2011 at 23:25 Comment(3)
You can use ControlType->LabeledSlider and drop the Appearance->"Labeled" part. This will give you a much more compact and neater box.Pyrite
But then the Number goes underneath for me.Arce
@500: If you set the ControlPlacement -> Bottom for the Manipulate as opposed the the individual controller, then it does not effect the position of the label in a LabeledSlider.Capriole
C
10

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"}}]

cosine

When looking at this I noticed that you can also use the almost undocumented ControlType -> LabeledSlider, just for something different.

Capriole answered 16/10, 2011 at 23:57 Comment(5)
Thank You Simon but it interfere with my plot labels. Is there a mean to avoid that ?Arce
@500: The DefaultBaseStyle has to be set for the control object - not the manipulate. See the edit.Capriole
Why would you want to use DefaultBaseStyle instead of BaseStyle (which seems to work fine as well)?Awake
@Sjoerd: No good reason - and now that you bring it up, BaseStyle is probably preferable.Capriole
@Sjoerd: I think maybe I chose DefaultBaseStyle because @Brett said he had trouble getting BaseStyle to work... Thanks for pointing out that BaseStyle works - I've edited my answer.Capriole
F
2

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.)

Fortification answered 16/10, 2011 at 23:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.