python 绘制折线图包括设置字体折线粗细以及标题立方m等
#!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()