当前位置:首页>python>一起学Python第109天:Matplotlib 多子图布局

一起学Python第109天:Matplotlib 多子图布局

  • 2026-06-29 13:00:33
一起学Python第109天:Matplotlib 多子图布局

一、为什么需要多子图?

想象一下:你要做一份销售分析报告,需要同时展示趋势图、占比图、对比图、分布图……如果每张图单独保存,读者得来回切换,体验极差。

多子图(Subplot) 就是解决方案——把多个图表像拼图一样拼进一张大图里,一屏看完所有关键信息

二、两种核心方法:subplot() vs subplots()

💡 推荐:新手先用 subplot() 理解原理,实际项目用 subplots() 更高效。

三、subplot():逐个定位法

核心语法

plt.subplot(nrows, ncols, index)# 或简写:plt.subplot(行数, 列数, 位置编号)
编号规则:从左到右、从上到下,从 1 开始计数。
1x2 布局:          2x2 布局:┌─────┬─────┐     ┌─────┬─────┐│  1  │  2  │     │  1  │  2  │└─────┴─────┘     ├─────┼─────┤                    │  3  │  4  │                    └─────┴─────┘

示例 1:1行2列并排对比

import numpy as npimport matplotlib.pyplot as pltimport matplotlib.font_manager as fmimport os# ================= 1. 字体加载(解决中文乱码的核心) =================font_path = "simhei.ttf"  # 确保当前目录有 simhei.ttfif not os.path.exists(font_path):    font_path = "/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc"  # 备用系统字体prop = fm.FontProperties(fname=font_path)plt.rcParams['axes.unicode_minus'] = False# 数据准备x = np.array([06])y1 = np.array([0100])x2 = np.array([1234])y2 = np.array([14916])# 子图1:位置 (1, 2, 1) = 第1行第2列的第1个plt.subplot(121)plt.plot(x, y1)plt.title("线性增长", fontproperties=prop)# 子图2:位置 (1, 2, 2) = 第1行第2列的第2个plt.subplot(122)plt.plot(x2, y2)plt.title("指数增长", fontproperties=prop)# 总标题plt.suptitle("增长模式对比", fontproperties=prop, fontsize=16)plt.tight_layout()  # 自动调整间距plt.show()

示例 2:2行2列四宫格

# 数据x = np.array([1234])# 子图1:左上plt.subplot(221)plt.plot(x, x)plt.title("y = x")# 子图2:右上plt.subplot(222)plt.plot(x, x**2)plt.title("y = x²")# 子图3:左下plt.subplot(223)plt.plot(x, x**3)plt.title("y = x³")# 子图4:右下plt.subplot(224)plt.plot(x, np.sqrt(x))plt.title("y = √x")plt.suptitle("TEST109-1", fontsize=16)plt.tight_layout()plt.show()

四、subplots():批量创建法(推荐)

核心语法

fig, axes = plt.subplots(nrows=1, ncols=1, sharex=False, sharey=False)
参数
说明
常用值
nrows
行数
1, 2, 3...
ncols
列数
1, 2, 3...
sharex
共享X轴
False
True'col''row'
sharey
共享Y轴
False
True'col''row'
figsize
画布尺寸
(10, 8)
dpi
分辨率
100, 200, 300

示例 3:基础用法

import numpy as npimport matplotlib.pyplot as pltimport matplotlib.font_manager as fmimport os# ================= 1. 字体加载 =================font_path = "simhei.ttf"if not os.path.exists(font_path):    font_path = "/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc"prop = fm.FontProperties(fname=font_path)plt.rcParams['axes.unicode_minus'] = False# 数据x = np.linspace(02*np.pi, 400)y = np.sin(x**2)# 创建 1 个子图fig, ax = plt.subplots(figsize=(85))ax.plot(x, y)ax.set_title('简单曲线', fontproperties=prop)plt.show()

示例 4:1行2列 + 共享Y轴

