# Make smooth plot from data

After some awesome tips from @qwerty I still have some doubts.

As I said, I'd Like to make a smooth function with some other colors, I plot the graph, there is a lot of data. The situation is this: I have a Geiger counter, and the data file rate is made minute by minute. So I have 30505 minutes in total. And the smooth have to be by 60 minutes and 1440 minutes. In the end, the same plot should have the data minute by minute, 60 by 60 and 1440 by 1440. I could be able to do just minute by minute using this

SetDirectory["D:\\Documents and Settings\\Física\\Desktop\\Pesquisa\\Dados_Chuva"];

data = Import["geiger_2015_06_30_ita.txt", "Table"];
ListLinePlot[data]
values = data[[;; , 2]];
ticks = data /. {x_, _} :> StringInsert[StringTake[#, {7, 10}]&@ToString[x], ":", 3]
f = Interpolation[values];
n = Length[data];
Plot[f[x], {x, 1, n}, AxesOrigin -> {0, 0},
Ticks -> {Transpose[{Range[n], Rotate[#, -45 Degree] & /@ ticks}],
Automatic}, ImageSize -> 500]


I got that pic:

I had an idea. Plot the data jumping 59 datas, so I would plot 1, 60, 120, 180, ... for example. This is possible?

The data is has two columns (150630102506; 17.142857) the first is date_month_day_hour_min_sec (x) and second is the geigercount (y).

Here there is a sample

## >150630102506 17.142857 150630102606 17.142857 150630102706 19.047619 150630102806 20.00 150630102906 15.238095 150630103006 27.619048 150630103106 20.00 150630103206 16.190476 150630103306 14.285714 150630103406 18.095238 150630103506 12.380952 150630103606 19.047619 150630103706 16.190476 150630103806 24.761905 150630103906 21.904762 150630104006 21.904762 150630104106 14.285714 150630104206 18.095238 150630104306 22.857143 150630104406 9.52381

***EDITED

With @Algohi's help I got here:

SetDirectory["D:\\Documents and Settings\\Física\\Desktop\\Pesquisa\\Dados_Chuva"];

data = Import["geiger_2015_06_30_ita.txt", "Table"];
values = data[[;; , 2]];
ticks = data /. {x_, _} :>
StringInsert[StringTake[#, {7, 10}] &@ToString[x], ":", 3]
f = Interpolation[values];
n = Length[data];
Plot[f[x], {x, 1, n}, AxesOrigin -> {0, 0},
Ticks -> {Transpose[{Range[n], Rotate[#, -45 Degree] & /@ ticks}],
Automatic}, ImageSize -> 500]
a = Join[{data[[1]]}, data[[60 ;; ;; 60, ;;]]]
b = data[[;; ;; 1440, ;;]]
values = a[[;; , 2]];
ticks = a /. {x_, _} :>
StringInsert[StringTake[#, {7, 10}] &@ToString[x], ":", 3]
f = Interpolation[values];
n = Length[a];
Plot[f[x], {x, 1, n}, AxesOrigin -> {0, 0},
Ticks -> {Transpose[{Range[n], Rotate[#, -45 Degree] & /@ ticks}],
Automatic}, ImageSize -> 500]
values = b[[;; , 2]];
ticks = b /. {x_, _} :>
StringInsert[StringTake[#, {7, 10}] &@ToString[x], ":", 3]
f = Interpolation[values];
n = Length[b];
Plot[f[x], {x, 1, n}, AxesOrigin -> {0, 0},
Ticks -> {Transpose[{Range[n], Rotate[#, -45 Degree] & /@ ticks}],
Automatic}, ImageSize -> 500]


But I still need to put it in the same plot.

• Join[{data[[1]]},data[[60;;;;60,;;]]] ? – Algohi Jan 21 '16 at 15:57
• Genius! Thats it man! It works. Tks – dcvilela Jan 21 '16 at 16:04
• It appears that there is some "structure" to your data that should be noted. The data occurs in "bursts" of 60 time steps followed by 41 time steps with no observations. Also the dependent variable when multiplied by 1.05 is a count (i.e., a non-negative integer). The mean and variance of the count bursts are approximately equal for all of the "bursts" so considering the data from a Poisson (or negative binomial) distribution might also be appropriate to consider. – JimB Jan 21 '16 at 16:52
• OK. I see now. The "gaps" that I see are the consequences of me treating the date/time string as is it were a continuous time measurement rather than the concatenation of month, day, hour, minute, and second. Sorry about that. – JimB Jan 21 '16 at 22:16
• There are contributors to this forum who have written functions to perform "loess" regressions but if you can't find those, I'd recommend calling the loess function in R from Mathematica (after turning the date/time string into a real time variable). – JimB Jan 21 '16 at 22:19