Message Boards Message Boards

0
|
2718 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Changing color of DateListPlot of time series based on another time series

Posted 2 years ago

I'd like to find a way to use a coloring function for the plot of my time series based on another time series (on the same time frame).

For example:

BTC = FinancialData["BTC/USD", {{2013, 1, 1}, {2013, 1, 31}, "Day"}]
wd = WeatherData["Chicago", 
  "Temperature", {{2013, 1, 1}, {2013, 1, 31}, "Day"}]

Are two different time series on the same period and the same sampling time. I may want to plot the first one using a color function of the second one. Like:

DateListPlot[BTC, ColorFunction -> "TemperatureMap"]

But with "TemperatureMap" based on wd. Is that possible?

POSTED BY: Francesco Lasco
2 Replies
Posted 2 years ago

POSTED BY: Eric Rimbey

Thank you Eric, I ended up doing something similar but your code is really more versatile so I'll probably switch to your implementation for my application. Not knowing about interpolating functions I had to build one from scratch.

Also, nice trick getting the values passed to color function, I had to just "guess" :). Thanks again!

POSTED BY: Francesco Lasco
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