天气图

作者: 榴莲气象 | 来源:发表于2019-01-30 15:31 被阅读5次
# Or, let's make a full 500 hPa map with heights, temperature, winds, and humidity

# Select the data for this time and level
data_level = data.metpy.loc[{time.name: time[0], vertical.name: 500. * units.hPa}]

# Create the matplotlib figure and axis
fig, ax = [plt.subplots](https://matplotlib.org/api/_as_gen/matplotlib.pyplot.subplots.rst.html#matplotlib.pyplot.subplots "View documentation for matplotlib.pyplot.subplots")(1, 1, figsize=(12, 8), subplot_kw={'projection': data_crs})

# Plot RH as filled contours
rh = ax.contourf(x, y, data_level['relative_humidity'], levels=[70, 80, 90, 100],
                 colors=['#99ff00', '#00ff00', '#00cc00'])

# Plot wind barbs, but not all of them
wind_slice = slice(5, -5, 5)
ax.barbs(x[wind_slice], y[wind_slice],
         data_level['u'].metpy.unit_array[wind_slice, wind_slice].to('knots'),
         data_level['v'].metpy.unit_array[wind_slice, wind_slice].to('knots'),
         length=6)

# Plot heights and temperature as contours
h_contour = ax.contour(x, y, data_level['height'], colors='k', levels=range(5400, 6000, 60))
h_contour.clabel(fontsize=8, colors='k', inline=1, inline_spacing=8,
                 fmt='%i', rightside_up=True, use_clabeltext=True)
t_contour = ax.contour(x, y, data_level['temperature'], colors='xkcd:deep blue',
                       levels=range(-26, 4, 2), alpha=0.8, linestyles='--')
t_contour.clabel(fontsize=8, colors='xkcd:deep blue', inline=1, inline_spacing=8,
                 fmt='%i', rightside_up=True, use_clabeltext=True)

# Add geographic features
ax.add_feature(cfeature.LAND.with_scale('50m'), facecolor=cfeature.COLORS['land'])
ax.add_feature(cfeature.OCEAN.with_scale('50m'), facecolor=cfeature.COLORS['water'])
ax.add_feature(cfeature.STATES.with_scale('50m'), edgecolor='#c7c783', zorder=0)
ax.add_feature(cfeature.LAKES.with_scale('50m'), facecolor=cfeature.COLORS['water'],
               edgecolor='#c7c783', zorder=0)

# Set a title and show the plot
ax.set_title('500 hPa Heights (m), Temperature (\u00B0C), Humidity (%) at '
             + time[0].dt.strftime('%Y-%m-%d %H:%MZ'))
[plt.show](https://matplotlib.org/api/_as_gen/matplotlib.pyplot.show.rst.html#matplotlib.pyplot.show "View documentation for matplotlib.pyplot.show")()</pre>

https://unidata.github.io/MetPy/latest/tutorials/xarray_tutorial.html

相关文章

  • 天气图

  • 天气预报&收回

    一波超萌天气图来喽 简单又好画,想动起来吧! Fighting!!

  • 华山

    日期:2019.6.13-2019.6.14,附天气图 1、13日15:00准时高铁站售票大厅集合 2、所带东西:...

  • PS教程!你不得不知的常用技巧(11)

    11.写实风格的天气图标 完成效果: 1.打开PS,新建画布,大小为** 800 * 800**。 2.选择 圆角...

  • Weathertron,实时天气图表

    是的,又一个天气应用。 Weathertron,通用版,售价 ¥6。 与总让人感觉有些华而不实的 Solar、Ha...

  • PS练笔-天气图标

    临摹

  • 我的UI学习笔记

    使用软件AI 绘制天气图标-云 1、选择椭圆工具先绘制形状 2、复制椭圆并进行变形 3、将得到的图形进行联集 4、...

  • 7.4学习 把天气图像化

    大家好,今天我们来学习“把天气图像化”。写在前面的话: 天气变化多端,阴天、晴天、雨天、雪天、刮风、霜降、雷电等等...

  • 苹果自带天气图标大全

    经常使用苹果的天气来查看天气,偶然发现上面有一些图标不认识,所以特地整理了一下。天气图标代表不同的天气状况,例如,...

  • 天气图带中心值

    https://unidata.github.io/python-gallery/examples/HILO_Sy...

网友评论

      本文标题:天气图

      本文链接:https://www.haomeiwen.com/subject/cmlcsqtx.html