python绘制雨滴谱折线图

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

#!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 @ 2024-03-18 23:01  秋刀鱼CCC  Views(113)  Comments(0Edit  收藏  举报