New answers tagged

3

The same issue arises when we use CalloutMarker -> Arrowheads[Medium] or CalloutMarker -> Arrowheads[.02] in combination with Manipulate andImageSize -> Full. A simple fix is to use ImageSize -> Scaled[1] instead of ImageSize -> Full: Manipulate[Plot[Callout[x, "x", CalloutMarker -> "Arrow"], {x, 0, 1}, ImageSize ->...


10

Mathematica has written nice Documentation about shortening the output and its options. Summary In general change $OutputSizeLimit to increase the limit Mathematica shorten the output. For specific cases, use InputForm. but be aware in both cases you will have performance penalties.


8

SetOptions[Dataset, HeaderBackground -> Black, HeaderStyle -> White, ItemStyle -> Red]; ds = Dataset[{<|"a" -> 1, "b" -> 3|>, <|"a" -> 2, "b" -> 4|>}] ds[1] A cumbersome way to inject the options is to wrap dataset objects with Dataset[#, Options[Dataset]]&: {Dataset[#,Options[...


5

xy /: MakeBoxes[xy, _] := RowBox[{"(", "xy", ")"}] Δx /: MakeBoxes[Δx, _] := RowBox[{"(", "Δx", ")"}] Expand[(2 x + Δx)^2] Expand[(2 xy + Δx)^2] Solve[Δx + 2 a x == (a + Δx)^2, x]


7

You could modify the formatting rules for the variables: xy /: MakeBoxes[xy, StandardForm] := TagBox["xy", #&, SyntaxForm->"*"] Δx /: MakeBoxes[Δx, StandardForm] := TagBox["Δx", #&, SyntaxForm->"*"] Then: Expand[(2x+Δx)^2] Expand[(2xy+Δx)^2] Solve[Δx+2 a x==(a+Δx)^2,x] If you really want parentheses ...


5

According to Jason Harris's talk at Wolfram Technology Conference 2019, the way to do that is: MakeBoxes[line[ t_ , p : _List /; VectorQ @ Unevaluated @ p , u : _List /; VectorQ @ Unevaluated @ u ] , StandardForm] := With[ {argsp = Map[Function[{a}, MakeBoxes[a, StandardForm], HoldAll] , Unevaluated @ p, {1}] , argsu = Map[...


1

Does this function do what you want? line[t_, p_, u_] := CellPrint[ Cell[ BoxData[ RowBox[ {StyleBox[ RowBox[{"(", GridBox[ ...


0

You can use the option DataRange to specify the years. {minYr, maxYr} = MinMax[years]; Manipulate[ ListPlot[cfcEmissions, Joined -> True, DataRange -> {minYr, maxYr}, PlotLabel -> "CfC Emissions [tonnes per year]", Frame -> {True, True, False, False}, FrameLabel -> {"year", "CfC Emissions per year [tonnes]&...


1

I suggest using ListPlot with x,y coordinates for each datapoint. Therefore Thread[] the two data lists (years and cfcEmissions). Then simply adjust the FrameTicks to your wishes. For example, displaying every 5th year. I started the Y axis in 1960, but you may start at 1961. I think 1960 is just better looking. ListPlot[Thread[{years, cfcEmissions}], ...


2

You can rotate the the dates so they don't overlap. ListPlot[cfcEmissions, Joined -> True, PlotRange -> MinMax[cfcEmissions], GridLines -> {Select[Range[54], Mod[years[[#]], 5] == 0 &], Range[300000, 2000000, 100000]}, PlotLabel -> "CfC Emissione [tonnes per year]", Frame -> {True, True, False, False}, FrameLabel ...


0

Why CSV? Why not mx? Export["tab.mx", tab] tabImport = Import["tab.mx"]; InputForm@tab == InputForm@tabImport (* True *)


3

Export uses CForm under the hood for formatting of real numbers: TracePrint[ExportString[.2`40, "CSV"], _ToString, TraceAction->Print@*FullForm] HoldForm[ToString[CForm[0.2`40.],InputForm]] "0.2" So, one idea is to temporarily modify the CForm formatting of reals: Internal`InheritedBlock[{CForm}, Unprotect[CForm]; CForm /: ...


3

I usually discourage the use of StandardForm strings, but this is a case where it makes sense, since usage messages have to be strings. The key is to format the string as a text cell using TextCell, since these strings line-break as text. Using a simple string instead formats as an expression. So: test::usage = ToString[ TextCell["...


3

I faced the same problem when writing my own package (a general relativity toolkit for Mathematica). I solved it, sort of, by using the following module to define usage messages: CreateUsageMessage[f_, args_List, msg_String, additional_List : {}] := ( Evaluate[f::usage] = StringReplace["\!\(\*RowBox[{\"" <> ToString[f] <> "...


2

PrintPrecision is used for display in a notebook, and the conversion to TeX is happening outside the notebook. It may not be possible to use it to control the conversion to TeX. For instance, the box form in a notebook contains the full form of real numbers, even though only usually six digits are displayed. Setting the Precision of a number will control ...


Top 50 recent answers are included