Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
32

Perhaps this? LogPlot[Abs[BesselJ[1, x] Sin[x]^2], {x, -10, 10}, Frame -> True, FrameTicks -> {{{#, Superscript[10, Log10@#]} & /@ ({10^0, 10^-1, 10^-2, 10^-3, 10^-4, 10^-5}), None}, {None, None}}] Here's a completely different approach, manipulating the existing tick labels in the generated graph, and preserving the unlabeled ticks. ...


28

You could turn the dimensioning into a handy function: ClearAll@dim; dim[{a_, b_}, label_String, d_] := Module[{n = Normalize[RotationTransform[π/2][b - a]], t = Arg[(b - a).{1, I}], r}, If[t > π/2, t -= π]; { Arrowheads[{-0.04, 0.04}], Arrow[{a + d n, b + d n}], Line[{a + 0.1 d n, a + d n}], Line[{b + 0.1 d n, b + d n}], ...


27

GraphicsRow takes a PlotLabel option: p1 = Plot[Sin[x], {x, 0, Pi}, PlotLabel -> Sin]; p2 = Plot[Cos[x], {x, 0, Pi}, PlotLabel -> Cos]; GraphicsRow[{p1, p2}, PlotLabel -> "Two plots"]


24

Plot[Sin[x] x, {x, -3, 3}, Frame -> {True, True, False, False}, FrameLabel -> {"E/T", None}, Axes -> False]


23

If you want the minor ticks too, you can use the following function: SetAttributes[dtZahl, Listable] dtZahl[x_] := Block[{n}, If[IntegerQ[n = Rationalize[x]], n, x]] exponentForm[x_?NumberQ] := Module[{me = MantissaExponent[x], num, exp}, If[MemberQ[{0, 0., 1, 1., -1, -1.}, x], Return[IntegerPart[x]]]; exp = Superscript["\[CenterDot]10", me[[2]] -...


19

Which is not too bad, but I do not want this vertical dividing line $x = 0$ and really would have preferred to keep the $y$-axis in the middle of the plot where this divider line now is. An easy way is to use Labeled with Plot since Plot keeps the y axis in the middle while Frame->True moves it to the left where you do not want it. Labeled[Plot[Sin[x] x,...


16

Maybe this helps: BarChart[#, BarOrigin -> Left, ChartLayout -> "Stacked", BarSpacing -> 0.5, ChartLabels -> {Placed[{{"A", "B", "C"}, {Total@#[[1]], Total@#[[2]], Total@#[[3]]}}, {Before, After}], None}, LabelingFunction -> (Placed[#1, Center] &)] &@{{1, 2, 3}, {2, 4, 1}, {3, 1, 1}} EDIT: slightly cleaner: BarChart[#, ...


15

What you are looking for can be achieved by wrapping the labels in HoldForm, or if you prefer, HoldForm@InputForm. For example, here is a plot that combines both labeling issues you mentioned: f = x^2; Plot[f, {x, -2, 2}, AxesLabel -> {x, HoldForm[InputForm[E = f]]}] The two issues you mention are indeed separate: To get f instead of $x^2$ you should ...


15

Update 2: Dealing with the issue raised by @Kuba in the comments: Using the function LineScaledCoordinate from the GraphUtilities package to place the text labels: Needs["GraphUtilities`"] labels ={"A", "B", "C", "D", "E", "F"}; i = 1; Graph[{a -> b, a -> b, a -> b, a -> b, a -> e, e -> b}, EdgeShapeFunction -> ({Text[labels[[i++]],...


15

Manipulate[u, {u, 0, 1}, FrameLabel -> "FrameLabel"] or Manipulate[u, {u, 0, 1}, FrameLabel -> {{"FrameLabel 1", "FrameLabel 2"}, {"FrameLabel 3", "FrameLabel 4"}}] or Labeled[Manipulate[u, {u, 0, 1}], "Label"] or Manipulate[u, Style["Label", 12, Bold], {u, 0, 1}] or Panel[Manipulate[ Panel[u, "Label 1", FrameMargins -> ...


13

opts = {ImageSize -> 500, PlotRange -> {{-5, 15}, All}, PlotPoints -> 84, MaxRecursion -> 9, MeshFunctions -> {Cos[#1] - (1/2)^#1 &}, Mesh -> {{0}}, MeshStyle -> {Directive[Red, PointSize[Large]]}}; You may be interested in the fact that Mesh solution is good for visulatisation purposes but it seems that coordinates ...


13

Based on the comment by Szabolcs I came up with a solution. Here it is xyText[str_, scaling_: 1, offset_: {0, 0, 0}] := Module[{ mesh = DiscretizeGraphics[ Text[Style[str, FontFamily -> "Monospac821 BT"]], _Text, MaxCellMeasure -> 1] }, MeshPrimitives[mesh, 2] /. {x_?NumberQ, y_?NumberQ} :> (scaling {x, y, 0} + offset) ...


13

Update: Using Kuba's nested Callout approach is more robust than the jittering approach in my original answer. The function processCallouts below replaces repeated Callouts with nested Callouts with appropriate position parameters: ClearAll[processCallouts] processCallouts[ls_ : 20, ns_ : 20, off_ : 5, o: OptionsPattern[Callout]] := Flatten @ Replace[...


12

This is a minor bug, acknowledged by WRI and present as of v10.4. The problem is that for Plot3D the required syntax for AxesLabel is a list with three entries instead of two. When given a two-member list as an argument, though, Plot3D silently interprets that as the AxesLabel→Automatic setting, and it labels the axes with the internal variables of the plot, ...


12

Here is my attempt: rectangles = Graphics[{GrayLevel[.4, .3], Rectangle[{0, 80}, {100, 100}], GrayLevel[.4, .3], Rectangle[{40, 0}, {60, 80}]}]; arrows = Graphics[{Arrow[{{40, -5}, {60, -5}}], Arrow[{{60, -5}, {40, -5}}], Arrow[{{105, 0}, {105, 80}}], Arrow[{{105, 80}, {105, 0}}], Arrow[{{105, 80}, {105, 100}}], Arrow[{{105, 100}, {105, ...


12

You can use the option ScalingFunctions to achieve what you want: Plot[ 2 Sin[x]+x, {x,0,15}, Frame->True, ScalingFunctions->{Identity,"Reverse"} ]


11

Possibly more versatile, but you have to mess with text overlapping your plots, but GraphicsRow also accepts Epilog GraphicsRow[{Plot[Sin[x], {x, 0, 4 Pi}], Plot[Cos[x], {x, 0, 4 Pi}]}, Spacings -> Scaled[0.4], Epilog -> Inset["Plot Title", Scaled[{0.5, 0.95}]]]


11

You can extract the probabilities from the properties of the edges and assign them as edge labels using g = Graph[mp]; Scan[(PropertyValue[{g, #}, EdgeLabels] = PropertyValue[{g, #}, "Probability"]) &, EdgeList[g]] g You can find this (and other) properties using the PropertyList function: PropertyList[{g, 1 \[DirectedEdge] 2}] (* {"...


11

Just for something different (courtesy of idea of Kuba...cannot find reference): ds = Thread[{(ToString /@ names), Re@data}]; f = DynamicModule[{col = Black}, DynamicWrapper[Dynamic@Style[#, col, Bold], If[CurrentValue["MouseOver"], col = Red; pos = #2, col = Black; pos = {}]]] &; With[{d1 = ds}, Column[{ListPlot[{#2} & @@@ d1, ...


11

Edit in response to the comment about Dynamic Rotating (1/3/17) Make a function with three angles as its arguments. The three angles control the rotation of the three axis labels. f[xangle_, yangle_, zangle_] := Module[{}, labelx = Style[Rotate["years", xangle], FontFamily -> "Arial", Bold, 12]; labely = Style[Rotate["coupon %", yangle], ...


11

Try the following: (if you don't understand what an option does, leave a comment - but please look in the documentation center first) addCallout[min_, max_, date_, val_, Left] := {Line@{{min, val}, {date, val}}, Text[Pane[Round@val, FrameMargins -> 10], {min, val}, {1, 0}]} addCallout[min_, max_, date_, val_, Right] := {Line@{{max, val}, {date, val}}, ...


11

Here are some of my attempts: (code for all versions can be found at the bottom of this answer) Your attempt First for comparison, your attempt (simplified to improve clarity): Labels further away Moving the anchor points away from the sphere: (also suggested in the comments) Custom dynamic callouts An attempt at custom callouts that try to position ...


10

If you create a TextCell then it will wrap the list nicely. PageWidth controls the width of the text cell. Plot[x^2, {x, -3, 3}, PlotLabel -> StringForm["The orbit of x=1.1 is\n``\n", TextCell[testList, PageWidth -> 600]], ImageSize -> {600, 600}] You can change the appearance of the TextCell (font, fontsize, color, etc) using various ...


10

When I need more interface control, I usually do something like this: p1=Plot[Sin[x],{x,0,Pi},PlotLabel->Sin,ImageSize->150]; p2=Plot[Cos[x],{x,0,Pi},PlotLabel->Cos,ImageSize->150]; title=Panel[Style["Test Label",White,20],ImageSize->300,Background->Orange,Alignment->Center]; Deploy@Grid[{{title,SpanFromLeft},{p1,p2}},Dividers->Gray,...


10

You can put there a Rectangle ;) ListLinePlot[{13, 6, 2, 2, 3}, Axes -> False, Frame -> True, PlotMarkers -> Automatic, Filling -> Bottom, BaseStyle -> 18, Prolog -> {GrayLevel@0.95, Scaled /@ Rectangle[{0, 0}, {1, 1}]}, Epilog -> {Inset["XYZ", Scaled[{.9, .9}]]}]


10

This can done with Epilog. f[x_, y_] := x^2 + 5 y^2; contours = {2, 4, 6, 8, 10, 12, 14, 16, 20}; lblXY = {#, 0} & /@ (Solve[f[x, 0] == #, x][[2, 1, 2]] & /@ contours // N); ContourPlot[f[x, y], {x, -5, 5}, {y, -2, 2}, Contours -> contours, AspectRatio -> Automatic, ContourShading -> None, Epilog -> {Thread[Text[contours, lblXY, ...


10

To get the ticks in ScientificForm you have to provide the ticks in the following form: Tick->{{1,"Label1"},...} bmin = 0; bmax = 2*10^-5; bstep = 1*10^-6; DiscretePlot[-7*10^8 b + 15000 , {b, bmin, bmax, bstep}, Ticks -> {Table[{i, ScientificForm[N@i, 3]}, {i, bmin, bmax, (bmax - bmin)/5}], Automatic}] The unit conversion can be implemented with ...


10

You can use this modification Callout[(Exp[-γ ρ^2] /. γ -> #), Style["γ=" <> ToString[#], Bold, Italic]]


10

Edit to add Labeled details You can use Callout for 'in-plot' labels, for example: Plot[{ Callout[Sin[x], "Sin[x]", Below], Callout[Cos[x], "Cos[x]", Below] }, {x, 0, 10}, PlotStyle -> {Red, {Blue, Thick}} ] Alternatively if you do not have version 11 you can use Labeled to get a similar effect, like this: Plot[{ Labeled[Sin[x], "Sin[x]", ...


9

Something like this? BarChart[{{1, 2, 3}, {1, 3, 2}, {5, 2}}, ChartLabels -> {"a", "b", "c"}, BaseStyle -> Directive[FontFamily -> "Zapfino", FontSize -> 16]] At first glance, the online documentation for BarChart doesn't describe any useful font options, but when you see the phrase "BarChart has the same options as Graphics with the ...


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