Created
July 1, 2019 13:56
-
-
Save Raudcu/9e72c73208c41e7c3de3cdfb671eb3e1 to your computer and use it in GitHub Desktop.
Plotting lines using a matplotlib colormap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import matplotlib.cm as cmap | |
import matplotlib.colors as mcolors | |
rain = cmap.ScalarMappable(norm=mcolors.Normalize(vmin=0,vmax=1.), cmap='rainbow') | |
for i in range(10): | |
plt.plot(range(10), [x*i for x in range(10)], c=rain.to_rgba(i/10)) | |
plt.show() |
Author
Raudcu
commented
Jul 1, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment