Tag Info

Hot answers tagged

9

percent = {21.15, 42.3, 57.68, 73.06, 84.6, 90.37, 96.14, 99.99, 99.99, 99.99, 99.99}; {{"A", "B", "C"}, GatherBy[percent, {# <= 85, # <= 95, # <= 100} &]} // TableForm This can also be written as {{"A", "B", "C"}, GatherBy[percent, Thread[# <= {85, 95, 100}] &]} // TableForm


8

There are two alternatives I would suggest, depending on what your plans for the Background are. Here is an illustration: Text[Pane[Style["(1, 0, 0)", 12, Background -> Yellow], ImageMargins -> 10], {1, 1, 0}] Text[Framed[Style["(1, 0, 0)", 12], Background -> Yellow, FrameMargins -> 10, FrameStyle -> None], {1, 1, 0}] The first ...


8

Depending on how you want the table aligned, you could use percent = {21.15, 42.3, 57.68, 73.06, 84.6, 90.37, 96.14, 99.99, 99.99, 99.99, 99.99}; TableForm[BinLists[percent, {{0., 85., 95., 100.}}], TableHeadings -> {{"A", "B", "C"}}] or TableForm[{{"A", "B", "C"}, BinLists[percent, {{0., 85., 95., 100.}}]}, TableAlignments -> {Center, ...


5

This is one possibility: Plot[Sin[x], {x, 0, 2 \[Pi]}, Epilog -> {Inset[ Style["w=\!\(\*FractionBox[\(10\), \(\[Pi]\)]\)", 12], Scaled[{0.552, 0.825}]], Inset[Graphics[{Red, Arrowheads[0.05], Arrow[{Scaled[{0.552, 0.825}], Scaled[{0.455, 0.7}]}], Red, PointSize[0.03], Point[Scaled[{0.441, 0.68`}]]}]]}] This is another: ...


5

Plot[Sin@x, {x, 0, 2 Pi}, Epilog -> {Text["w = " <> ToString@StandardForm[10/Pi], Scaled[{.3, .8}]]}]


4

You will really need to roll your own color bar, which isn't too difficult. Here is an example of making a highly customized color bar. With[{n = 24}, Graphics[ Table[{Hue[i/n], Translate[Rectangle[{0, 0}, {1, 1}], {i, 0}]}, {i, 0, n - 1}], ImageSize -> 550, PlotRangePadding -> None, AspectRatio -> 3/n, Frame -> True, FrameTicks ...


4

Although I strongly suggest you just create and use your own formatting function if possible, e.g. form[Red], the question of modifying the internal behavior is interesting. You can either turn off the automatic color directive formatting and define your own MakeBoxes rules on e.g. RGBColor to take its place, or you can modify the internal function used to ...


4

You can try using Format along with Inactive First, need to Unprotect NonCommutativeMultiply: Unprotect[NonCommutativeMultiply]; Format[NonCommutativeMultiply[x__], TraditionalForm] := Inactive[Times][x] This will look like: NonCommutativeMultiply[a, c + d, c] // TraditionalForm $a*(c+d)*c$ which is not quite right yet. For the finishing touches we ...


4

Here is a function that does what you want, I think: trimPoint[n_, digits_] := (*display number n with given number of sig.digits, trim trailing decimal point*) NumberForm[n, digits, NumberFormat -> (DisplayForm@ RowBox[Join[{StringTrim[#1, RegularExpression["\\.$"]]}, If[#3 != "", {"\[Times]", SuperscriptBox[#2, #3]}, {}]]] &)] ...


2

You could let FindDivisions do the work: scale = (9.11/10^31) FrameTicks -> {{1, 2, 3}, ( # { scale , 1}) & /@ FindDivisions[{-2*10^-28 /scale, -2*10^-32 /scale}, 8], None, None} FrameTicks -> {{1, 2, 3}, {{-2.2775*10^-28, -250}, {-1.822*10^-28, -200}, {-1.3665*10^-28, -150}, {-9.11*10^-29, -100}, {-4.555*10^-29, -50}, {0., ...


2

I suppose you want to add your ABC category as a separate column to a Table and highlight values. Here is a minimal example which does this: relativeAnteile = Range[80, 100]; abcZuordnung = Table[If[# <= 85, A, If[# <= 95, B, If[# <= 100, C]]]&[relativeAnteile[[i]]], {i, Length[relativeAnteile]}]; TableForm[{{"RelativeAnteile", ...


2

Since V6, the simplest way to produce formatted output almost anywhere is with Row, often with the aid of Style. In this case, I think only Row is needed. With[{w = 1/π}, Plot[x, {x, 0, 1}, Epilog -> {Text[Row[{"w = ", w}], Scaled[{.3, .8}]]}]]


2

You may try with this list of rules, in this order since your transformations are overlapping: rules = { Power[Subscript[X_,Subscript[a_,j_]], n_] :> Power[Subscript[\[Sigma],Subscript[a,j]], n]+ Power[Subscript[\[Mu],Subscript[a,j]], n], Times[rest1___, Subscript[X_,Subscript[a_,j_]], ...


2

Don't monkey with adding definitions to Power. Try something like StringReplace[ToString[1+ 3 c+ a^b, FortranForm], "**" -> "^"] "1 + a^b + 3*c"


1

If you are striving for consistency and are happy with Mathematica's formatting, Plot[Sin@x, {x, 0, 2 Pi}, Epilog -> {Text[Unevaluated[w = 10/Pi], Scaled[{.3, .8}]]}] works well, too, without the need for explicit conversion to strings or string concatenation.


1

One can use Block to prevent Plus from evaluating until after result is defined. SortedMonomials = {-3 y, 2 y^2, -3 x, 3 x y, x^2}; Block[{Plus}, result = Plus @@ SortedMonomials; ] Save["/tmp/foo.txt", result] FilePrint["/tmp/foo.txt"] result = -3*y + 2*y^2 - 3*x + 3*x*y + x^2


1

You can use the Text graphics primitive to place a ScientificForm expression anywhere in a graphics pane without resorting to string conversion. For example, Graphics[{ Circle[], Text[Style[ScientificForm[N[Pi 1*^10], 8], 14, Bold, Red], Scaled @ {.5, .9}]}] produces I didn't bother to introduce Epilog here, but Text expression like this one are ...



Only top voted, non community-wiki answers of a minimum length are eligible