Tag Info

Hot answers tagged

10

Update ticks[x1_, x2_] := {#/10 + π/2, #} & /@ FindDivisions[{10 (x1 - π), 10 (x2 - π)}, 20] funcs = Table[3 + BesselJ[i, 10 (x -π/2)], {i, 0, 3}]; PolarPlot[funcs // Evaluate, {x, -π/2, 3π/2}, PolarAxes -> Automatic, PolarTicks -> {ticks[0, 2 π][[2 ;; -2]], Automatic} ] (*thanks @kguler 's and @rm-rf 's advice*) Manipulate ...


8

Composition[ {#, Scale[#, {-1, 1}, {0, 0}]} &, Rotate[#, Pi/2, {0, 0}] &, First ] /@ Table[ With[{root = FindRoot[D[BesselJ[i, x], x], {x, 100}][[1, 2]]}, PolarPlot[{1 + BesselJ[i, t root/Pi]}, {t, 0, Pi}, PlotStyle -> {Thick, Blend["AvocadoColors", i/15]}] ] , {i, 0, 15}] // Graphics[#, ImageSize -> 500, ...


5

There are a couple of problems with your code. The first is that the definition of G doesn't match because the intermediate functions already evaluate before G does. H1 has the same issue. You can fix that with SetAttributes[G,HoldFirst] as shown below. The next problem is that the function you are asking to plot is G, not G[H1[H[omega]]], which is not the ...


5

As Ulises Cervantes Pimentel uncovered in this Wolfram Community thread, Plot and ParametricPlot/ParametricPlot3D for curves can take as MeshFunctions the values "ArcLength" and "CurveLength". This functionality provides straightforward solution for the plots with AspectRatio -> Automatic: mpoints = Table[t, {t, 0, 1, 0.04}]; ...


4

Firstly, Manipulate[ Plot3D[2 a1 x + 2 a2 y + a1^2 + a2^2, {x, -5, 5}, {y, -10, 10}], {a1, -10, 10}, {a2, -10, 10}] Then you canuse the Table Show[ Table[ Plot3D[2 a1 x + 2 a2 y + a1^2 + a2^2, {x, -5, 5}, {y, -10, 10}], {a1, 0, 10, 5}, {a2, 0, 10, 5}]]


4

p1[x_] := {Cos@x^2 + x, x - Sin@x}; Plot[{x, p1[t][[2]] /. FindRoot[p1[t][[1]] == x, {t, 1}]}, {x, 0, 5}, Filling -> {1 -> {2}}]


4

Needs["ErrorBarPlots`"] myplot = ErrorListPlot[{ {{20, 0.75}, ErrorBar[{0.5 - 0.75, 0.9 - 0.75}]}, {{10, 0.7}, ErrorBar[{0.5 - 0.7, 0.97 - 0.7}]}}]; myplot2 = ErrorListPlot[{ {{20, 0.85}, ErrorBar[{0.5 - 0.85, 0.9 - 0.85}]}, {{10, 0.8}, ErrorBar[{0.6 - 0.8, 0.91 - 0.8}]}}, PlotStyle -> Red]; Show[ myplot /. {x_?NumericQ, ...


4

The terse Graphics primitives approach: Graphics[{ EdgeForm[{Black, Thick}], {ColorData[39][#2], Rectangle[{0, 0}, {#, 1}]} & @@@ Reverse[data] }, Axes -> {True, False} ] You can add whatever Ticks specification or function you wish to label the data line appropriately.


4

ClearAll[pF]; pF[l_: 0, r_: 5] := Pane[Style[#, FontSize -> Large],FrameMargins -> {{l, r}, {0, 0}}] &; {xl, yl, zl} = {Style[Subscript[t, l], FontSize -> 21], Style[Subscript[t, u], FontSize -> 21], Style[Subsuperscript[Subscript["E", Subscript[N, 0]], m, a]/ Subsuperscript[Subscript["E", Subscript[N, 0]], m, m], FontSize ...


3

The problem with your code is that MMA uses [ and ] exclusively for functions. If you instead use ( and ) as parentheses, your problem is solved. Specifically, clearing the functions d[k_] and h[k_] and changing their definitions to ClearAll[d, h] d[k_] := (1/2)(E^(-2 k^2)) h[k_] := k(a[k] SphericalBesselJ[2, k] + b[k] SphericalBesselY[2, k]) resolves ...


3

I'm not sure I understand what you are doing but the plots plat should be simple. We put all your results in a Table using ParallelTable to use all available cores in your CPU. data = ParallelTable[ Block[ {r = f[x, cb], fmax, xmax}, fmax = First[r]; xmax = (x /. Last[r]); {cb, xmax, fmax} ], {cb, 0, 0.3, 0.3/20}]; TableForm[N@data, ...


3

plot1 = Plot3D[{r^2, -r^2}, {x, -Pi, Pi}, {y, -Pi, Pi}, ColorFunctionScaling -> False, ColorFunction -> ColorData[{"ThermometerColors", {-20, 20}}], BoxRatios -> {2, 2, 3}]; plot2 = ContourPlot[r^2, {x, -Pi, Pi}, {y, -Pi, Pi}, ColorFunctionScaling -> False, ColorFunction -> ColorData[{"ThermometerColors", {-20, 20}}]]; ...


3

According to documentation Epilog is applied after Axes even with Method->"AxesInFront" (and it seems after GridLines too) so you can use it to set layers as you need: Plot[Sin[x], {x, -1, 1}, GridLines -> {{0}, {0}}, Frame -> True, Axes -> False, GridLinesStyle -> Directive[Red, AbsoluteThickness@9], ...


3

Row[{Column[{ Plot[Interpolation[data, InterpolationOrder -> 0][x], {x, 0, Max[data[[All, 1]]]}, PlotRange -> All, AspectRatio -> 1/4, ImageSize -> 600, AxesOrigin -> {0, -1}, ColorFunction -> "Rainbow", PlotStyle -> Thick], BarChart[Thread[Differences@data[[All, 1]] -> data[[2 ;;, 2]]], ImageSize -> 600, ...


3

uh[x_, y_, t_] = 1 + E^(-2 t)*Sin[x]*Sin[y]; Animate[Plot3D[ uh[x, y, t], {x, -2 π, 2 π}, {y, -2 π, 2 π}, PlotRange -> {0, 2}, BoxRatios -> 1, PerformanceGoal -> "Quality"], {t, 0, π}, AnimationRunning -> True, AnimationDirection -> ForwardBackward]


3

Here's a way that may serve you also for other purposes: p[x_, left_, right_] := HeavisideTheta[x - left] HeavisideTheta[right - x] Plot[{2 x p[x, 0, 4], x^2 p[x, 4, 8]}, {x, 0, 8}] Another example: tab = Table[x^(1/n) p[x, n, n + 1], {n, 1, 10}]; Plot[tab, {x, 0, 8}, PlotStyle -> Thick]


3

With[{ r = 1000, ll = 1, c1 = 0.000001, opts = {GridLines -> Automatic, GridLinesStyle -> Directive[Orange, Dashed], LabelStyle -> Directive[Blue, Bold], ImageSize -> 250}}, zc[w_] := 1/(I*w*c1); zl[w_] := I*w*ll; H[w_] := zl[w]/(zl[w] + zc[w] + r); G[w_] := 20*Log[Abs[H[w]]]; Row[{ LogLinearPlot[G[w], {w, 10, ...


3

Not the fastest but the most general way is to learn how to use Overlay, very useful function. With[{ opt = Sequence[PlotRange -> {.4, 1}, FrameTicks -> {{10, 20}, Automatic}, BaseStyle -> AbsolutePointSize@10] }, myplot = ErrorListPlot[{{{20, 0.75}, ErrorBar[{0.5 - 0.75, 0.9 - 0.75}]}, {{10, 0.7}, ErrorBar[{0.5 - ...


2

Update: Using thicker lines to make the difference between various methods visible: Plot[{ConditionalExpression[2 x, 0 <= x < 4], ConditionalExpression[x^2, 4 < x <= 8]}, {x, 0, 8}, BaseStyle -> Thickness[.02]] Plot[{Piecewise[{{2 x, 0<=x<4}}, Indeterminate], Piecewise[{{x^2, 4<x<= 8}}, Indeterminate]}, {x, 0, 8}, ...


2

You can ex-post replace Abs'[...] terms with Sign[...]: fx0[x_] = D[mytemp1[x], x] /. (Abs' -> Sign); fx0[#] & /@ Range[10] (* {0.114698, 0.0894219, 0.0700865, 0.0547306, 0.0424906, 0.0327863, 0.0251506, 0.0191887, 0.0145676, 0.0110091} *) Plot[fx0[x], {x, 0, 10}] Or, use PiecewiseExpand that seems to prevent the Abs' issue (but it is much ...


2

Completely rewritten following the clarification. If those are timestamps, then the height of the bars should be the Differences of the first column. Then style these heights according to the value of the second element of the pair, like this. transformeddata = With[{max = Max[data[[All, 2]]]}, MapThread[ Style[#1, Blend[{Red, Blue}, N@#2]] &, ...


2

Update. I was distracted by the incomplete code before but I believe I see the problem now. Simply put h in MeshFunctions is not the h in your plotting function. Note the syntax highlighting that (when correct) exists to indicate this, present also in this simpler example: ParametricPlot3D[{Cos[u], Sin[u] + Cos[v], Sin[v]}, {u, 0, 2 π}, {v, -π, π}, ...


2

There are couple other ways to visualize 3D images, one of which is new in V10. (Note: The links to the original data are no longer valid.) The new features, ClipPlanes and IntervalSlider, are useful here. Something like this was demonstrated at WTC 2014. knee = Raster3D[ RawArray["Byte", ImageData[ExampleData[{"TestImage3D", "MRknee"}], ...


2

Use a function with NumberForm to construct your FrameTicks. FrameTicks -> {{#, NumberForm[#, {5, 4}]} & /@ legend[[All, 1]], None}


2

The documentation for RegionPlot in V10 has not been updated properly. It omits a new argument pattern now accepted by RegionPlot. That argument pattern is RegionPlot[region, options] The new pattern is documented under ImplicitRegion and ParametricRegion. So two ways to get a region plot of the region under the line y == -[5/3) x and to right of the ...


2

version 10 LogLinearPlot does not work as function of Ticks in the version 10, and I think that this might be a bug. here is related Version 9 I made findD for that. findD[{x1_, x2_}, n_] := FindDivisions[-Log[10, #] & /@ {x1, x2}, n] myTicks[xmin_, xmax_] := {10^-#, #} & /@ findD[{xmin, xmax}, 10] Have try this code. Kb1 := Kw/Ka1; Kb2 := ...


1

Placement in Placed is {{x_pos, y_pos}, {x_obj_pos, y_obj_pos}}, where x_pos and y_pos are scaled(from 0 to 1) position referring to the plot, and x_obj_pos and y_obj_pos are scaled position referring to the legend object. Scaled values can be outside the range of {0,1}. ArrayPlot[RandomInteger[10, {400, 400}], ColorFunction -> "ThermometerColors", ...


1

In addition to the methods suggested in previosly posted answers and in this related Q/A, there is also ... Graphics with thick Lines (instead of Rectangles): colorRules = Thread[# -> Charting`CommonDump`brightrogerStyles[Length@#]] &@ DeleteDuplicates[data[[All, 2]]]; colors = labels /. colorRules; ldata = ...


1

Plot3D[29000.0 Abs[x + I y], {x, -4, 4}, {y, -4, 4}, BoxRatios -> {1, 1, .7}, ImageSize -> 300, AxesLabel -> Row[{Spacer[30], Style[ Subsuperscript[Subscript["E", Subscript[N, 0]], m, a]/Subsuperscript[ Subscript["E", Subscript[N, 0]], m, m]], Spacer[30]}] ]


1

A quick fix is to add several white spaces i.e. use something like AxesLabel -> "a ". You can use Manipulate to adjust the number of white spaces: With[{p = Plot3D[Abs[x + I y], {x, -4, 4}, {y, -4, 4}]}, Manipulate[Show[p, AxesLabel -> "|z|" <> ConstantArray[" ", n]], {n, 0, 10, 1}]] As suggested by Alexey Popkov in the comment below, ...



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