[Python] Prevent scientific notation

Discussão em 'Python' iniciado por Stack, Abril 9, 2025.

  1. Stack

    Stack Membro Participativo

    I have the following code:

    plt.plot(range(2003,2012,1),range(200300,201200,100))
    # several solutions from other questions have not worked, including
    # plt.ticklabel_format(style='sci', axis='x', scilimits=(-1000000,1000000))
    # ax.get_xaxis().get_major_formatter().set_useOffset(False)
    plt.show()


    which produces the following plot:

    [​IMG]

    How do I prevent scientific notation here? Is ticklabel_format broken? does not resolve the issue of actually removing the offset.

    plt.plot(np.arange(1e6, 3 * 1e7, 1e6))
    plt.ticklabel_format(useOffset=False)


    [​IMG]

    Continue reading...

Compartilhe esta Página