Say I have data about 3 trading strategies, each with and without transaction costs. I want to plot, on the same axes, the time series of each of the 6 variants (3 strategi
As an addition to the already excellent answers, you can consider using a colormap:
import matplotlib.pyplot as plt
import numpy as np
cmap = plt.cm.viridis
datarange = np.arange(4)
for d in datarange:
# generate colour by feeding float between 0 and 1 to colormap
color = cmap(d/np.max(datarange))
plt.plot(np.arange(5)+d, c=color)
for d in datarange:
# generate colour by feeding float between 0 and 1 to colormap
color = cmap(d/np.max(datarange))
plt.plot(-np.arange(5)+d, c=color)