What is the default color for Matplotlib plots?
2023
What is the default color for Matplotlib plots?
Answer: A. Blue — Answer: Blue — Matplotlib uses blue as the default color for line plots, and it is the first color in the default color cycle. Default color details: The…
- A.
Blue
- B.
Green
- C.
Black
- D.
Red
Attempted by 1905 students.
Show answer & explanation
Correct answer: A
Answer: Blue — Matplotlib uses blue as the default color for line plots, and it is the first color in the default color cycle.
Default color details: The specific color is referred to as 'tab:blue', and its hex code is #1f77b4.
To change the color for a single plot, pass the color argument, for example plt.plot(x, y, color='green') or plt.plot(x, y, color='g').
To change the global default, modify matplotlib.rcParams, for example by updating 'axes.prop_cycle' to a different color cycle.