python绘制雨滴谱折线图

 想画横坐标为时间,纵坐标为NT的折线图

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!usr/bin/env python
# -*- coding:utf-8 -*-
"""
@author: Su
@file: zhexiantu.py
@time: 2024/03/20
@desc:
"""
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
 
input_file = 'G:/呼和浩特新城区_second.xlsx'
 
df = pd.read_excel(input_file)
x_axis_data = df['时间']
y_axis_data = df['NT']
 
plt.plot(x_axis_data, y_axis_data,ls="-",alpha=0.5, linewidth=1, label='abc')
 
 
plt.legend
plt.gca().xaxis.set_major_locator(ticker.MultipleLocator(50))
plt.xlabel('time')
plt.ylabel('NT')
 
plt.show()

 

结果如图:

 

posted @   秋刀鱼CCC  Views(161)  Comments(0Edit  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
点击右上角即可分享
微信分享提示