当前位置:首页>python>python入门- Matplotlib 数据可视化库

python入门- Matplotlib 数据可视化库

  • 2026-01-29 18:08:59
python入门- Matplotlib 数据可视化库

python入门- Matplotlib 数据可视化库

概述

Matplotlib 是 Python 中最基础、最流行的数据可视化库。它提供了完整的 2D 绘图系统(部分 3D 支持),可以生成出版质量级别的图表,几乎可以绘制任何类型的图表。

  • • 官网: https://matplotlib.org/
  • • GitHub: https://github.com/matplotlib/matplotlib
  • • 文档: https://matplotlib.org/stable/contents.html
  • • 画廊: https://matplotlib.org/stable/gallery/index.html

核心特性

  • • 图表类型丰富: 折线图、柱状图、散点图、饼图、直方图、箱线图等
  • • 高度可定制: 颜色、样式、标签、图例、注释等
  • • 多种输出格式: PNG、JPG、PDF、SVG、EPS 等
  • • 多平台支持: Windows、macOS、Linux
  • • 集成性强: 与 NumPy、Pandas、SciPy 无缝集成
  • • 交互式绘图: 支持 Jupyter Notebook、IPython 交互

安装与导入

安装

# 基础安装pip install matplotlib# 使用 condaconda install matplotlib# 安装完整功能(包括可选依赖)pip install matplotlib[complete]

导入

# 标准导入方式import matplotlib.pyplot as pltimport numpy as np# 设置中文显示(可选)plt.rcParams['font.sans-serif'] = ['Arial Unicode MS''SimHei']plt.rcParams['axes.unicode_minus'] = False# Jupyter Notebook 中内嵌显示%matplotlib inline

基础绘图流程

最简单的绘图

import matplotlib.pyplot as pltimport numpy as np# 准备数据x = np.linspace(010100)y = np.sin(x)# 创建图表plt.figure(figsize=(106))# 绘图plt.plot(x, y)# 添加标签plt.xlabel('x')plt.ylabel('sin(x)')plt.title('正弦函数')# 显示图表plt.show()

面向对象式绘图(推荐)

# 创建图形和坐标轴fig, ax = plt.subplots(figsize=(106))# 在坐标轴上绘图ax.plot(x, y, label='sin(x)')ax.plot(x, np.cos(x), label='cos(x)')# 设置属性ax.set_xlabel('x')ax.set_ylabel('y')ax.set_title('三角函数')ax.legend()ax.grid(True)plt.show()

常用图表类型

1. 折线图 (Line Plot)

# 基础折线图x = [12345]y = [246810]plt.figure(figsize=(106))plt.plot(x, y, marker='o', linestyle='-', color='blue', label='数据线')plt.xlabel('X 轴')plt.ylabel('Y 轴')plt.title('折线图示例')plt.legend()plt.grid(True)plt.show()# 多条折线x = np.linspace(010100)fig, ax = plt.subplots(figsize=(106))ax.plot(x, np.sin(x), label='sin(x)', color='blue')ax.plot(x, np.cos(x), label='cos(x)', color='red')ax.plot(x, np.tan(x), label='tan(x)', color='green')ax.set_ylim(-22)  # 限制 y 轴范围ax.legend()ax.set_title('三角函数对比')plt.show()

2. 散点图 (Scatter Plot)

# 基础散点图x = np.random.randn(100)y = np.random.randn(100)colors = np.random.rand(100)sizes = np.random.rand(100) * 1000plt.figure(figsize=(106))plt.scatter(x, y, c=colors, s=sizes, alpha=0.5, cmap='viridis')plt.xlabel('X 值')plt.ylabel('Y 值')plt.title('散点图示例')plt.colorbar(label='颜色值')plt.show()# 分类散点图fig, ax = plt.subplots(figsize=(106))for i, (label, color) inenumerate([('A''red'), ('B''blue'), ('C''green')]):    x = np.random.randn(50) + i    y = np.random.randn(50) + i    ax.scatter(x, y, label=label, color=color, alpha=0.6)ax.legend()ax.set_title('分类散点图')plt.show()

3. 柱状图 (Bar Chart)