import numpy as npimport matplotlib.pyplot as pltimport matplotlib.font_manager as fmimport os# ================= 1. 字体加载(解决中文乱码的核心) =================font_path = "simhei.ttf"  # 确保你已经在当前目录上传了 simhei.ttfif not os.path.exists(font_path):    font_path = "/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc"  # 备用系统字体prop = fm.FontProperties(fname=font_path)plt.rcParams['axes.unicode_minus'] = False# ================= 2. 数据准备 =================x = np.linspace(02 * np.pi, 400)  # 0 到 2π,400个点y = np.sin(x ** 2)                   # y = sin(x²),产生漂亮的振荡曲线# ================= 3. 创建 1行2列 子图,共享Y轴 =================fig, (ax1, ax2) = plt.subplots(12, sharey=True, figsize=(125))# ---------- 左图:折线图 ----------ax1.plot(x, y, color='#2E86AB', linewidth=1.5)ax1.set_title('折线图', fontproperties=prop, fontsize=14)ax1.set_xlabel('X 轴(弧度)', fontproperties=prop)ax1.set_ylabel('Y 值', fontproperties=prop)ax1.grid(True, alpha=0.3, linestyle='--')# ---------- 右图:散点图(共享Y轴,刻度对齐) ----------# 为了散点图效果更明显,每隔10个点取一个x_sample = x[::10]y_sample = y[::10]ax2.scatter(x_sample, y_sample, c='#E74C3C', s=20, alpha=0.6, edgecolors='white')ax2.set_title('散点图', fontproperties=prop, fontsize=14)ax2.set_xlabel('X 轴(弧度)', fontproperties=prop)ax2.grid(True, alpha=0.3, linestyle='--')# ================= 4. 总标题与布局 =================plt.suptitle('同一数据的不同展示', fontproperties=prop, fontsize=16, y=1.02)# tight_layout 在 suptitle 之后调用,避免总标题被覆盖plt.tight_layout(rect=[0010.98])  # 为总标题留出顶部空间plt.show()
🔥 共享轴的好处:Y轴刻度统一,便于直接对比数值差异。

五、共享轴的4种模式详解

模式
说明
效果
sharex=False
不共享(默认)
每个子图X轴独立
sharex='all'
 / True
全部共享
所有子图X轴统一
sharex='col'
按列共享
同一列的子图X轴相同
sharex='row'
按行共享
同一行的子图X轴相同
import numpy as npimport matplotlib.pyplot as pltimport matplotlib.font_manager as fmimport os# ================= 1. 字体加载(解决中文乱码的核心) =================font_path = "simhei.ttf"  # 确保你已经在当前目录上传了 simhei.ttfif not os.path.exists(font_path):    font_path = "/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc"  # 备用系统字体prop = fm.FontProperties(fname=font_path)plt.rcParams['axes.unicode_minus'] = False# ================= 2. 数据准备 =================x = np.linspace(02 * np.pi, 400)  # 0 到 2π,400个点# ================= 3. 创建 2x2 布局,按列共享X轴,按行共享Y轴 =================fig, axes = plt.subplots(22, sharex='col', sharey='row', figsize=(108))# ---------- 左上:sin(x) ----------axes[00].plot(x, np.sin(x), color='#2E86AB', linewidth=2)axes[00].set_title('正弦函数 sin(x)', fontproperties=prop, fontsize=12)axes[00].set_ylabel('Y 值', fontproperties=prop)axes[00].grid(True, alpha=0.3, linestyle='--')# ---------- 右上:cos(x) ----------axes[01].plot(x, np.cos(x), color='#E74C3C', linewidth=2)axes[01].set_title('余弦函数 cos(x)', fontproperties=prop, fontsize=12)axes[01].grid(True, alpha=0.3, linestyle='--')# 注意:由于 sharey='row',右上与左上共享Y轴,右侧Y轴刻度自动隐藏# ---------- 左下:tan(x)(限制范围避免无穷大)----------# tan(x) 在 π/2, 3π/2 处有渐近线,需要截断y_tan = np.tan(x)y_tan[np.abs(y_tan) > 10] = np.nan  # 超过10的值设为NaN,避免画出垂直线axes[10].plot(x, y_tan, color='#27AE60', linewidth=2)axes[10].set_title('正切函数 tan(x)', fontproperties=prop, fontsize=12)axes[10].set_xlabel('X 轴(弧度)', fontproperties=prop)axes[10].set_ylabel('Y 值', fontproperties=prop)axes[10].set_ylim(-1010)  # 限制Y轴范围axes[10].grid(True, alpha=0.3, linestyle='--')# ---------- 右下:exp(x) ----------y_exp = np.exp(x)axes[11].plot(x, y_exp, color='#9B59B6', linewidth=2)axes[11].set_title('指数函数 exp(x)', fontproperties=prop, fontsize=12)axes[11].set_xlabel('X 轴(弧度)', fontproperties=prop)axes[11].grid(True, alpha=0.3, linestyle='--')# 注意:由于 sharex='col',右下与左下共享X轴,底部X轴刻度已显示#       由于 sharey='row',右下与右上共享Y轴?不对!#       sharey='row' 表示:同一行的子图共享Y轴#       所以 左上和右上 共享Y轴,左下和右下 共享Y轴# ================= 4. 总标题与布局 =================plt.suptitle('2x2 共享轴布局 - 经典函数对比', fontproperties=prop, fontsize=16, y=1.02)# tight_layout 在 suptitle 之后调用plt.tight_layout(rect=[0010.98])plt.show()

六、实战:一份完整的数据分析看板

