Tag Info

Hot answers tagged

15

To long for a comment, but here's one approach, using information readily available in the docs and on this site: First, make a map that wraps a globe changing the Geoprojection to something a bit more useful. img = With[{Δ = 30}, Row[Table[ GeoGraphics[GeoBackground -> GeoStyling["ReliefMap"], GeoRange -> {{-90, 90}, {λ, λ + Δ}}, ...


14

I think what you want is the following: dataSet[ListContourPlot, {#a, #e, #c} &] dataSet[ListDensityPlot, {#a, #e, #c} &] If you still want to use the Keys directly then you'll have to force ListContourPlot and ListDensityPlot to extract only the Values as follows: dataSet[ListContourPlot[Values@#] &, {"a", "e", "c"}]


12

You can do it with Epilog: f[x_] := 2 - 2 Sin[x] + x; x0 = 4; δ1 = 0.2; δ2 = 0.23; γ = 1.1; Plot[f[x], {x, -3, 7}, Epilog -> {Pink, PointSize[0.02], Point[{x0, f[x0]}], Darker[Pink], Arrow[{{{x0 - γ δ1, f[x0 - γ δ1]}, {x0 - δ1, f[x0 - δ1]}}, {{x0 + γ δ2, f[x0 + γ δ2]}, {x0 + δ2, f[x0 + δ2]}}}]}] Here δ1 and δ2 mean the distances to ...


12

Show combines multiple Graphics objects together, but it only works after everything has already been processed. So, it has to make some judgements on how to combine the resulting options together, and for most it uses the options present in the first Graphics object. Looking at your original graphic, I suspect it is the first plot that causes the issues, ...


11

I appreciate kguler's elegant solution, but it doesn't join the points. To be more precise, it joins only every third point because Bezier line additionally takes 2 anchor points for each point. There are different methods to obtain these points. The simplest one is the following (pictures taken here) In Mathematica it looks like the following code ...


11

The built-in functionality can do this directly: {xs, ys} = Transpose[points]; xinterp = Interpolation[xs, Method -> "Spline"]; yinterp = Interpolation[ys, Method -> "Spline"]; ParametricPlot[{xinterp[t], yinterp[t]}, {t, 1, Length@points}, Epilog -> Point /@ points] Without the "Spline" method, the interpolating functions are not always ...


11

Definition GaussCurvature[f_] := With[{dfu = D[f, u], dfv = D[f, v]}, Simplify[(Det[{D[dfu, u], dfu, dfv}] Det[{D[dfv, v], dfu, dfv}] - Det[{D[f, u, v], dfu, dfv}]^2) / (dfu.dfu dfv.dfv - (dfu.dfv)^2)^2]]; Sphere As @ ubpdqn already remarked GaussCurvature[{Cos[u] Sin[v], Sin[u] Sin[v], Cos[v]}] 1 Ellipsoid ellipsoid = {2 Cos[u] ...


10

ClearAll[f, x, data]; f[x_] := x^2; data = Table[{x, f[x]}, {x, -10, 10, 0.1}]; p0 = ListPlot[data, Frame -> True, Axes -> False, Joined -> True, PlotStyle -> {Blue, Thick}]; p0 /. Line[x_] :> {Arrowheads[Table[.05, {5}]], Arrow[x]} p0 /. Line[x_] :> {Arrowheads[{0, .05, .05, 0}], Arrow[x]} or Show[p0, BaseStyle -> ...


10

Since the filling in the original DateListPlot is a Polygon, you can post-process it to add a texture. The tricky bit is getting the scaling correct - I rescale the polygon coordinates relative to the PlotRange (so the texture coordinates run from 0 to 1 across the width and height of the plot) and crop the image to the correct aspect ratio: ...


9

Update: functions to generate the edge list, indices and labels: ClearAll[layersF, edgesF, subscF, indicesF]; layersF = Module[{k = 1}, Table[k++, {i, #}, {j, i}]] &; edgesF = Flatten[Thread /@ Thread[# -> Partition[#2, 2, 1]] & @@@ Partition[layersF[#], 2, 1], 2] &; indicesF = Reverse[Thread /@ ...


9

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, ...


9

If you have only a couple of points you could try data = {1.2, 4.3, 5.3, 2.721, 7.32, 1.7, 4.9}; ListLinePlot[ data, Ticks -> {Automatic, data}, GridLines -> {Automatic, data}, PlotMarkers -> Automatic] However, if points are not sufficiently apart ticks will be overwritten. Therefore I would recommend to use Tooltip. ListLinePlot[ ...


9

Major update, version 2.0 What changed: Is a different, more clever way of solving the problem. Overcomes most of the issues of previous versions. Problem summary: I will rephrase the problem in simplest terms. There exests a named curve called limacon (french, pronounced [ˈlɪməsɒn], means snail), described by a simple equation $r=a+b\cos{\theta}$ in ...


8

Some profile definitions I made up, and an image of the profile. radii = Interpolation[ {{{0.}, 2.}, {{0.4}, 3.}, {{0.7}, 1.}, {{0.85}, 0.75, 0.}, {{1.}, 0.75, 0.}}]; centers = Interpolation[ {{{0.}, 0.}, {{0.2}, 0.}, {{0.5}, 1.}, {{0.7}, 0.5}, {{0.85}, 0.2, 0.}, {{1.}, 0.2, 0.}}]; ParametricPlot[{u, t radii[u] + centers[u]}, {u, 0, 1}, {t, -1, 1}, ...


8

data = Table[{x, Sin[x]}, {x, -Pi, Pi, 0.1}]; Graphics[{Hue[#2], PointSize[Abs[#2]/50], Point[{#1, #2}]} & @@@ data, Axes -> True]


8

f[n_, j_, u_] := PiecewiseExpand[BernsteinBasis[n, j, u]] cv[pt_, n_, u_] := (f[n, #, u] & /@ Range[0, n]).pt Test: pts = {{0, 0}, {2, 4}, {4, 5}, {6, 0}}; ParametricPlot[cv[pts, Length@pts - 1, v], {v, 0, 1}, Epilog -> {Red, PointSize[0.02], Point[pts], Green, Line[pts]}, PlotRange -> {0, 6}] Or DynamicModule[{p = {{0, 0}, {2, 4}, {4, ...


8

I think this code might be old version. You made some mistake so I changed your code like this. Rotate -> rotate Do -> Table SelectionAnimate -> Manipulate or Animate We can give change variable T in Manipulate but that computation time is so long. Thus I set the Graphics3D-s to frames and apply Manipulate or Animate. Have try like this. a = ...


8

im2 = Import["http://i.stack.imgur.com/6m6ET.jpg"]; ParametricPlot[{{u, Cos[u]}, ConditionalExpression[{u, v Cos[u]}, -3 Pi/2 <= u <= Pi]}, {u, -2 Pi, 2 Pi}, {v, 0, 1}, Mesh -> None, PlotRange -> All, PlotStyle -> Directive[{Opacity[1], Texture[ImageMultiply[im2, Yellow]]}], AspectRatio -> (1/Divide @@ ImageDimensions[im2]), ...


8

One way would be to specify an explicit x-axis range on the plots, using AbsoluteTime to convert the desired date range into the coordinate values required by PlotRange: $data1 = FinancialData["AAPL", {{2003, 9}, {2003, 11}}]; $data2 = FinancialData["MSFT", {{2003, 10}, {2004, 1}}]; $start = {2003, 8, 6, 0, 1, 29}; $end = {2004, 1, 24, 23, 46, 58}; ...


7

Manipulate[Show[Graphics3D[{ {Red, PointSize[0.02], Point[{{0, 0, 0}}]}, {Opacity[0.2], Sphere[{0, a/(1 + a^2), -1 - 1/(1 + a^2)}, 1/Sqrt[1 + a^2]]}, Arrow[{{0, 0, 0}, {x[t, a], y[t, a], z[t, a]}}]}], ParametricPlot3D[{x[u, a], y[u, a], z[u, a]}, {u, 0, 10}], Axes -> True, PlotRange -> Table[{-3, 2}, {3}]], {t, 0, 10}, {a, 1, ...


7

Here is a cheat using BoxWhiskerChart. The error bars are quantiles (0.05, 0.95) and not symmetric confidence interval. It is not ideal wrt placement of mean marker. Using: rv = RandomVariate[NormalDistribution[10, 3], {20, 10}]; BoxWhiskerChart[rv, {{"MeanMarker", Style[\[FilledSmallCircle], 20], Blue}}, Method -> {"BoxRange" -> (Quantile[#, ...


7

You can use ErrorListPlot as described in: How to : Add Error Bars to Charts and Plots. (This might be considered "easily found" however I don't believe "caterpillar plot" would find it.) The first example from the documentation: Needs["ErrorBarPlots`"] ErrorListPlot[Table[{i, RandomReal[{0.2, 1}]}, {i, 10}]] By the way if you find that the error ...


7

Creating the edge list The index and edges can be worked out like this: step[list_, n_] := Block[ { ln1 = list[[1]] , ln2 = list[[2]] }, Join[ If[ln2 < n , {{ln1, ln2 + 1} -> {ln1, ln2}}, {}], If[ln2 < n, {{ln1, ln2 + 1} -> {ln1 + 1, ln2 }}, {}], If[ln1 + ln2 + 1 < n, step[{ln1, ln2 + 1}, n], {}], ...


7

A function to recursively generate the edges: n[_, 0] := {}; n[x : 0, y_Integer] /; y > 0 := {{x, y} -> {x, y - 1}, {x, y} -> {x + 1, y - 1}, n[x + 1, y - 1], n[x, y - 1]}; n[x_Integer, y_Integer] /; y > 0 := {{x, y} -> {x, y - 1}, {x, y} -> {x + 1, y - 1}, n[x + 1, y - 1]}; We have to sort the vertices so that the ...


7

One approach is to fill each Plot to 0 rather than Axes and set AxesOrigin to {0, 0} in Show g1 = Plot[Sin[x], {x, -2*Pi, 2*Pi}, RegionFunction -> Function[x, ArcSin[2/3] < Sin[x] < ArcSin[1]], PlotStyle -> Red, Filling -> 0]; g2 = Plot[Sin[x], {x, -2*Pi, 2*Pi}, RegionFunction -> Function[x, ArcSin[1/3] < Sin[x] < ...


7

I would approach this differently. Managing so many graphs that are similar and need to be updated similarly might prove a headache. We can take advantage of the mathematical similarities with functionality that is built into Mathematica. The sort of coloring you're after can be done with Mesh and MeshShading. The Ceiling function may be used to ...


7

I had almost the same problem with the original code: Using Exclusions as Öskå suggested works for me. kguler pointed out that Exclusions -> None is the correct setting to fix this problem: Show[ Plot[Sin[x], {x, -2 Pi, 2 Pi}, PlotStyle -> Blue], Plot[Sign[Sin[x]] Ceiling[Abs[Sin[x]], 1/3], {x, -2 Pi, 2 Pi}, PlotStyle -> Red, Filling -> ...


7

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 ...


7

Both, DistributionChart and SmoothHistogram are models using a "smooth kernel density estimate". Consider the simplest case with two points only: DistributionChart[{0, 1}, GridLines -> Automatic] SmoothHistogram[{0, 1}, GridLines -> Automatic] For your data we get dat = Flatten[{RandomReal[1., 10000], RandomReal[2., 2000]}]; ...


7

Until someone comes up with a less convoluted approach, you can post-process the output of BoxWhiskerChart to color and/or to downsample the outliers as follows: data = Flatten[{RandomReal[1., 10000], RandomReal[2., 2000]}]; b1 = BoxWhiskerChart[data, {"Median", {"MedianMarker", 1, Black}, {"Whiskers", Black}, {"Fences", 0.5, Black}, ...



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