# 垂直柱状图categories = ['A''B''C''D''E']values = [2345567832]fig, ax = plt.subplots(figsize=(106))ax.bar(categories, values, color='skyblue', edgecolor='black')ax.set_xlabel('类别')ax.set_ylabel('数值')ax.set_title('柱状图示例')plt.show()# 分组柱状图x = np.arange(5)width = 0.35y1 = [2035303527]y2 = [2532342025]fig, ax = plt.subplots(figsize=(106))ax.bar(x - width/2, y1, width, label='2023', color='blue')ax.bar(x + width/2, y2, width, label='2024', color='orange')ax.set_xticks(x)ax.set_xticklabels(['A''B''C''D''E'])ax.legend()ax.set_title('分组柱状图')plt.show()# 堆叠柱状图fig, ax = plt.subplots(figsize=(106))ax.bar(categories, y1, label='产品A', color='blue')ax.bar(categories, y2, bottom=y1, label='产品B', color='orange')ax.legend()ax.set_title('堆叠柱状图')plt.show()# 水平柱状图fig, ax = plt.subplots(figsize=(106))ax.barh(categories, values, color='lightcoral')ax.set_xlabel('数值')ax.set_title('水平柱状图')plt.show()

4. 直方图 (Histogram)

# 基础直方图data = np.random.randn(1000)fig, ax = plt.subplots(figsize=(106))ax.hist(data, bins=30, color='green', alpha=0.7, edgecolor='black')ax.set_xlabel('值')ax.set_ylabel('频数')ax.set_title('直方图示例')plt.show()# 多个分布对比data1 = np.random.normal(011000)data2 = np.random.normal(211000)fig, ax = plt.subplots(figsize=(106))ax.hist(data1, bins=30, alpha=0.5, label='分布1', color='blue')ax.hist(data2, bins=30, alpha=0.5, label='分布2', color='red')ax.legend()ax.set_title('分布对比')plt.show()# 堆叠直方图fig, ax = plt.subplots(figsize=(106))ax.hist([data1, data2], bins=30, stacked=True, label=['分布1''分布2'])ax.legend()ax.set_title('堆叠直方图')plt.show()

5. 饼图 (Pie Chart)

# 基础饼图labels = ['A''B''C''D']sizes = [15304510]colors = ['gold''yellowgreen''lightcoral''lightskyblue']explode = (00.100)  # 突出显示第二块fig, ax = plt.subplots(figsize=(88))ax.pie(sizes, explode=explode, labels=labels, colors=colors,       autopct='%1.1f%%', shadow=True, startangle=90)ax.axis('equal')  # 使饼图是圆形ax.set_title('饼图示例')plt.show()# 环形图fig, ax = plt.subplots(figsize=(88))ax.pie(sizes, labels=labels, colors=colors, autopct='%1.1f%%',       pctdistance=0.85, startangle=90)# 绘制中心圆centre_circle = plt.Circle((00), 0.70, fc='white')ax.add_artist(centre_circle)ax.axis('equal')ax.set_title('环形图示例')plt.show()

6. 箱线图 (Box Plot)

# 基础箱线图data = [np.random.normal(0, std, 100for std inrange(14)]fig, ax = plt.subplots(figsize=(106))ax.boxplot(data, labels=['A''B''C'])ax.set_xlabel('类别')ax.set_ylabel('值')ax.set_title('箱线图示例')plt.show()# 水平箱线图fig, ax = plt.subplots(figsize=(106))ax.boxplot(data, labels=['A''B''C'], vert=False)ax.set_xlabel('值')ax.set_title('水平箱线图')plt.show()# 箱线图与散点结合fig, ax = plt.subplots(figsize=(106))bp = ax.boxplot(data, labels=['A''B''C'])# 添加散点for i, d inenumerate(data):    y = d    x = np.random.normal(i+10.04, size=len(d))    ax.plot(x, y, 'r.', alpha=0.3)ax.set_title('箱线图 + 散点')plt.show()

7. 热力图 (Heatmap)

# 生成相关矩阵data = np.random.randn(1010)corr = np.corrcoef(data)fig, ax = plt.subplots(figsize=(108))im = ax.imshow(corr, cmap='coolwarm', aspect='auto')ax.set_xticks(range(10))ax.set_yticks(range(10))ax.set_xticklabels(range(111))ax.set_yticklabels(range(111))plt.colorbar(im, label='相关系数')ax.set_title('热力图示例')plt.show()# 带注释的热力图fig, ax = plt.subplots(figsize=(108))im = ax.imshow(corr, cmap='RdYlGn')for i inrange(len(corr)):for j inrange(len(corr)):        text = ax.text(j, i, f'{corr[i, j]:.2f}',                      ha="center", va="center", color="black")plt.colorbar(im)ax.set_title('带注释的热力图')plt.show()

8. 面积图 (Area Plot)

