I have some code in Mathematica which shows a colored plot, where the coloring depends on data values. I would like to make this into an interactive application that accepts two inputs:
- data, a list of data points.
- PocetDat, an integer parameter.
I know little about CDF, but i don't see how I can get inputs or table inputs from the users. Further, I want the users of the application to only see the inputs and the final plot -- no code.
data =
{-0.003, 0.002, 0.008, 0.014, -0.026, -0.036, -0.042, -0.010, -0.000,
-0.014, -0.013, 0.048, 0.014, -0.035, -0.023, 0.025, 0.001, -0.002,
0.050, 0.053, 0.031, -0.045, 0.003, 0.052, 0.066, -0.040, 0.016,
-0.054, -0.040, -0.042, -0.018, -0.034, -0.032, -0.021, 0.008, -0.007};
PocetDat = 912;
KorelCiara = 2*Sqrt[1/PocetDat];
PRange = 1.2*Max[{data, KorelCiara}];
Show[
DiscretePlot[data[[i]], {i, 1, Length[data]},
ExtentSize -> Full,
ColorFunction -> Function[x, If[Abs[data[[x]]] > KorelCiara, Red, Blue]],
ColorFunctionScaling -> False],
Plot[{KorelCiara, -KorelCiara}, {x, 0, Length[data]}],
PlotRange -> {-PRange, PRange}]