【问题标题】:How to change Border width in MatPlotLib?如何更改 MatPlotLib 中的边框宽度?
【发布时间】:2021-06-17 11:56:33
【问题描述】:

我知道如何使边框可见/不可见和彩色(Graph With Customized borders)

但我不知道如何更改边框的宽度,有人可以帮我解决这个问题

【问题讨论】:

    标签: python matplotlib graph border customization


    【解决方案1】:
    import matplotlib.pyplot as plt
    
    fig = plt.figure()
    ax = fig.add_subplot(111)
    
    for axis in ['top', 'bottom', 'left', 'right']:
    
    ax.spines[axis].set_linewidth(2.5)  # change width
    ax.spines[axis].set_color('red')    # change color
    
    plt.show()
    

    【讨论】:

      猜你喜欢
      • 2010-12-11
      • 1970-01-01
      • 2021-04-03
      • 1970-01-01
      • 1970-01-01
      • 2013-09-25
      • 2021-12-30
      • 2017-12-29
      • 1970-01-01
      相关资源
      最近更新 更多