Message Boards Message Boards

0
|
3522 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:

Regularity of dates in a list

Posted 11 years ago
 acz={{{2012, 12, 14}, 3035630}, {{2012, 12, 17}, 206878}, {{2012, 12, 18},
    390101}, {{2012, 12, 19}, 157317}, {{2012, 12, 20},
   75807}, {{2012, 12, 21}, 124552}, {{2012, 12, 27},
   88000}, {{2012, 12, 28}, 24568}, {{2013, 1, 2},
   48299}, {{2013, 1, 3}, 92190}, {{2013, 1, 4}, 31413}, {{2013, 1, 7},
    76905}, {{2013, 1, 8}, 80096}, {{2013, 1, 9},
   36619}, {{2013, 1, 10}, 62472}, {{2013, 1, 11},
   22522}, {{2013, 1, 14}, 161045}, {{2013, 1, 15},
   150706}, {{2013, 1, 16}, 155670}, {{2013, 1, 17},
  105254}, {{2013, 1, 18}, 71475}, {{2013, 1, 21},
  219650}, {{2013, 1, 22}, 407757}, {{2013, 1, 23},
  744541}, {{2013, 1, 24}, 131633}, {{2013, 1, 25},
  83268}, {{2013, 1, 28}, 233551}, {{2013, 1, 29},
  98357}, {{2013, 1, 30}, 138349}, {{2013, 1, 31},
  274154}, {{2013, 2, 1}, 194468}, {{2013, 2, 4},
  110558}, {{2013, 2, 5}, 196439}, {{2013, 2, 6},
  183396}, {{2013, 2, 7}, 84926}, {{2013, 2, 8},
  28963}, {{2013, 2, 11}, 26499}, {{2013, 2, 12},
  34485}, {{2013, 2, 13}, 48852}, {{2013, 2, 14},
  7413}, {{2013, 2, 15}, 15209}, {{2013, 2, 18},
  124622}, {{2013, 2, 19}, 257720}, {{2013, 2, 20},
  25460}, {{2013, 2, 21}, 13622}, {{2013, 2, 22},
  15625}, {{2013, 2, 25}, 24918}, {{2013, 2, 26},
  51883}, {{2013, 2, 27}, 75653}, {{2013, 2, 28},
  32869}, {{2013, 3, 1}, 70199}, {{2013, 3, 4}, 44323}, {{2013, 3, 5},
   15278}, {{2013, 3, 6}, 29398}, {{2013, 3, 7},
  244362}, {{2013, 3, 8}, 251160}, {{2013, 3, 11},
  109368}, {{2013, 3, 12}, 18913}, {{2013, 3, 13},
  104785}, {{2013, 3, 14}, 243837}, {{2013, 3, 15},
  87866}, {{2013, 3, 18}, 21769}, {{2013, 3, 19},
  177349}, {{2013, 3, 20}, 192884}, {{2013, 3, 21},
  60871}, {{2013, 3, 22}, 86142}, {{2013, 3, 25},
  26139}, {{2013, 3, 26}, 18698}, {{2013, 3, 27},
  13252}, {{2013, 3, 28}, 10115}, {{2013, 4, 2},
  48359}, {{2013, 4, 3}, 102263}, {{2013, 4, 4}, 43486}};

DateListPlot[acz,Filling ->Bottom,FillingStyle->Black,PlotRange->All]



Hello Everyone

Is there a solution to eliminate   gaps  in the axis timeline of the  plot
and get a smooth plot .
POSTED BY: Artur Kotarski
The purpose of DateListPlot is to plot the data point at the date they occur. If you want to remove the gaps in the x axis where there isn't data, then you don't want to use DateListPlot.

The first step would be to sort the data by date. Your data is already sorted by date, but if it weren't we could always run something like:
SortBy[acz, AbsoluteTime[First[#]] &]
Once this is done we can acces just the data points without the dates using acz[[All,2]] and give this to ListPlot:
ListPlot[acz[[All, 2]], Filling -> Bottom, FillingStyle -> Black, PlotRange -> All]
If you wanted to make an Interpolation of the data, you'd then use Plot like below:
Plot[Interpolation[acz[[All, 2]]][x], {x, 1, Length@acz}]
POSTED BY: Sean Clarke
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract