0

I'm plotting large data sets. The data is cyclical. Without using a color gradient, it is very difficult to understand how the data is evolving because of it's cyclical behavior. Multiple data sets are plotted at once, so asking a data set to change between colors is out of the question. example figure

How can I make my line's color darken with index and still use a legend?

EDIT: (editing for clarity and fulfilling the request for a minimum working example)

I want my dataset's color to change it's shade from lighter to darker as the index increases. What I'm trying to do I still need the legend to work however.

Miniumum working example code:

import pandas as pd
import matplotlib.pyplot as plt

x = range(0,1000)
y = []
for i in x:
    y.append(2*x[i])
    i+=1

plt.plot(x,y, label = "poop")
plt.legend()
plt.show()
  • You're question is too broad. From you legend it seems that you are plotting just two functions of V? If so, I really don't understand what you mean. In instead you are plotting many 'functions' the solution is simply to use a `color` drawn from a colormap. Anyway making your question more specific, with a minimal working example, is needed here. – Tom de Geus Jul 06 '18 at 06:57
  • Edited. I apologize. I thought that was clear enough "how can I make my line's color shade darken with increasing index". – Luke William Jul 06 '18 at 11:58

0 Answers0