quantity_support#

astropy.visualization.quantity_support(format='latex_inline')[源代码]#

启用打印支持 astropy.units.Quantity matplotlib中的实例。

可(可选)与 with 语句。

>>> import matplotlib.pyplot as plt
>>> from astropy import units as u
>>> from astropy import visualization
>>> with visualization.quantity_support():
...     plt.figure()
...     plt.plot([1, 2, 3] * u.m)
[...]
...     plt.plot([101, 125, 150] * u.cm)
[...]
...     plt.draw()
参数:
format : astropy.units.format.Base instance or strAsterpy.units.Form.Base实例或python:str

格式或格式设置程序对象的名称。如果未提供,则默认为 latex_inline .