I would like to change matplotlib's default colors. As I already tried by myself and found a solution to my problem by changing the default color cycler, this is not the perfect solution I was looking for :
import matplotlib as mpl
mpl.rcParams['axes.prop_cycle'] = mpl.cycler(color=["#013c9b",# my Blue
"#e0012e",# my Red
"#80cd59",# my Green
"#f6960a",# my Orange
"#4f94d4",# my Light Blue
"#ffd800",# my Yellow
"#6f7072",# my Grey
])
x = np.linspace(1, 10, 1000)
for i in range(1, 6):
y = np.sin(i*x) * i
plt.plot(x,y)
While I achieve the results with the default color cycle, it is not very convenient if I want to plot with one of my specific color as I need to do something like that :
y1_in_red = np.sin(2*x) * 2
y2_in_green = np.sin(3*x) * 3
my_Red = "#e0012e" # <-it's not very convenient/clean to do that
my_Blue = "#80cd59" # <-it's not very convenient/clean to do that
plt.plot(x, y1_in_red, color=my_Red)
plt.plot(x, y2_in_green, color=my_Blue)
The first problem with this solution is the yticks but i can set it back to normal. The second problem is it is not as clean/as efficient as I want. I would like to know if there is a way to change the default red (and the other colors) of matplotlib so I can just do something like that to achieve the same result as above :
y1_in_red = np.sin(2*x) * 2
y2_in_green = np.sin(3*x) * 3
# ...
# some code
# ...
plt.plot(x, y1_in_red, color='r')
plt.plot(x, y2_in_green, color='b')

