Tag Info

Hot answers tagged

10

Your comment raises interesting question: I got everything simply faded and flat, while in the example - its all bright and sharp I think the problem is related to the fact that Mathematica's graphical functions always work in linear colorspace. Starting from Pickett's solution with better resampling method, in version 10.0.1 we obtain: ...


8

r = RandomVariate[NormalDistribution[0, 1], 1500]; custom = NormalDistribution[#, 1] & /@ Range[0, 2, .4]; (* to be replaced with your custom1, custom2, ... *) You can do one of several things: Make a single Plot instead of five separate ones Show[Histogram[r, Automatic, "PDF"], Plot[Evaluate[Tooltip[PDF[#, x], #] & /@ custom], {x, -3, ...


7

Using code from the mentioned 9447, with some patches data = Transpose@{{"First", "Second", "Third"}, Table[Accumulate[RandomReal[{-1, 1}, 500]], {3}]}; hover[data_] := Module[{mouse}, mouse = MousePosition[{"Graphics", Graphics}, {99999, 99999}]; {Text[Style[Framed@Column[ (Row[{#[[1]], ": ", #[[2, Min[Length@#[[2]], Max[1, ...


6

On-screen, lines are always at least 1 pixel wide in Mathematica, regardless of the thickness setting. Not sure what you tried with Opacity, as it seems to be possible to achieve the same effect: PlotStyle -> Directive[AbsoluteThickness[1], Opacity[.05]]


5

You're about to realize that derivatives in the real world are a pain. You have to aggregate data as much as possible and average it a lot until you get a "textbook-quality second-derivative! dates = DateList /@ Import["http://www.sudomemo.net/statistics/firstSeenDump.php", "JSON"] Grouping by days and counting: datesDays = Tally@dates[[All, ;; 3]]; ...


5

Rolled back to the very first version: ClearAll[x]; Plot[Evaluate[Range[50] + x], {x, -5, 5}, PlotLegends -> "Expressions"] Update -2: For other users who might have liked the deleted version: Plot[Evaluate[{1, 2, 3, " ... ", 49, 50} + x], {x, -5, 5}, PlotLegends -> "Expressions"] ... and a few variations: Plot[Evaluate[Range[50] + x], {x, ...


5

p1[t_] := {Cos[t], Sin[t]} p2[t_] := 0.5 {Cos[t + Pi], Sin[t + Pi]} + {0.5, 0} p3[t_] := 0.5 {Cos[t], Sin[t]} - {0.5, 0} p4[t_] := {Cos[t + Pi],Sin[t+Pi]} Graphics[{{Blue, Polygon[Join @@ Transpose[ Table[{p1[Pi - j], p3[j], p2[Pi-j]}, {j, 0, Pi, 0.001}]]]}, {Red, Polygon[Join @@ Transpose[Table[{p2[j], p3[j], p4[j]}, {j, 0, Pi, ...


5

ArcCurvature is already built-in to Mathematica, so there is no need to compute curvature manually: f[t_] := {t Exp[t], Exp[-t], Sqrt[2] t} Simplify@ArcCurvature[f[t], t] Plot[%, {t, -3, 3}] ParametricPlot3D[f[t], {t, -1, 1}] which produces $$\kappa(t)=\frac{e^{2 t} \sqrt{2 e^{4 t} (t+2)^2+e^{2 t} (2 t+3)^2+2}}{\left(e^{4 t} (t+1)^2+2 e^{2 ...


5

You have the import. dates = Import["http://www.sudomemo.net/statistics/firstSeenDump.php", "JSON"] Gather them up by day and count how many in each day. dailyGather = GatherBy[dates, Take[DateList[#], 3] &]; dailyVisits = {Take[DateList[dailyGather[[#, 1]]], 3],Length[dailyGather[[#]]]} & /@ Range[First@Dimensions[dailyGather]]; Plot the ...


5

You tried to decrease the width of the lines to below the minimum width. In order to achieve the same effect you can increase the size of the image instead. x = RandomReal[1, 10000]; y = RandomReal[1, 10000]; Show[ImageResize[Rasterize@ListLinePlot[{Thread@{x, y}}, ImageSize -> 10000], 300], ImageSize -> 300]


4

fun = {u E^u, E^-u, Sqrt[2] u}; cur = Sqrt[2/E^(2*u) + (3 + 2*u)^2 + (2*Sqrt[2]*E^u + Sqrt[2]*E^u*u)^2]/ (2 + E^(-2*u) + (E^u + E^u*u)^2)^(3/2); plo = Plot[cur, {u, -5, 5}, PlotRange -> All] range = Last[PlotRange /. AbsoluteOptions[plo, PlotRange]]; ParametricPlot3D[fun, {u, -5, 5}, BoxRatios -> 1, ColorFunction -> Function[{x, y, z, u, ...


4

Try this: Plot[Tooltip[{n!, n^n, Exp[n], Log[n], n^100, 10^n}], {n, 0, 2}] Now when you hover over the plot, the tooltip (the little popup window) tells which curve the mouse is pointing at.


4

If it is to be printed and you have space (say, a page), then a grid can be effective, where each dataset is plotted in a highlight color over a monochromatic plot of all datasets: maxmin = {Min /@ Transpose[data], Max /@ Transpose[data]}; background = ListLinePlot[Join[maxmin, data], PlotStyle -> Directive[Thin, Gray], Filling -> {1 -> ...


4

data = RandomInteger[10, {20, 20}]; ticklabels = StringJoin /@ # & /@ RandomChoice[CharacterRange["A", "Z"], {2, 20, 3}]; ticklabels2 = MapAt[Rotate[#, Pi/2] &, ticklabels, {2, All}]; ticks = (MapIndexed[{First@#2, #1} &, #] & /@ ticklabels2); ticks2 = {{ticks[[1]], None}, {None, ticks[[2]]}}; ArrayPlot[data, FrameTicks -> ticks2] ...


4

You can specify the decimal point using the Numberpoint option, like described here: Import["file.txt", "Table", "NumberPoint" -> ","]


3

funcs = Tooltip /@ ({E^x, (Series[E^x, {x, 0, #}] // Normal) & /@ Range[6]} // Flatten); Plot[funcs, {x, 0, 5}]


3

is this what you want? tikc1 = {r1, r2, r3}; htick = {#, Style[tikc1[[#]], 14, Bold]} & /@ Range[3]; tikc2 = {c1, c2, c3, c4}; vtick = {#, Style[Rotate[tikc2[[#]], Pi/2], Bold, Red, 14]} & /@ Range[4]; ArrayPlot[{{1, 0, 0, 0.3}, {1, 1, 0, 0.3}, {1, 0, 1, 0.7}}, FrameTicks -> {htick, vtick, htick, vtick}]


3

As you expect monotonic "smooth" behavior, a simple solution is to z-score the differences. diff = data[[All, 2]] // Differences; mn = Mean[diff] std = StandardDeviation[diff] (* 3 std is bad *) bad = Position[diff, x_ /; Abs[x] > Abs[mn + 3 std]] ListPlot[data, PlotRange -> All] ListPlot[data[[bad // Flatten]], PlotStyle -> Red] Show[%, %%] ...


3

results = Sort@RandomInteger[100, {20, 30}]; Columns 2, 5 and 12 versus 1: ListLinePlot[results[[All, {1, #}]] & /@ {2, 5, 12}, PlotLegends -> Placed[Row[{"n = ", #}] & /@ {2, 5, 12}, Right]] columns = {2, 3, 15, 20}; ListLinePlot[results[[All, {1, #}]] & /@ columns, PlotLegends -> Placed[Row[{"n = ", #}] & /@ columns, ...


3

I post this is a separate answer. It uses ParametricPlot as per question title (rather than polygon). If this is against protocol, let me know and I can merge. Further, advice re: removal of vertical line(x=0&&y>0) welcome. plt1 = ParametricPlot[u {Sin[t], Cos[t]}, {t, 0, Pi}, {u, 0, 1}, MeshFunctions -> {(Boole[#1 #2 <= 0] ((#1 - 0.5)^2 + ...


3

I'm no Manipulate master, but from previous nasty experiences, I have a few tips: Read the related tutorials, not only the direct documentation. They explain a great deal of the internal "mechanics", and have some examples that make for some great A-ha moments. - https://reference.wolfram.com/language/tutorial/IntroductionToDynamic.html - ...


3

You can also specify your own plot styles and for functions with large ranges consider LogPlot, e.g. LogPlot[{n!, n^n, Exp[n], Log[n], n^100, 10^n}, {n, 0, 2}, PlotStyle -> {{Red, Dashing[{0.03, 0.03}]}, Green, Blue, Orange, {Purple, Dashing[{0.03, 0.03}]}, Black}, PlotLegends -> "Expressions"]


2

Assuming you really want solid lines for your data, I'd suggest something like the following. ListLinePlot[fakedata, PlotStyle -> (Flatten@ Outer[Directive, {AbsoluteThickness[1.5], Dashing[0.02], DotDashed, Dotted}, Take[ColorData[22, "ColorList"], 5]])] For shorter data series in the data set, PlotMarkers can help if you truncate your ...


2

How do I plot the derivatives of the solution You can simply tell NDSolve to also solve for the derivative: sol = First@NDSolve[{x''[t] + x'[t] + 10 Sin[x[t]] == 3, x[0] == 0, x'[0] == 1}, {x[t], x'[t]}, {t, 0, 20}]; Plot[{x[t] /. sol, x'[t] /. sol}, {t, 0, 20}, PlotStyle -> {Red, Blue}, PlotRange -> All, Frame -> True, PlotLegends ...


2

Use #3 instead of #. See the RegionFunction -> docs, "Details" section- f[x_] := Sin@ x g[x_] := x^2; ParametricPlot[{g@x, f@x}, {x, 0, 3}, RegionFunction -> (! 1 < #3 < 2 &), AspectRatio -> 1]


2

A common approach to removing outliers is to use an order statistic filter. The simplest of these is the MedianFilter: x = data[[All, 1]]; ySmoothed = MedianFilter[data[[All, 2]], 5]; ListPlot[Transpose[{x, ySmoothed}]]


2

ContourPlot[Min[(-7 + 100 t - x) (5 + 100 t - x), (400 t^2 + 40 t (-5 + x) + (-5 + x) (7 + x))], {t, 0, .05}, {x, -1, 5}, PlotRange -> All, Exclusions -> None] Exclusions->None fixes the issue in both version 9 and 10: Without the Exclusions->None option, I reproduce the issue in both versions (Windows 8 - 64bit):


2

n = 20 (*even*) f = Interpolation[Transpose[{data[[All, 1]], Join[ data[[;; (n/2 - 1), 2]] , MovingAverage[data[[All, 2]], n] , data[[-n/2 ;;, 2]] ]}]] GraphicsColumn[{ListPlot[data], ListPlot[ Select[ data , Abs[f[#[[1]]] - #[[2]]] < .2 & ] ]}]


2

Perhaps this is your aim: tsv = ImportString["0,000000000E0 1,237909063E1 3,333333333E-2 1,237909063E1 6,666666667E-2 1,237909063E1 1,000000000E-1 1,240163557E1 1,333333333E-1 1,267077663E1 1,666666667E-1 1,309703315E1 2,000000000E-1 1,363531527E1 2,333333333E-1 1,390445633E1 2,666666667E-1 1,448782832E1 3,000000000E-1 ...


3

It seems AxesOrigin property spoils everything. A bug maybe.. I can suggest 2 way outs: first, simply: Graphics3D[{arrowAxes[3], Sphere[{1, 1, 1}]}, Axes -> True, Boxed -> False, AxesEdge -> {{0, -1}, {0, -1}, {0, -1}}, AxesStyle -> Opacity[0], TicksStyle -> Opacity[1]] This gives what you want, but i don't know how to specify the ...



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