I have some time series data that I want to plot, and I want to use color scaling to represent the age of a datapoint. I can successfully get the colour bar working:
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from matplotlib.dates import date2num
x = np.random.randint(low=0, high=10, size=10)
y = np.random.randint(low=0, high=10, size=10)
dates = pd.date_range("2000-01-01", end="2000-01-10", freq="D")
df = pd.DataFrame({"x": x, "y": y, "dates": dates})
sc = plt.scatter(df["x"], df["y"], c=[date2num(i) for i in df["dates"]])
plt.colorbar(sc)
plt.savefig("dates.png")
However, I don't understand how to use the built in colour maps, like the perceptually uniform or sequential colour maps. How do I use a built in colour map as c
when calling scatter?