深圳24小时平均风速(隐藏部分轴脊)

import numpy as np
from datetime import datetime
import matplotlib.pyplot as plt
from matplotlib.dates import DateFormatter,HourLocator
plt.rcParams["font.sans-serif"]=["SimHei"]
plt.rcParams["axes.unicode_minus"]=False
dates=['201910240','2019102402','2019102404','2019102406','2019102408','2019102410','2019102412','2019102414','2019102416',
       '2019102418','2019102420','2019102422','201910250']
x_date=[datetime.strptime(d,'%Y%m%d%H') for d in dates]
y_data=np.array([7,9,11,14,8,15,22,11,10,11,11,13,8])
fig=plt.figure()
ax=fig.add_axes((0.0,0.0,1.0,1.0))
ax.plot(x_date,y_data,'->',ms=8,mfc='#FF9900')
ax.set_title('深圳市24小时平均风速')
ax.set_xlabel('时间')
ax.set_ylabel('平均风速(km/h)')
date_fmt=DateFormatter('%H:%M')
ax.xaxis.set_major_formatter(date_fmt)
ax.xaxis.set_major_locator(HourLocator(interval=2))
ax.tick_params(direction='in',length=6,width=2,labelsize=12)
ax.xaxis.set_tick_params(labelrotation=45)
ax.spines['top'].set_color('none')
ax.spines['right'].set_color('none')
plt.show()

  • 4
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值