Using colormaps with plot() function
besthedgehog opened this issue · 1 comments
I'm a real fan of this library but I still cannot understand how to use colormaps (cool, spring, winter, tab20, coolwarm) when I use a plt.plot() function. I want to plot a continuous line like in your examples, that's why I need to use matplotlib.pyplot.plot() function, but the problem is that you cannot pass cmap parameter to plot().
I tried to set a default colormap but couldn't reach it.
I tried to do like this, but it didn't work
`
import matplotlib.pyplot as plt
import numpy as np
import mplcyberpunk
plt.style.use("cyberpunk")
plt.rcParams['image.cmap'] = 'winter'
x = np.linspace(-5, 5, 100)
y = np.sin(x)
plt.plot(x, y)
mplcyberpunk.add_glow_effects()
plt.show()
`
Please, could you write a code to plot a simple continuous function using a colormap?
Something I did:
mplcyberpunk.cyberpunk_stylesheets['cyberpunk']['axes.prop_cycle'] = cycler('color', ['#08F7FE', '#FE53BB', '#F5D300', '#00ff41', 'r', '#fe00fe', '#FF5733'])
example here: https://github.com/darkmatter2222/Kaggle_Tabular_Playground_Series-ML/blob/main/Jan-2023-S4/pipelines/Blending_ROC-AUC.ipynb