Tag Info

Hot answers tagged

55

TL;DR: package at the bottom of post. UPDATES 6: Tiny update: Import can now use the ".bvh" extension to determine the import type. The code that does this is ugly, but I don't see any other way at the moment. out = Import["C:\\Female1_C03_Run.bvh"] 5: Added error checking and registered the package as an official importer for "BVH" files, so ...


28

Let you have a function and an initial point f[x_] := Cos[x] x0 = 0.2; Then you can calculate a sequence seq = NestList[f, x0, 10] (* {0.2, 0.980067, 0.556967, 0.848862, 0.660838, 0.789478, \ 0.704216, 0.76212, 0.723374, 0.749577, 0.731977} *) and vizualize it with a so-called Cobweb plot p = Join @@ ({{#, #}, {##}} & @@@ Partition[seq, 2, 1]); ...


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


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

dottie = FindRoot[Cos[x] == x, {x, 1}] // Values // First 0.739085 Plot[{Cos[x], x}, {x, -5, 5}, Epilog -> {Red, PointSize[0.02], Point[{dottie, dottie}]}] Convergence can be seen with EvaluationMonitor {res, {evx}} = Reap[FindRoot[Cos[x] == x, {x, 0}, EvaluationMonitor :> Sow[x]]] {{x -> 0.739085}, {{0., 1., 0.750364, 0.739113, ...


6

I tried to use the above mentioned codes for plotting error ellipses for 2D-Data. However, I did not get the anticipated results, because an error occured when Mathematica tried to solve the equality in the function Counterplot for my data. I found another solution based on the explicit calculation of the ellipse by means of covariance analysis. The ellipse ...


5

For SmoothKernelDistribution the option MaxExtraBandwidths controls "the extent to which the estimate will extend beyond the data". Its default value is 12 bandwidths. Despite the red syntax highlighting, this option also works in SmoothHistogram: dat = Flatten[{RandomReal[1., 10000], RandomReal[2., 2000]}]; SmoothHistogram[dat, .1, "PDF", ...


4

You can show the histogram as per eldo's classic histogram above by using HistogramDensity for the ChartElementFunction. Some datasets with outliers plot better with transformed data (such as log), but perhaps not this one. dat1 = Flatten[{RandomReal[1., 10000], RandomReal[2., 2000]}]; cht1=Table[DistributionChart[dat1, PlotRange -> {0., ...


2

Needs["MultivariateStatistics`"] data = Table[RandomVariate[BinormalDistribution[{50, 50}, {5, 7}, .8]], {1000}]; Show[ ListPlot[data, Epilog -> { Text[Framed["1.00", Background -> LightBlue], {45, 25}], Text[Framed["0.98", Background -> LightBlue], {50, 33}], Text[Framed["0.90", Background -> LightBlue], {55, 43}] }, ...


1

Two slight improvements to the code: [1] Using Function is faster: f[α_] = Function[x, α x (1 - x)]; [2] One should localise seq, and Riffle is clearer than Join @@ ({{#, #}, {##}} & @@@ logistic[α_, x0_] := Module[{seq}, seq = NestList[f[α], x0, 100]; p = Riffle[Transpose[{seq, seq}], Partition[seq, 2, 1]]; Plot[{f[α]][x], x}, {x, 0, ...


1

Sometimes, the file size and number of frames of a bvh file can be very large, one might skip every other frames to reduce the file size and cut half of the number of frames. The example below, has 3602 frames and 2,559KB in size, one can cut it into half with the following codes: srcFile = "https://www.dropbox.com/s/j4k5f4vfqb592tw/Dance01.bvh?dl=1"; ...



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