[Python] how to set matplotlib figsize using axes and subplots

Discussão em 'Python' iniciado por Stack, Junho 18, 2025.

  1. Stack

    Stack Membro Participativo

    Hello I have a very basic plot with matplotlib but I want to be able to set the figure size I am confused about how to do this when not using multiple subplots. I am confused about the relationship between the figsize and subplots see code below:

    plt.figure(figsize=(10,10))

    y = np.arange(1,6,1)
    y1 = y**2
    y2 = y**3
    y3 = y**4
    x = np.arange(1,101,20)

    fig, ax = plt.subplots()
    ax.plot(x,y1)
    ax.plot(x,y2)
    ax.plot(x,y3)

    Continue reading...

Compartilhe esta Página