# 基础面积图x = np.arange(10)y1 = np.random.randint(11010)y2 = np.random.randint(11010)fig, ax = plt.subplots(figsize=(106))ax.stackplot(x, y1, y2, labels=['A''B'], alpha=0.8)ax.set_xlabel('X')ax.set_ylabel('Y')ax.legend(loc='upper left')ax.set_title('堆叠面积图')plt.show()# 填充区域x = np.linspace(010100)y1 = np.sin(x)y2 = np.cos(x)fig, ax = plt.subplots(figsize=(106))ax.plot(x, y1, label='sin(x)')ax.plot(x, y2, label='cos(x)')ax.fill_between(x, y1, y2, alpha=0.3, label='填充区域')ax.legend()ax.set_title('填充区域图')plt.show()

9. 误差棒图 (Error Bar)

x = np.arange(5)y = [2035303527]error = [23423]fig, ax = plt.subplots(figsize=(106))ax.errorbar(x, y, yerr=error, fmt='o', color='blue',            ecolor='red', elinewidth=2, capsize=5)ax.set_xlabel('类别')ax.set_ylabel('值')ax.set_title('误差棒图示例')plt.show()

10. 极坐标图 (Polar Plot)

# 极坐标折线图theta = np.linspace(02*np.pi, 100)r = 2 * np.sin(3*theta)fig, ax = plt.subplots(figsize=(88), subplot_kw=dict(projection='polar'))ax.plot(theta, r, color='blue', linewidth=2)ax.fill(theta, r, alpha=0.3)ax.set_title('极坐标图示例', pad=20)plt.show()# 雷达图categories = ['A''B''C''D''E']values = [43542]values += values[:1]  # 闭合angles = np.linspace(02*np.pi, len(categories), endpoint=False)angles = np.concatenate((angles, [angles[0]]))fig, ax = plt.subplots(figsize=(88), subplot_kw=dict(projection='polar'))ax.plot(angles, values, 'o-', linewidth=2)ax.fill(angles, values, alpha=0.25)ax.set_xticks(angles[:-1])ax.set_xticklabels(categories)ax.set_title('雷达图示例', pad=20)plt.show()

子图与布局

基础子图

# 创建多个子图fig, axes = plt.subplots(22, figsize=(1210))# 第一个子图axes[00].plot([123], [149])axes[00].set_title('折线图')# 第二个子图axes[01].scatter([123], [149])axes[01].set_title('散点图')# 第三个子图axes[10].bar(['A''B''C'], [352])axes[10].set_title('柱状图')# 第四个子图axes[11].hist(np.random.randn(100), bins=20)axes[11].set_title('直方图')plt.tight_layout()  # 自动调整布局plt.show()

不规则子图布局

# 使用 GridSpecfig = plt.figure(figsize=(128))gs = fig.add_gridspec(33)# 大图(占前两行和前两列)ax1 = fig.add_subplot(gs[0:20:2])ax1.plot(np.random.randn(50))ax1.set_title('大图')# 右上角小图ax2 = fig.add_subplot(gs[02])ax2.bar(['A''B'], [35])ax2.set_title('右上小图')# 右中图ax3 = fig.add_subplot(gs[12])ax3.scatter(np.random.randn(20), np.random.randn(20))ax3.set_title('右中图')# 底部长条图ax4 = fig.add_subplot(gs[2, :])ax4.plot(np.random.randn(100))ax4.set_title('底部图')plt.tight_layout()plt.show()

嵌套子图

from mpl_toolkits.axes_grid1.inset_locator import inset_axesfig, ax = plt.subplots(figsize=(106))# 主图x = np.linspace(010100)ax.plot(x, np.sin(x), label='sin(x)')ax.plot(x, np.cos(x), label='cos(x)')ax.legend()ax.set_title('主图')# 嵌套小图axins = inset_axes(ax, width="40%", height="30%", loc='upper right')axins.plot(x, np.sin(x), color='red')axins.set_xlim(02)axins.set_ylim(-0.21)axins.set_title('放大视图')plt.show()

样式与美化

内置样式

# 查看可用样式print(plt.style.available)# 使用样式plt.style.use('seaborn-v0_8-darkgrid')# 临时使用样式with plt.style.context('ggplot'):    plt.plot([123], [149])    plt.title('临时使用 ggplot 样式')    plt.show()

自定义颜色

# 颜色设置方式fig, ax = plt.subplots(figsize=(106))x = np.arange(5)# 颜色名称ax.bar(x, [12345], color=['red''blue''green''orange''purple'])# 十六进制颜色# ax.plot(x, y, color='#1f77b4')# RGB 元组# ax.plot(x, y, color=(0.1, 0.2, 0.5))# RGBA(带透明度)# ax.plot(x, y, color=(0.1, 0.2, 0.5, 0.7))# 灰度# ax.plot(x, y, color='0.5')plt.show()

线条样式与标记

