UserWarning: FixeFormatter sollte nur zusammen mit FixedLocator verwendet werdenPython

Python-Programme
Anonymous
 UserWarning: FixeFormatter sollte nur zusammen mit FixedLocator verwendet werden

Post by Anonymous »

Ich habe lange kleine Subroutinen verwendet, um Achsen von Diagrammen zu formatieren, die ich plane. Ein paar Beispiele: < /p>
def format_y_label_thousands(): # format y-axis tick labels formats
ax = plt.gca()
label_format = '{:,.0f}'
ax.set_yticklabels([label_format.format(x) for x in ax.get_yticks().tolist()])

def format_y_label_percent(): # format y-axis tick labels formats
ax = plt.gca()
label_format = '{:.1%}'
ax.set_yticklabels([label_format.format(x) for x in ax.get_yticks().tolist()])
< /code>
Nach einem Update auf Matplotlib gestern habe ich die folgende Warnung, wenn ich eine dieser beiden Funktionen aufzurufen: < /p>
UserWarning: FixedFormatter should only be used together with FixedLocator
ax.set_yticklabels([label_format.format(x) for x in ax.get_yticks().tolist()])
< /code>
Was ist der Grund für eine solche Warnung? Ich konnte es nicht herausfinden, in Matplotlibs Dokumentation zu untersuchen.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post