[Python] Python matplotlib library

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

  1. Stack

    Stack Membro Participativo

    For below code, i keep getting the warning as below, can someone help to take a look and help me solve it? thank you!

    def prettify_graph(graph):
    graph.set_title("Results of 500 slot machine pulls")
    graph.set_ylim(bottom=0)
    graph.set_ylabel("Balance")
    ticks = graph.get_yticks()
    new_labels = ['${}'.format(int(amt)) for amt in ticks]
    graph.set_yticklabels(new_labels)

    graph = jimmy_slots.get_graph()
    prettify_graph(graph)
    graph


    /tmp/ipykernel_31/2021957972.py:18: UserWarning: FixedFormatter should only be used together with FixedLocator graph.set_yticklabels(new_labels)

    Continue reading...

Compartilhe esta Página