这个警告意味着您的数据范围非常狭窄,导致无法进行正确的坐标轴转换。为了解决这个问题,可以尝试更改数据的范围或使用不同的坐标轴范围。例如,您可以手动设置x轴的范围,而不是让它自动扩展。可以使用以下代码来设置x轴范围:

import matplotlib.pyplot as plt

# your code for creating the plot

plt.xlim([xmin, xmax])  # set the x-axis range
plt.show()  # show the plot

其中,xmin和xmax是您想要设置的x轴最小和最大值。

Danalibsite-packagespandasplotting_matplotlibmiscpy424 UserWarningAttempting to set identical low and high xlims makes transformation singular; automatically expanding什么意思怎么改

原文地址: http://www.cveoy.top/t/topic/hhk7 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录