计划使用python中处理气象的metpy包绘制气象中的斜温图(T-lnP)。运行报错无法解决。
import matplotlib.pyplot as plt
from metpy.plots import SkewT
from metpy.units import pandas_dataframe_to_unit_arrays, units
fig = plt.figure(figsize=(9, 11))
skew = SkewT(fig, rotation=45)
plt.show()
AttributeError: 'Line2D' object has no property ''
网络上我能找到的大部分资源都会说明缺少的 property,但我这里就是两个单字符号‘中间一个空格,无从下手。
可以搞明白解决方法和为什么没有对应的property。
变量Line2D没有property,这个模块的官方定义的问题,如果你想了解Line2D的定义,可以看官方文档
https://matplotlib.org/stable/api/_as_gen/matplotlib.lines.Line2D.html
遇到同样问题,各种操作与·不解决问题,困扰了半天。
把matplotlib将为3.4,🆗了。
感谢楼主。