import numpy as npimport matplotlib.pyplot as pltimport matplotlib.font_manager as fmimport os# ================= 1. 字体加载 =================font_path = "simhei.ttf"if not os.path.exists(font_path):    font_path = "/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc"prop = fm.FontProperties(fname=font_path)plt.rcParams['axes.unicode_minus'] = False# 数据months = ['1月', '2月', '3月', '4月', '5月', '6月']sales = [120, 135, 148, 162, 155, 178]profit = [20, 25, 30, 35, 28, 40]categories = ['A', 'B', 'C', 'D', 'E']values = [25, 40, 30, 55, 15]# 创建 2x2 布局fig, axes = plt.subplots(22, figsize=(1410))# ========== 子图1:销售趋势(折线图)==========ax1 = axes[00]ax1.plot(months, sales, marker='o', color='#2E86AB', linewidth=2)ax1.set_title('月度销售额趋势', fontproperties=prop, fontsize=12)ax1.set_ylabel('销售额(万元)', fontproperties=prop)ax1.grid(True, alpha=0.3)# ========== 子图2:利润趋势(柱状图)==========ax2 = axes[01]bars = ax2.bar(months, profit, color='#E74C3C', alpha=0.7)ax2.set_title('月度利润', fontproperties=prop, fontsize=12)ax2.set_ylabel('利润(万元)', fontproperties=prop)for bar in bars:    height = bar.get_height()    ax2.text(bar.get_x() + bar.get_width()/2., height + 1,             f'{height}', ha='center', fontsize=9)# ========== 子图3:品类占比(饼图)==========ax3 = axes[10]colors = ['#FF6B6B', '#4ECDC4', '#45B7D1', '#FFA07A', '#98D8C8']ax3.pie(values, labels=categories, colors=colors, autopct='%1.1f%%',        startangle=90, textprops={'fontproperties': prop})ax3.set_title('品类占比', fontproperties=prop, fontsize=12)# ========== 子图4:销售vs利润(散点图)==========ax4 = axes[11]ax4.scatter(sales, profit, s=200, c='#9B59B6', alpha=0.7, edgecolors='white')ax4.set_title('销售额 vs 利润', fontproperties=prop, fontsize=12)ax4.set_xlabel('销售额', fontproperties=prop)ax4.set_ylabel('利润', fontproperties=prop)ax4.grid(True, alpha=0.3)# 总标题fig.suptitle('2026年上半年经营分析看板', fontproperties=prop, fontsize=18, y=0.98)plt.tight_layout(rect=[0010.96])  # 为总标题留出空间plt.show()

参数速查卡

# subplot 快速定位plt.subplot(221)  # 22列第1# subplots 批量创建fig, axes = plt.subplots(22, sharex=True, sharey=True, figsize=(108))# 访问子图axes[00].plot(...)  # 第一行第一列axes[11].scatter(...)  # 第二行第二列# 调整布局plt.tight_layout()  # 自动紧凑plt.subplots_adjust(hspace=0.3, wspace=0.3)  # 手动调间距

十、今日练习

  1. 基础题:用 subplot() 创建 1行3列 的并排子图

  2. 进阶题:用 subplots() 创建 2x2 布局,并共享X轴

  3. 挑战题:制作一份包含折线、柱状、饼图、散点的数据分析看板

十一、总结

今天我们掌握了 Matplotlib 多子图的核心技能:

  • ✅ plt.subplot() —— 逐个定位,适合简单场景

  • ✅ plt.subplots() —— 批量创建,面向对象,推荐日常使用

  • ✅ sharex / sharey —— 共享轴,让对比更直观

  • ✅ plt.tight_layout() —— 自动调整,告别重叠

  • ✅ 字体加载 —— FontProperties 加载 simhei.ttf,中文显示无忧

🎯 今日金句单图是数据的独白,多子图是数据的交响——学会布局,才能让数据讲出完整的故事。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-03 03:47:17 HTTP/2.0 GET : https://f.mffb.com.cn/a/501698.html
  2. 运行时间 : 0.089563s [ 吞吐率:11.17req/s ] 内存消耗:4,560.91kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=f49f7ffd618ab1ed6220e0f9c59a4f12
  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.000523s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000869s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000328s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000277s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000538s ]
  6. SELECT * FROM `set` [ RunTime:0.000217s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000632s ]
  8. SELECT * FROM `article` WHERE `id` = 501698 LIMIT 1 [ RunTime:0.000528s ]
  9. UPDATE `article` SET `lasttime` = 1783021637 WHERE `id` = 501698 [ RunTime:0.010032s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000278s ]
  11. SELECT * FROM `article` WHERE `id` < 501698 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000487s ]
  12. SELECT * FROM `article` WHERE `id` > 501698 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.001692s ]
  13. SELECT * FROM `article` WHERE `id` < 501698 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.000725s ]
  14. SELECT * FROM `article` WHERE `id` < 501698 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.002002s ]
  15. SELECT * FROM `article` WHERE `id` < 501698 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.001290s ]
0.091241s