# Tag Info

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"

0

Here's a completely different take (from my other answer, which I think justifies a separate answer) that somewhat automates the idea of using HoldForm on the variables. It works as long as you name the variables consistently. It's still not perfect, since, you need to make the List of replacements, but once that's done, you don't need to do the cumbersome ...

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

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

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

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

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

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.

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

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", ...

0

It seems needlessly complex to write If[Boole[IntegerQ[x/10000]] == 0, N[x/10000], IntegerPart[x/10000] when If[IntegerQ[x/10000], IntegerPart[x/10000], N[x/10000] ] would do. (Notice that the arguments are reversed because you are now checking if IntegerQ is true, not false.) I do not have the customticks package, but I suspect your problem is that ...

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

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

Top 50 recent answers are included