Hot answers tagged

6

All Graphics options work in Graph. You can use PlotLabel or add a Text primitive to the Epilog. label = Style["\!\(\*SubscriptBox[\(K\), \(4\)]\)", 16] CompleteGraph[4, PlotLabel -> label] CompleteGraph[4, Epilog -> Text[label, Scaled[{0.8, 0.8}]]] You could also use Labeled.


6

Table[Plot[{Re[ReleaseHold@f] /. j -> 3, Im[ReleaseHold@f] /. j -> 3}, {n, 0, 15}, GridLines -> Automatic, PlotRange -> All, ImageSize -> 350, PlotLegends -> {"Real", "Imaginary"}, PlotLabel -> f], {f, {HoldForm@Sum[Sinc[Pi*(n - i*j)], {i, 1, Floor[n]}], HoldForm[(-1 + E^(2*I*Pi*n))/(j*(-1 + E^((2*I*...


5

You can also use PromptForm + the optionPlotLabels as follows: f[x_] := ((1 + x^2) b)/2 Plot[Evaluate[Table[f[x], {b, blist}]], {x, 0, 1}, PlotLabels -> (PromptForm["b", NumberForm[#, {5,2}]] & /@ blist)] Note: Unfortunately, PromptForm is not documented. Information @ PromptForm Some examples: Column[PromptForm[lefthandside, #] & /@...


4

Edit p1 = {0, 0, 0}; p2 = {0, 1, 0}; label = Rotate[Text[Style["DUMA", 100]], π/2]; vtc = {{0, 0}, {1, 0}, {1, 1}, {0, 1}}; center = Mean[{p1, p2}]; dir = .1 Normalize[p2 - p1]; normal = {1, 1, 1}; conormal = .05 Normalize@Cross[dir, normal]; frame = {conormal, dir}; coords = {{center + {-1, -1} . frame, center + {1, -1} . frame, center + ...


4

If you want to place the label at the top you can use the option PlotLabel: Graph[completegraph4, PlotLabel -> Style["K_4", 16]] Or wrap the graph object with Labeled: Labeled[completegraph4, Style["K_4", 16], Top] Labeled[completegraph4, Style["K_4", 16], Right] To get a finer control on label position you can use Legended + Placed: Legended[...


4

Notice how much simpler the code can be if you were use the BaseStyle option to set the font size. Also, notice that the code below does not show the spacing problem you are experience. I am running V11.3.0 on MacOS 10.13.4 (High Sierra). Manipulate[ Plot[{E^(-k t), E^(-k t) (-1 + E^(k t)) + 0.1}, {t, 0, 10}, BaseStyle -> {FontSize -> 16}, ...


3

You can have finer control on positioning if you use Legended in stead of Labeled: Legended[DensityPlot[x^2 + y^2, {x, -1, 1}, {y, -1, 1}, PlotLegends -> BarLegend[{Automatic, {0, 2}}]], {Placed["a", Bottom], Placed["b", {{.85, 1.02}}]}]


3

Why not include the labels using FrameLabel? Including the option in the BarChart function causes the funky ticks to disappear, so you can do this afterwards using Show: g = Show[ BarChart[ Transpose@dat, ChartStyle->{Orange,Black}, BarSpacing->{0,1}, ChartLabels->{Placed[n,Above,Style[#,FontSize->8]&],...


2

Your command works in Mathematica 12.0. If it does not work in an older version, you can try Plot[Labeled[x, Style["G", Bold], .3], {x, 0, 1}]


2

You could use Show to combined graphics, including text. Positions can be specified with scaled coordinates (relative to the plot): Show[ DensityPlot[x^2 + y^2, {x, -1, 1}, {y, -1, 1}, PlotLegends -> BarLegend[{Automatic, {0, 2}}]], Graphics[{ Text[Style["b", Medium], Scaled[{.75, 1.05}]], Text[Style["a", Medium], Scaled[{.5, -.08}]] }], ...


2

You can wrap your label inside Pane and specify FrameMargins for it. Manipulate[ Plot[ {E^(-k t), E^(-k t) (-1 + E^(k t)) + 0.1}, {t, 0, 10} , PlotStyle -> {Red, Blue} , PlotLabels -> {Style["u[t]", 16], Style["x(t)", 16]} , AxesLabel -> {Style["t", Bold, 16], Pane[Style["x(t),u(t)", Bold, 16], FrameMargins -> {{0, 0}, {20, 0}...


2

f[x_] := ((1 + x^2) b)/2 Plot[Evaluate[ Table[Labeled[f[x], "b=" <> ToString@NumberForm[b, {6, 2}]], {b, {0.25, 0.50, 0.75, 1.00}}]], {x, 0, 1}] I would also encourage you to take a look at Callout.


2

Based upon my tests and the comments to the original question, it appears that this problem does not occur in Mathematica 12.2. The recommended solution is therefore to upgrade.


2

SeedRandom[1] points = RandomPoint[Circle[{0, 0}, {2, 3}], 10]; centroid = RegionCentroid@BoundingRegion[points, "FastDisk"]; labels1 = IntegerName /@ Range[Length@points]; labels2 = IntegerName[#, "French"] & /@ Range[Length@points]; gap = .2; labeleddata = Table[MapThread[Callout[#, #2, # + i[[1]] gap Normalize[# - centroid], ...


2

You can nest Labeled and Callout individually or together. They can be individually positioned. ListPlot[{Callout[Labeled[{1, 2}, "Label 1", Above], "Label 2", Below, Appearance -> None], Labeled[Callout[{2, 1}, "Label 1", Above, Appearance -> None], "Label 2", Below], Labeled[Labeled[{.5, .5}, "...


1

Instead of Labeled, use Text Clear["Global`*"]; eqns = {(1 - x)/2, -2 - 3 x}; pt = {x, eqns[[1]]} /. Solve[Equal @@ eqns, x, Reals][[1]] (* {-1, 1} *) plot = Plot[eqns, {x, -3, 1}, PlotRange -> {-1, 3}, PlotStyle -> Thick, PlotLabels -> {y == (1 - x)/2, y == -2 - 3 x}, AxesLabel -> {x, y}, ImageSize -> {Automatic, 200}];...


1

This repeats your image with the option Frame->True: Plot[-x^2 - 4, {x, 0, 5}, ImageSize -> 500, AxesOrigin -> {0, 0}, Frame -> True, FrameLabel -> {{Style["Top of T Sliced Off", 16, Black], None}, {None, Style["X-Axis", 16, Black]}}, AxesOrigin -> {0, 0}, FrameStyle -> {{Black, White}, {White, Black}}, FrameTicks ->...


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