fig, ax = plt.subplots(figsize=(126))x = np.arange(10)# 线型: '-', '--', '-.', ':', 'None', ' ', ''ax.plot(x, x+1, linestyle='-', label='实线')ax.plot(x, x+2, linestyle='--', label='虚线')ax.plot(x, x+3, linestyle='-.', label='点划线')ax.plot(x, x+4, linestyle=':', label='点线')# 标记: 'o', 's', '^', 'v', '<', '>', 'p', '*', 'h', '+', 'x', 'D'ax.plot(x, x+6, marker='o', linestyle='None', label='圆形标记')ax.plot(x, x+7, marker='s', linestyle='None', label='方形标记')ax.plot(x, x+8, marker='^', linestyle='None', label='三角标记')ax.legend()ax.set_title('线型与标记')plt.show()

文本与字体

fig, ax = plt.subplots(figsize=(106))x = np.linspace(010100)ax.plot(x, np.sin(x))# 标题和标签ax.set_title('标题', fontsize=16, fontweight='bold')ax.set_xlabel('X 轴标签', fontsize=12)ax.set_ylabel('Y 轴标签', fontsize=12)# 文本注释ax.text(50.5'文本注释', fontsize=12, bbox=dict(facecolor='yellow', alpha=0.5))# 箭头注释ax.annotate('峰值', xy=(1.571), xytext=(30.5),            arrowprops=dict(facecolor='black', shrink=0.05))# 数学公式(使用 LaTeX)ax.text(70.5r'$\sin(x) = \sum_{n=0}^{\infty} \frac{(-1)^n}{(2n+1)!}x^{2n+1}$',        fontsize=12)plt.show()

图例

fig, ax = plt.subplots(figsize=(106))x = np.linspace(010100)ax.plot(x, np.sin(x), label='sin(x)', linewidth=2)ax.plot(x, np.cos(x), label='cos(x)', linewidth=2)ax.plot(x, np.tan(x), label='tan(x)', linewidth=2)# 图例位置ax.legend(loc='upper right')  # 'best', 'upper right', 'upper left', 'lower left' 等# 自定义图例ax.legend(    loc='upper left',    fontsize=12,    framealpha=0.9,    shadow=True,    fancybox=True,    ncol=3# 多列)ax.set_ylim(-22)plt.show()

网格与坐标轴

fig, ax = plt.subplots(figsize=(106))x = np.linspace(010100)ax.plot(x, np.sin(x))# 网格ax.grid(True, linestyle='--', alpha=0.5)# ax.grid(False)  # 关闭网格# 仅主网格/次网格ax.grid(which='major', linestyle='-', linewidth='0.5', color='gray')ax.grid(which='minor', linestyle=':', linewidth='0.5', color='gray')ax.minorticks_on()# 坐标轴范围ax.set_xlim(010)ax.set_ylim(-1.51.5)# 对数坐标# ax.set_yscale('log')# ax.set_xscale('log')# 双Y轴ax2 = ax.twinx()ax2.plot(x, x, color='red', label='线性')ax2.set_ylabel('右侧 Y 轴')plt.show()

3D 绘图

from mpl_toolkits.mplot3d import Axes3D# 3D 曲面图fig = plt.figure(figsize=(126))# 第一个图:3D 折线ax1 = fig.add_subplot(121, projection='3d')x = np.linspace(-55100)y = np.linspace(-55100)X, Y = np.meshgrid(x, y)Z = np.sin(np.sqrt(X**2 + Y**2))ax1.plot_surface(X, Y, Z, cmap='viridis')ax1.set_title('3D 曲面图')# 第二个图:3D 散点ax2 = fig.add_subplot(122, projection='3d')x = np.random.randn(100)y = np.random.randn(100)z = np.random.randn(100)colors = np.random.rand(100)ax2.scatter(x, y, z, c=colors, cmap='coolwarm')ax2.set_title('3D 散点图')plt.tight_layout()plt.show()# 3D 等高线图fig = plt.figure(figsize=(108))ax = fig.add_subplot(111, projection='3d')ax.plot_surface(X, Y, Z, cmap='viridis', alpha=0.8)ax.contour(X, Y, Z, zdir='z', offset=-2, cmap='coolwarm')ax.set_zlim(-22)ax.set_title('3D 等高线图')plt.show()

与 Pandas 集成

