简体   繁体   中英

PyCharm - TypeError: set_ticks() got an unexpected keyword argument 'labels'

I am trying to run the example of a heatmap from: https://matplotlib.org/stable/gallery/images_contours_and_fields/image_annotated_heatmap.html

When I am running the code in PyCharm (Professional) in an Anaconda3 environment it results in an error message.

TypeError: set_ticks() got an unexpected keyword argument 'labels'

Thanks:)

There is no need to update matplotlib version if you are using version of matplotlib 3.4.3. Here is the link for matplotlib 3.4.3 documentation https://matplotlib.org/3.4.3/gallery/images_contours_and_fields/image_annotated_heatmap.html#sphx-glr-gallery-images-contours-and-fields-image-annotated-heatmap-py and avoid using labels keyword in ax.set_xticks() function as saind by JohnC

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM