Python 3D Plot Error: 'ValueError: Axis limits cannot be NaN or Inf'
This error occurs when the values of 'min_range' or 'max_range' used to set the limits of the x-axis on a 3D plot are either NaN (Not a Number) or Inf (Infinity). These are invalid values that cannot be used as limits for the axis.
To resolve this error, you need to check the values of 'min_range' and 'max_range' and ensure that they are valid numbers. You can do this by printing their values before using them to set the limits of the x-axis, and checking if they are NaN or Inf.
If you find that 'min_range' or 'max_range' are NaN or Inf, you need to investigate why this is the case and fix the underlying issue. It could be that there is a bug in your code that is causing these invalid values to be generated, or there could be an issue with the data you are using.
Once you have identified and fixed the issue, you can rerun your code and set the limits of the x-axis using valid values, which should resolve the error.
原文地址: http://www.cveoy.top/t/topic/osyA 著作权归作者所有。请勿转载和采集!