import pandas as pd# 创建示例数据df = pd.DataFrame({'Date': pd.date_range('2024-01-01', periods=100),'Value1': np.random.randn(100).cumsum(),'Value2': np.random.randn(100).cumsum(),'Category': np.random.choice(['A''B''C'], 100)})# 使用 Pandas 绘图fig, axes = plt.subplots(22, figsize=(1410))# 折线图df.plot(x='Date', y=['Value1''Value2'], ax=axes[00])axes[00].set_title('折线图')axes[00].set_xlabel('日期')# 柱状图df.groupby('Category').size().plot(kind='bar', ax=axes[01], color='skyblue')axes[01].set_title('类别计数')axes[01].set_xlabel('类别')# 直方图df['Value1'].plot(kind='hist', bins=20, ax=axes[10], edgecolor='black')axes[10].set_title('值分布')# 箱线图df.boxplot(column=['Value1''Value2'], ax=axes[11])axes[11].set_title('箱线图')plt.tight_layout()plt.show()

保存图表

fig, ax = plt.subplots(figsize=(106))ax.plot([1234], [14916])# 保存为不同格式plt.savefig('figure.png', dpi=300, bbox_inches='tight')           # PNGplt.savefig('figure.pdf', bbox_inches='tight')                     # PDFplt.savefig('figure.svg', bbox_inches='tight')                     # SVGplt.savefig('figure.jpg', quality=95, bbox_inches='tight')         # JPG# 透明背景plt.savefig('figure_transparent.png', transparent=True)# 指定尺寸plt.savefig('figure_custom.png', dpi=300, figsize=(106))plt.show()

交互式绘图

# 交互式缩放和平移plt.ion()  # 开启交互模式fig, ax = plt.subplots(figsize=(106))x = np.linspace(010100)line, = ax.plot(x, np.sin(x))# 更新数据for i inrange(5):    line.set_ydata(np.sin(x + i))    plt.pause(0.5)plt.ioff()  # 关闭交互模式plt.show()

最佳实践

1. 清晰的标签和标题

fig, ax = plt.subplots(figsize=(106))ax.plot(x, y)ax.set_xlabel('时间 (天)', fontsize=12)      # 清晰的轴标签ax.set_ylabel('销售额 (万元)', fontsize=12)ax.set_title('2024年上半年销售趋势', fontsize=14, fontweight='bold')

2. 合理的颜色选择

# 使用配色方案from matplotlib import cmcolors = cm.viridis(np.linspace(015))# 或使用色盲友好的配色colors = ['#1f77b4''#ff7f0e''#2ca02c''#d62728''#9467bd']

3. 适当的图表尺寸

# 根据用途设置尺寸# 论文/报告: figsize=(6, 4) 或 (8, 6)# 演示文稿: figsize=(10, 6) 或 (12, 8)# 高分辨率保存: dpi=300

4. 使用面向对象 API

# 推荐:面向对象fig, ax = plt.subplots(figsize=(106))ax.plot(x, y)# 不推荐:pyplot 接口(复杂图表时)plt.figure(figsize=(106))plt.plot(x, y)

5. 分离数据和可视化

# 数据处理defprepare_data():return df.groupby('Category').agg({'Value''mean'})# 可视化defplot_bar(data):    fig, ax = plt.subplots(figsize=(106))    data.plot(kind='bar', ax=ax)return fig, axdata = prepare_data()fig, ax = plot_bar(data)

相关资源

官方文档

  • • Matplotlib 官方文档
  • • Matplotlib 画廊
  • • Matplotlib 教程

推荐资源

  • • Python Graph Gallery
  • • Awesome Matplotlib

相关库

  • • Seaborn: 统计可视化库(基于 Matplotlib)
  • • Plotly: 交互式可视化
  • • Bokeh: 交互式 Web 可视化
  • • Altair: 声明式可视化

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-07 23:51:29 HTTP/2.0 GET : https://f.mffb.com.cn/a/468859.html
  2. 运行时间 : 0.250950s [ 吞吐率:3.98req/s ] 内存消耗:4,929.16kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=d9462ed11d7081fb25ac7667a611c9ef
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000632s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001144s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000480s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000459s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001144s ]
  6. SELECT * FROM `set` [ RunTime:0.002077s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001198s ]
  8. SELECT * FROM `article` WHERE `id` = 468859 LIMIT 1 [ RunTime:0.002533s ]
  9. UPDATE `article` SET `lasttime` = 1770479489 WHERE `id` = 468859 [ RunTime:0.060131s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000842s ]
  11. SELECT * FROM `article` WHERE `id` < 468859 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.002228s ]
  12. SELECT * FROM `article` WHERE `id` > 468859 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.004501s ]
  13. SELECT * FROM `article` WHERE `id` < 468859 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.005618s ]
  14. SELECT * FROM `article` WHERE `id` < 468859 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.018641s ]
  15. SELECT * FROM `article` WHERE `id` < 468859 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.025368s ]
0.254410s