how to change the colour of axes in matplotlin

Solutions on MaxInterview for how to change the colour of axes in matplotlin by the best coders in the world

showing results for - "how to change the colour of axes in matplotlin"
Gwenaëlle
04 Sep 2017
1import matplotlib.pyplot as plt
2with plt.rc_context({'axes.edgecolor':'orange', 'xtick.color':'red', 'ytick.color':'green', 'figure.facecolor':'white'}):
3    # Temporary rc parameters in effect
4    fig, (ax1, ax2) = plt.subplots(1,2)
5    ax1.plot(range(10))
6    ax2.plot(range(10))
7# Back to default rc parameters
8fig, ax = plt.subplots()
9ax.plot(range(10))
10