# Tag Info

## Hot answers tagged plotting

10

When you use Evaluate, the PDF evaluates to an exponential: pdf = PDF[NormalDistribution[1.6, .2], x] 1.99471 E^(-12.5 (-1.6 + x)^2) When you evaluate this object with a large enough number x (on the order of 10), the resulting object is too small to represent as a machine number: pdf /. x -> 10 General::munfl: Exp[-882.] is too small to ...

5

This is because of the value of β becoming negative. If we replace the Arcβ definition with the following: Arc\[Beta] = ArcSin[Ramp[\[Beta]] ]*180/Pi; your code appears to work ok (although it complains a little because now there are divisions by zero. It's unclear to me how best to handle these given your algorithm, so I would simply Quiet them - however, ...

5

colors = {Magenta, Orange, Cyan, Red, Blue, Green, LightGray, Yellow, Black}; tooltips = {##2} -> Tooltip[{##2}, #] & @@@ mockdataWithNAICS; {dx, dy} = Round[Subdivide[##, 3]] & @@@ (Round[MinMax@#] & /@ Transpose[mockdataWithNAICS[[All, {2, 3}]]]); You can use BinLists with {dx} and {dy} as horizontal and vertical bin delimiters ...

5

I believe this has the intended functionality, with simplified code. minx = Round[Min[mockdataWithNAICS[[All, 2]]]]; maxx = Round[Max[mockdataWithNAICS[[All, 2]]]]; dx = Round[Subdivide[minx, maxx, 3]]; miny = Round[Min[mockdataWithNAICS[[All, 3]]]]; maxy = Round[Max[mockdataWithNAICS[[All, 3]]]]; dy = Round[Subdivide[miny, maxy, 3]]; gridpts = Tuples[{dx,...

4

You can get the boundary using g as the MeshFunctions option value: boundary = ContourPlot3D[h[x, y, z] == 24, {x, -s, s}, {y, -s, s}, {z, -s, s}, MeshFunctions -> (g[#, #2, #3] &), Mesh -> {{0}}, MeshStyle -> Green, ContourStyle -> None]; You can post-process boundary to inject desired colors using VertexColors: ...

4

The branch cut structure here is very dense, which can be very hard for plotters to pick up. Here are the cuts in a part of your domain: Quiet @ Show[ ComplexPlot[ Log[MittagLefflerE[1/2, z]], {z, 0, 20 + 20 I}, Exclusions -> None, ColorFunction -> {Automatic, None}, ImageSize -> Large ], ContourPlot[ Im[E^(x + I y)^2 Erfc[-x - ...

3

...is there a way to do this with ContourPlot3D[]? It's certainly doable. As an exercise, figure out how the equations used in the following code were derived: iceCreamProfile[r_, h_, x_] := Piecewise[{{Sqrt[r^2 - x^2], x > 0}}, r (1 + x/h)] With[{r = 1, h = GoldenRatio}, ContourPlot3D[iceCreamProfile[r, h, z]^2 == x^2 + y^2, {...

3

ClearAll[zoom] zoom[Dynamic[coords_], edgestyle_: Blue, facestyle_: LightBlue] := Graphics[{Directive[EdgeForm[{edgestyle, Dashed}], facestyle, Opacity[.3]], Dynamic[Rectangle @@ coords], MapThread[Locator[Dynamic[coords[[#]]], Graphics[{#2, Rectangle[]}, ImageSize -> 8], LocatorRegion -> Full] &, {{1, 2}, {Black, Gray}}]}] ...

3

Use a StringForm: Plot[x, {x, 0, 1}, AxesLabel -> {Text[StringForm["r[]", Subscript[a, 0]]], Automatic}] It is alternatively possible to enter the subscripts directly inside the quoted string (without using StringForm).

2

Hope this is what you're looking for: F[s_, l_, p_] := Sum[((-1)^k (1/2 Sinh[s])^(2 k))/(k! (p - 2 k)! (k + (l - p)/2)!), {k, (p - l)/2, p/2}] A[q_, s_, b_, p_] := Sum[Sqrt[q! p! (1/2 Tanh[s])^((l - p)/2)]/(Cosh[s])^(p + 1/2) b^(l - q) E^(-1/2 b^2) F[s, l, p] LaguerreL[q, l - q, b^2] Cos[\[Pi]/2 (p - l)], {l, q, Infinity}]^2 q = 2; s = 1; b = 5 (Cosh[s] + ...

2

you can use Graphics3D with graphics primitives Cone and Sphere (using ClipPlanes to get a half-sphere): Graphics3D[{Directive[Orange, Opacity, Specularity[White, 10]], Cone[{{0, 0, 0}, {0, 0, -1}}, 1/2], Directive[Brown, Opacity, Specularity[White, 30]], {ClipPlanes -> {0, 0, 1, 0}, Sphere[{0, 0, 0}, 1/2]}}, Boxed -> False, Axes -> ...

2

We solve a system of ODEs: $$p(t)\cdot\dot{\vec{x}}(t)=\vec{q}(t)-p(t)\cdot\vec{r}(t)$$ with $$p(t)=\left(\begin{array}{cc}\sin(t)&\exp(t)\\1&\cos(t)\end{array}\right), \quad \vec{x}(t)=\left(\begin{array}{c}x_1(t)\\x_2(t)\end{array}\right),$$  \vec{r}(t)=\vec{x}(t)+\left(\begin{array}{c}\sin(t)\\\cos(t)\end{array}\right), \quad \vec q(t)=\left(...

2

image=Import["https://i.stack.imgur.com/GZcUT.jpg"] c=1/2; ImageForwardTransformation[image, Through[{Re,Im}[((#[]+I #[])-c)/(Conjugate[c]*(#[]+I #[])-1)]]&, Background->1,DataRange->{{-1,1},{-1,1}},PlotRange->{{-1,1},{-1,1}}]//AbsoluteTiming Compile transformation function expr=ReIm[((#[]+I #[])-c)/(Conjugate[c]*(#[[...

2

There is a closely related thread of question and discussions out there. While it doesn't give a definitive and complete answer, it does shed some light on the topic. I tried to get Methods for ListPlot3D using one of the old functions from this thread: getList2[name_String] := Module[{options, idx, z1, z2}, options = Names[name <> "*"]; ...

2

You can use Chartingget2DPlotRange[thePlot to get the plot range taking into account plot range paddings and use it to specify the rectangle coordinates: gr = Graphics[{Opacity[.1], Blue, Rectangle @@ Transpose[{Chartingget2DPlotRange[thePlot][], {100, 140}}]}]; Show[thePlot, gr]

2

f[a_, b_] := (1 - a)/(b + 2) You can use a single RegionPlot: RegionPlot[{0< f[a,b] <= 1/4, 1/4 < f[a,b] <= 1/2}, {a, 0, 1}, {b, 0, 2}, PlotStyle ->{Blue, Red}, BoundaryStyle -> None] Alternatively, RegionPlot with the options MeshFunctions+Mesh+ MeshShading: RegionPlot[True, {a, 0, 1}, {b, 0, 2}, MeshFunctions -> {f[#, #2] &...

2

You can use ContourPlot, specify the desired contours, and also use a non-default ColorFunction option. I also needed to use ColorFunctionScaling so that function values are left alone. f[a_,b_] := (1-a)/(b+2) ContourPlot[f[a, b], {a, 0, 1}, {b, 0, 2}, Contours->{0, 1/4, 1/2}, ColorFunction -> Function @ Piecewise[{{Red, 1/4<#<1/2}, {...

2

Wrap Table in the first argument with Evaluate: ContourPlot[Evaluate @ Table[ x^2 + y^2 == k, {k, {.04, .09}}], {x, -.5, .5}, {y, -.5, .5}]

2

The method of the false transient works well here rmin = 10^-6; L = 10^2; nn = 2137; tmax = 10; X = NDSolveValue[{D[x[r, t], r, r] + (1/r) D[x[r, t], r] - (1/2/r^2) Sin[ 2 x[r, t]] + (2/r) Sin[x[r, t]]^2 - 1/2 Sin[x[r, t]] - Sin[2 x[r, t]] == D[x[r, t], t], x[rmin, t] == Pi, x[L, t] == 0, x[r, 0] == Pi (L - r)/(L - rmin)}, x, {r, ...

2

One way to resize things is to use a Manipulate: data = RandomReal[1, {200, 2}]; Manipulate[b = Table[{Text[i, data[[i]]]}, {i, 1, Length[data]}]; ListPlot[{0, 0}, PlotStyle -> PointSize[.004], PlotRange -> {{0, 1}, {0, 1}}, Epilog -> b, ImageSize -> i], {i, 100, 2000}] Now you can resize the plot using the slider... it zooms in as you ...

1

You can also use RegionFunction: Show[ContourPlot3D[ x^2 + y^2 + z^2 == 4, {x, -4, 0}, {y, -4, 4}, {z, -4, 4}, ContourStyle -> Pink, Mesh -> None, Boxed -> False, Axes -> False, Background -> Black], ContourPlot3D[ y^2 + z^2 == (x - 2)^2, {x, -4, 4}, {y, -4, 4}, {z, -4, 4}, RegionFunction -> Function[{x, y, z}, y^2 + z^2 <...

1

There it will be better to put a limit on m, then there will be no division by 0 and you can calculate the solar flux at any time of the day Rise = Sunrise[GeoPosition[{57.7053, -3.33917}], DateRange[DateObject[{2019, 1, 1}], DateObject[{2019, 12, 31}]]]; Sunrises = DateString[#, {"Hour", "Minute"}] & /@ Rise["Values"]; Sets = Sunset[GeoPosition[{57....

1

In my opinion, an easier way to go about making the plot you want is to use ParametricNDSolveValue. I also suggest solving the ODEs separately. Like so: X[t_] = a Cos[t]; Y[t_] = Sin[t]; uvf1 = ParametricNDSolveValue[ {D[{u[t], v[t]}, t] == D[{{X[t], Y[t]}, {Y[t], -X[t]}}, t].{u[t], v[t]}, {u, v} == {1, 0}}, {u[t], v[t]}, {t, 0, 10}, a]...

1

You can use the internal function ChartingScaledTicks yticks = ChartingScaledTicks[{Identity, Identity}, "TicksLength" -> {.03, .02}][##, {3, 10}] &; xticks = ChartingScaledTicks[{Identity, Identity}, "TicksLength" -> {.03, .02}][##, {6, 5}] &; Plot[Sin[x], {x, -2.5, 2.5}, Frame -> True, Axes -> False, FrameTicks ->...

1

Try RegionPlot(I changed your example a little bit because of 0<f<1/2) Show[{ RegionPlot[0 < (1 - a)/(2 + b) < 1/4, {a, 0, 1}, {b, 0, 2},PlotStyle -> Blue], RegionPlot[1/4 < (1 - a)/(2 + b) < 1/2, {a, 0, 1}, {b, 0, 2},PlotStyle -> Red] }]

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