New answers tagged

1

ClearAll[addBlobs] addBlobs[g_Graph, s_: .1, opacity_: .5] := {Opacity @ opacity, #, MeshPrimitives[BoundingRegion[MeshCoordinates[ DiscretizeRegion[RegionUnion @@ (If[s > 0, Circle[#, s] &, Point] /@ (PropertyValue[{g, #}, VertexCoordinates] & /@ #2))]], "MinConvexPolygon"], 2]} & @@@ # &; ...


1

While I don't quite understand how you want to decide what to fill out, here's a function that can fill in cycles that you specify manually. This solves the styling issue only, not the issue of selecting cycles to fill. g = Graph[{1 \[UndirectedEdge] 2, 2 \[UndirectedEdge] 3, 3 \[UndirectedEdge] 4, 4 \[UndirectedEdge] 1, 1 \[UndirectedEdge] 3, 2 \[...


4

labelFontSize = 24; ticksFontSize = 16; SeedRandom[1] Module[{values}, values = RandomReal[{0, 1000}, {7, 3}]; BarChart[Map[Labeled[#, Row[{#, "%"}], Center] &, Round[100 Normalize[#, Total]] & /@ values, {-1}], ChartLayout -> "Percentile", ChartLegends -> Placed[SwatchLegend[Automatic, {"Crew ...


2

You are looking for Convert`TeX`ExpressionToTeX.


3

For lengthy labels, FrameLabel generally works better. You may also want to consider "Log" scaling. allData = {{{1, 0.00016}, {2, 0.00006}, {4, 8.^-6}, {8, 7.*^-6}, {16, 7.^-6}, {32, 7.*^-6}, {64, 6.^-6}, {128, 7.*^-6}, {256, 7.^-6}, {512, 7.*^-6}, {1024, 8.^-6}, {2048, 0.00001}, {4096, 0.000015}, {8192, 0.000019}, {16384, 0.00003}...


0

A bit too long for comment. The multiple output was due to multiple append of stream after each evaluation. I added the line If[Length[\$Output] === 1, AppendTo[$Output, strm]]; which checks if the stream was already added to the \$Output. Now it should work as expected. Copy the content into notebook and SAVE it to disk (otherwise the code will not work, ...


5

HoldForm @@ {Factor[x^105 - 1]} /. k_ x_^n_ :> RuleCondition[With[{b = Style[Abs[k], Red]}, If[Internal`SyntacticNegativeQ[k], -1, 1] HoldForm[b x^n]], Abs[k] > 1] Use Highlighted[Abs[k]] instead of Style[Abs[k], Red] to get See also: Replacement inside held expression Update: Displaying in TraditionalForm: HoldForm @@ (TraditionalForm /@ {...


4

You can use TemplateBox to control how derivatives are copy/pasted: MakeBoxes[Derivative[n_Integer?(Between[{1,4}])][f_], StandardForm] := With[ {p=StringRepeat["\[Prime]",n], q=StringRepeat["'",n]}, TemplateBox[ {MakeBoxes[f]}, "Derivative1", DisplayFunction->(SuperscriptBox[#1, p, ...


3

One approach is to override Derivative box formatting and use Copy As -> Plain Text MakeBoxes[Derivative[n_Integer][f_], form_] := RowBox[{ToBoxes@f, StringRepeat["'", n]}]


0

I found the answer to my question in the source code of several Mathematica core functions. Using the immensely helpful function GeneralUtilities`PrintDefinitions on e.g. InterpolatingFunction (or any other core function using BoxForm` ArrangeSummaryBox for its formatted output) reveals the protected kernel function/variable BoxForm`UseIcons. This seems to ...


3

Following the comments under m_goldberg Answer to this question (https://mathematica.stackexchange.com/a/227859) the following code disables the SummaryBox for Polygon only without disabling all elided forms or modifying the protected symbol BoxForm`UseIcons: ClearAll[Region`PolygonDump`summaryBox] Region`PolygonDump`summaryBox[poly_, format_] := ToBoxes[...


2

You can change the stylesheet of the notebook to style all output cells accordingly: You can find several questions on how to permanently install such stylesheets or how to programmatically change it in the official documentation and on this site, for example here and here.


2

You can use $PrePrint to add the option TextAlignment -> Center to all output cells in the current session: $PrePrint = Style[#, "Output", TextAlignment -> Center] &; To restore $PrePrint to the default value use $PrePrint =. If the notebook contains output cells created before $PrePrint is invoked, you can use Scan[SetOptions[#, ...


Top 50 recent answers are included