Matplotlib: Changing the color of an axis

后端 未结 3 1188
青春惊慌失措
青春惊慌失措 2020-11-27 14:29

Is there a way to change the color of an axis (not the ticks) in matplotlib? I have been looking through the docs for Axes, Axis, and Artist, but no luck; the matplotlib gal

3条回答
  •  [愿得一人]
    2020-11-27 14:37

    You can do it by adjusting the default rc settings.

    import matplotlib
    from matplotlib import pyplot as plt
    
    matplotlib.rc('axes',edgecolor='r')
    plt.plot([0, 1], [0, 1])
    plt.savefig('test.png')
    

提交回复
热议问题