New answers tagged

0

You can specify a Dynamic expression for the list of values for your control. Manipulate will then automatically wrap the entire control in Dynamic if necessary: list = {1, 2, 3}; Manipulate[ { If[addchoice != {}, AppendTo[list, Last[addchoice]]; addchoice = {}], list, addchoice }, { {addchoice, {}}, Dynamic@list, ControlType -> ...


5

Here is a crude progress bar demo script that has been tested in a Gnome terminal under Linux and a Powershell command prompt under Windows 10. Don't expect much because it's only a loop with a print statement: progbar[width_, title_] := Function[{ndx}, Print[ " " <> title<>"\n [" <> StringJoin@ConstantArray["*", ndx] &...


2

An alternative way to implement triangulation by diagonal lines: ClearAll[triangulate, flipDiagonalColors] triangulate[n_, pts_] := Graphics[GraphicsComplex[ CirclePoints[n], {FaceForm[], EdgeForm[Black], Polygon[Range[n]], Green, Line /@ pts}]] An alternative way to use FlipView to cycle over a list of colors: flipDiagonalColors[n_, pts_, colors_] := ...


1

ClearAll[triangulate, colors, rotateDiags] triangulate[n_, pts_] := Graphics[GraphicsComplex[CirclePoints[n], {FaceForm[], EdgeForm[Black], Polygon[Range[n]], Green, Line /@ pts}]] colors[n_, index_: 97] := ColorData[index] /@ Range[n] rotateDiags[n_, pts_, index_: 97] := Deploy[triangulate[n, pts] /. l_Line :> FlipView[{{Green, l}, ## &...


2

Graphics[ {EdgeForm[Red], FaceForm[None], Polygon[CirclePoints[6]], FlipView[ { {Green, Line[{CirclePoints[6][[1]], CirclePoints[6][[3]]}]}, {Blue, Line[{CirclePoints[6][[1]], CirclePoints[6][[3]]}]}}] }] Strong recommendation: provide the minimum example that illustrates your problem. Do you really need all that triangulation code? Of ...


3

Update: Use the option DefaultOptions in Slider to change the ImageSize of InputField: defaultoptions = {InputField -> {BaseStyle -> style, ImageSize -> {{30, 100}, 36}}}; Row[{Style["Frequency", style], Framed[Slider[Dynamic[f], {f1, f2}, Appearance -> {"Labeled", "DownArrow"}, ImageSize -> {5 72, 0.5 72}, ...


0

The Appearance -> "Labeled" seems to be inserting the space. Perhaps make the label yourself instead: style = FontSize -> 24; f1 = 0; f2 = 10; Row[{Style["Frequency ", style], Style[Slider[Dynamic[f], {f1, f2}], style], Style[Dynamic[" " ~~ ToString[f] ~~ " Hz"], style]} ]


Top 50 recent answers are included