Group Abstract Group Abstract

Message Boards Message Boards

2
|
10.5K Views
|
7 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Fit a curve using dated data formatted for DateListPlot?

Show how to Fit a line or curve to this data (could not find it in Help):

data = {{{2006, 10, 1}, 10}, {{2006, 10, 15}, 12}, {{2006, 10, 30}, 15}, {{2006, 11, 20}, 20}};      
DateListPlot[data, Joined -> False]

Thank you, Jack Calman

POSTED BY: Jack Calman
7 Replies

There are different ways of doing this. One way would be to create a plot with a green line where you want green and make a plot with a red line where you want red. You can then combine the plots together with Show.

POSTED BY: Sean Clarke
POSTED BY: Jos Klaps

Hi Sean, A further question to your input. Can we have also different collors above and bellow the data points with ListLinePlot and the fitPlot? Example:

Filling->{1->{{2},{Red,Darker[Green]}}}

which are not working.

Thanks,...Jos

POSTED BY: Jos Klaps

Hi Sean,

See above. Sorry, It shoulld be 'Joined->True' instead of ListLinePlot.

Thanks,....Jos

POSTED BY: Jos Klaps
POSTED BY: Jack Calman
POSTED BY: Sean Clarke

Try first converting from date format to AbsoluteTime - which is not a list but a number. The rest should be easy.

{AbsoluteTime[#1], #2} & @@@ data

{{3368649600, 10}, {3369859200, 12}, {3371155200, 15}, {3372969600, 20}}

POSTED BY: Sam Carrettie
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard