[Python] How to change border width of a matplotlib graph

Discussão em 'Python' iniciado por Stack, Maio 12, 2025.

  1. Stack

    Stack Membro Participativo

    How do I change the border width of a subplot?

    Code is as follows:

    fig = plt.figure(figsize = (4.1, 2.2))
    ax = fig.add_subplot(111)

    ax.patch.set_linewidth(0.1)
    ax.get_frame().set_linewidth(0.1)


    The last two lines do not work, but the following works fine:

    legend.get_frame().set_ linewidth(0.1)

    Continue reading...

Compartilhe esta Página