Tag Info

Hot answers tagged

7

PlusMinus[{x_, err_}] := Module[{errE = Last@MantissaExponent[err], xE = Last@MantissaExponent[x]}, Row[{"(", NumberForm[N@Round[x, 10^(errE - 1)]*10^(-xE + 1), {xE - errE + 1, xE - errE}], " \[PlusMinus] ", NumberForm[N@Round[err, 10^(errE - 1)]*10^(-xE + 1), {1, xE - errE}, ExponentFunction -> (Null &)], ")", " ...


6

V = (-G*Mn)/Sqrt[x^2 + y^2 + z^2 + cn^2]; Vx = D[V, x] /. {x -> x[1], y -> x[2], z -> x[3]}; StringReplace[ToString[Vx, FortranForm], " " -> ""]


5

Here is my take on this problem. errorForm[num_, err_, digits_] := Module[{exp, n, e}, exp = Floor @ Log10 @ num; n = NumberForm[num/10^exp, digits, ExponentFunction -> (Null &)]; e = NumberForm[err/10^exp, digits, ExponentFunction -> (Null &)]; Row[{ "(", n, "\[ThinSpace]\[PlusMinus]\[ThinSpace]", e, ") ...


4

Likely some duplication with existing answers but I felt like playing with this one. I'll use Format so that the underlying representation does not change. a_ ± b_ ± c_ := PlusMinus[a, b, c]; Format[b_?NumericQ ± err_?NumericQ ± acc_Integer: 6] ^:= Row[{ "(", NumberForm[Row[{b, err}*10^-#, "±"], {acc, acc}, ExponentFunction -> (Null ...


2

This method is based on Mr. Wizard's answer (updated for V10) to About the number format in ticks, which I discovered investigating another question, Change only tick labels while keeping default ticks, that in meantime was marked as a duplicate of this one. Since the method presented in the accepted answer by FDSg no longer works (currently the only other ...


1

This seems to be close to what is wanted. a1 = 0.02112398; a2 = 0.000331; f[z1_, z2_] := Module[{t, ee = Floor[Log10[Abs[z1]]]}, t = NumberForm[z1 10^-ee, 3] ± NumberForm[z2 10^-ee, 3 + ee, ExponentFunction -> (Null &)]; t RawBoxes[SuperscriptBox[10, ee]]] f[a1, a2] $$ (2.11 \pm 0.03) 10^{-2} $$


1

The issue, as I understand it, is to display a graphic with its ImageSize proportional to its "real" size. So, in an ideal world one would use something like plt=Graphics[ ... ]; plt=Show[plt, ImageSize -> AbsoluteOptions[plt, RealSize][[1,2]]/scalefactor] The problems are, there may be no Option equivalent to RealSize and, if there is, ...


1

Your problem arises from another Graphics option,PlotRange, having the default value Automatic, which gives each Graphics object its own plot range. To get what you want you will need to force each Graphics object to have the same plot range. Here is something that works for your example. I have made it a little more general than needed because I think you ...



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