#!usr/bin/env python # -*- coding:utf-8 -*- """ @author: Suyue @file: flyzhexian.py @time: 2024/09/04 @desc: """ import pandas as pd import matplotlib import matplotlib.pyplot as plt import matplotlib.ticker as ticker matplotlib.rc("font",family='YouYuan') matplotlib.use('TkAgg') input_file = '/PIP.csv' df = pd.read_csv(input_file) x_axis_data = df['time2'] y_axis_data = df['PIP'] plt.tick_params(labelsize=13) plt.plot(x_axis_data, y_axis_data, ls="-", alpha=0.5, linewidth=3, label='abc',color='black') plt.legend plt.gca().xaxis.set_major_locator(ticker.MultipleLocator(30)) plt.xlabel('时间',fontsize=15) plt.ylabel('PIP数浓度(个/'+'${cm^3}$)',fontsize=15) plt.show()
标签:plt,python,matplotlib,折线,file,折线图,import,data,axis From: https://www.cnblogs.com/shirleysu90/p/18396964