当前位置:首页>python>Python数据可视化:基础篇 - Matplotlib

Python数据可视化:基础篇 - Matplotlib

  • 2026-03-23 20:08:44
Python数据可视化:基础篇 - Matplotlib

引言:为什么需要数据可视化?

在大数据时代,我们每天都要面对海量的数据。然而,原始数据往往是枯燥和难以理解的,数据可视化通过图形化的方式,将复杂的数据转化为直观的图表,帮助我们:

  • 发现数据中的模式:快速识别数据中的趋势、异常和关联
  • 传达复杂信息:用简洁的图形传达复杂的数据分析结果
  • 辅助决策:基于可视化的洞察做出更明智的决策
  • 提高沟通效率:用图形化方式与他人分享数据分析结果

Matplotlib是Python中最基础、最广泛使用的数据可视化库,本文将带你掌握Matplotlib的核心技能。


一、Matplotlib介绍

什么是Matplotlib

Matplotlib是Python中最基础、最广泛使用的数据可视化库,提供了底层的绘图API,支持各种类型的图表。

特点

  • 功能强大:支持多种图表类型
  • 高度可定制:几乎可以控制图表的每个细节
  • 无缝集成:与NumPy和Pandas无缝集成
  • 高质量输出:适合制作 publication 级别的图表

二、环境搭建

1. 安装Matplotlib

# 使用pip安装pip install matplotlib numpy pandas# 或使用conda安装conda install matplotlib numpy pandas

2. 验证安装

import matplotlib.pyplot as pltimport numpy as npimport pandas as pdprint("Matplotlib版本:", plt.__version__)print("环境搭建成功!")

三、基本图表绘制

1. 折线图

折线图适合展示数据随时间变化的趋势。

import matplotlib.pyplot as pltimport numpy as np# 设置中文字体plt.rcParams["font.sans-serif"] = ["SimHei"]plt.rcParams["axes.unicode_minus"] = False# 准备数据x = np.linspace(010100)y = np.sin(x)# 绘制折线图plt.figure(figsize=(106))plt.plot(x, y, label='sin(x)', color='blue', linewidth=2, linestyle='-')plt.title('正弦函数曲线')plt.xlabel('x轴')plt.ylabel('y轴')plt.legend()plt.grid(True, alpha=0.3)plt.show()

2. 柱状图

柱状图适合比较不同类别的数据。

# 准备数据categories = ['产品A''产品B''产品C''产品D''产品E']values = [2345126734]colors = ['#FF6B6B''#4ECDC4''#45B7D1''#96CEB4''#FFEAA7']# 绘制柱状图plt.figure(figsize=(106))bars = plt.bar(categories, values, color=colors, alpha=0.8, edgecolor='black')# 添加数值标签for bar in bars:    height = bar.get_height()    plt.text(bar.get_x() + bar.get_width()/2., height,f'{height}',             ha='center', va='bottom')plt.title('不同产品的销售情况')plt.xlabel('产品类别')plt.ylabel('销售数量')plt.ylim(075)plt.show()

3. 散点图

散点图适合展示两个变量之间的关系。

# 准备数据np.random.seed(42)x = np.random.rand(100)y = np.random.rand(100)colors = np.random.rand(100)sizes = 1000 * np.random.rand(100)# 绘制散点图plt.figure(figsize=(106))scatter = plt.scatter(x, y, c=colors, s=sizes, alpha=0.5, cmap='viridis')plt.colorbar(scatter, label='颜色值')plt.title('散点图示例')plt.xlabel('X变量')plt.ylabel('Y变量')plt.show()

4. 直方图

直方图适合展示数据的分布情况。

# 准备数据np.random.seed(42)data = np.random.randn(1000)# 绘制直方图plt.figure(figsize=(106))n, bins, patches = plt.hist(data, bins=30, alpha=0.7                             color='skyblue', edgecolor='black', linewidth=1)# 添加均值线mean_val = np.mean(data)plt.axvline(mean_val, color='red', linestyle='--', linewidth=2            label=f'均值: {mean_val:.2f}')plt.legend()plt.title('数据分布直方图')plt.xlabel('数值')plt.ylabel('频率')plt.show()

5. 饼图

饼图适合展示各部分占整体的比例。

# 准备数据sizes = [3020251510]labels = ['产品A''产品B''产品C''产品D''产品E']colors = ['#FF6B6B''#4ECDC4''#45B7D1''#96CEB4''#FFEAA7']explode = (0.10000)  # 突出显示第一个部分# 绘制饼图plt.figure(figsize=(88))plt.pie(sizes, explode=explode, labels=labels, colors=colors,        autopct='%1.1f%%', shadow=True, startangle=90,        textprops={'fontsize'12})plt.title('产品销售额占比')plt.axis('equal')  # 保证饼图是圆形plt.show()

四、子图布局

1. 基本子图

import matplotlib.pyplot as pltimport numpy as np# 创建2x2的子图fig, axes = plt.subplots(22, figsize=(1210))# 第一个子图:折线图x = np.linspace(010100)y1 = np.sin(x)axes[00].plot(x, y1, color='blue')axes[00].set_title('正弦函数')axes[00].set_xlabel('x')axes[00].set_ylabel('sin(x)')axes[00].grid(True, alpha=0.3)# 第二个子图:柱状图categories = ['A''B''C''D''E']values = [2345126734]axes[01].bar(categories, values, color='skyblue')axes[01].set_title('柱状图')axes[01].set_xlabel('类别')axes[01].set_ylabel('值')# 第三个子图:散点图x_scatter = np.random.rand(50)y_scatter = np.random.rand(50)axes[10].scatter(x_scatter, y_scatter, color='green', alpha=0.6)axes[10].set_title('散点图')axes[10].set_xlabel('x')axes[10].set_ylabel('y')# 第四个子图:直方图data = np.random.randn(1000)axes[11].hist(data, bins=30, color='orange', alpha=0.7)axes[11].set_title('直方图')axes[11].set_xlabel('值')axes[11].set_ylabel('频率')plt.tight_layout()  # 调整子图布局plt.show()

2. 自定义子图布局

# 使用gridspec自定义布局import matplotlib.gridspec as gridspecfig = plt.figure(figsize=(148))gs = gridspec.GridSpec(33, figure=fig)# 主图占据第一行全部ax1 = fig.add_subplot(gs[0, :])x = np.linspace(010100)ax1.plot(x, np.sin(x), color='blue', linewidth=2)ax1.set_title('主图 - 正弦函数')ax1.grid(True, alpha=0.3)# 左侧两图ax2 = fig.add_subplot(gs[1:, 0])ax2.bar(['A''B''C'], [102015], color='skyblue')ax2.set_title('柱状图')ax3 = fig.add_subplot(gs[1:, 1])ax3.scatter(np.random.rand(30), np.random.rand(30), color='green')ax3.set_title('散点图')# 右侧一图ax4 = fig.add_subplot(gs[1:, 2])data = np.random.randn(500)ax4.hist(data, bins=20, color='orange', alpha=0.7)ax4.set_title('直方图')plt.tight_layout()plt.show()

五、图表美化

1. 设置样式

# 查看可用的样式print(plt.style.available)# 使用ggplot风格plt.style.use('ggplot')# 绘制图表x = np.linspace(010100)plt.figure(figsize=(106))plt.plot(x, np.sin(x), label='sin(x)')plt.plot(x, np.cos(x), label='cos(x)')plt.title('使用ggplot风格')plt.legend()plt.grid(True)plt.show()# 恢复默认风格plt.style.use('default')

2. 自定义颜色和线条

plt.figure(figsize=(106))# 自定义线条样式x = np.linspace(010100)plt.plot(x, np.sin(x), color='#FF6B6B', linewidth=3         linestyle='-', marker='o', markersize=5, label='sin(x)')plt.plot(x, np.cos(x), color='#4ECDC4', linewidth=3         linestyle='--', marker='s', markersize=5, label='cos(x)')plt.title('自定义线条样式')plt.xlabel('x')plt.ylabel('y')plt.legend(fontsize=12)plt.grid(True, alpha=0.3, linestyle=':')plt.show()

3. 添加注释

plt.figure(figsize=(106))x = np.linspace(010100)y = np.sin(x)plt.plot(x, y, color='blue', linewidth=2)# 找到最大值点max_idx = np.argmax(y)max_x = x[max_idx]max_y = y[max_idx]# 添加箭头注释plt.annotate('最大值',             xy=(max_x, max_y),             xytext=(max_x + 1, max_y + 0.5),             arrowprops=dict(facecolor='red', shrink=0.05, width=2, headwidth=8),             fontsize=12,             ha='center')# 添加文本注释plt.text(20.5'这是一段文本注释', fontsize=12         bbox=dict(boxstyle='round,pad=0.5', facecolor='yellow', alpha=0.5))plt.title('添加注释')plt.xlabel('x')plt.ylabel('y')plt.grid(True, alpha=0.3)plt.show()

六、实战案例:销售趋势分析

1. 数据描述

我们有一份销售数据,包含以下字段:

  • date: 销售日期
  • product: 产品名称
  • category: 产品类别
  • quantity: 销售数量
  • price: 单价
  • revenue: 销售额

2. 可视化目标

  • 分析销售趋势
  • 分析产品类别销售分布
  • 分析月度销售情况

3. 代码实现

import pandas as pdimport matplotlib.pyplot as pltimport numpy as np# 设置中文字体plt.rcParams["font.sans-serif"] = ["SimHei"]plt.rcParams["axes.unicode_minus"] = False# 创建模拟数据np.random.seed(42)dates = pd.date_range('2024-01-01''2024-12-31', freq='D')products = ['智能手机''笔记本电脑''平板电脑''耳机''充电器']categories = ['电子产品''电子产品''电子产品''配件''配件']data = {'date': np.random.choice(dates, 1000),'product': np.random.choice(products, 1000),'category': np.random.choice(categories, 1000),'quantity': np.random.randint(1101000),'price': np.random.choice([29995999199929999], 1000)}df = pd.DataFrame(data)df['revenue'] = df['quantity'] * df['price']# 1. 销售趋势分析daily_sales = df.groupby('date')['revenue'].sum().reset_index()plt.figure(figsize=(146))plt.plot(daily_sales['date'], daily_sales['revenue'],          color='#45B7D1', linewidth=1.5, alpha=0.7)plt.title('2024年每日销售趋势', fontsize=16)plt.xlabel('日期', fontsize=12)plt.ylabel('销售额', fontsize=12)plt.grid(True, alpha=0.3)plt.xticks(rotation=45)plt.tight_layout()plt.show()# 2. 产品类别销售分布category_sales = df.groupby('category')['revenue'].sum().sort_values(ascending=False)fig, (ax1, ax2) = plt.subplots(12, figsize=(146))# 柱状图colors = ['#FF6B6B''#4ECDC4']bars = ax1.bar(category_sales.index, category_sales.values, color=colors, alpha=0.8)for bar in bars:    height = bar.get_height()    ax1.text(bar.get_x() + bar.get_width()/2., height,f'{height:,.0f}',             ha='center', va='bottom', fontsize=11)ax1.set_title('不同类别的销售额', fontsize=14)ax1.set_ylabel('销售额', fontsize=12)# 饼图ax2.pie(category_sales.values, labels=category_sales.index,         colors=colors, autopct='%1.1f%%', startangle=90)ax2.set_title('类别销售额占比', fontsize=14)ax2.axis('equal')plt.tight_layout()plt.show()# 3. 月度销售情况df['month'] = df['date'].dt.monthmonthly_sales = df.groupby('month')['revenue'].sum()plt.figure(figsize=(126))months = ['1月''2月''3月''4月''5月''6月''7月''8月''9月''10月''11月''12月']bars = plt.bar(months, monthly_sales.values, color='#96CEB4', alpha=0.8, edgecolor='black')# 添加数值标签for bar in bars:    height = bar.get_height()    plt.text(bar.get_x() + bar.get_width()/2., height,f'{height:,.0f}',             ha='center', va='bottom', fontsize=10)plt.title('2024年月度销售额', fontsize=16)plt.xlabel('月份', fontsize=12)plt.ylabel('销售额', fontsize=12)plt.xticks(rotation=45)plt.grid(axis='y', alpha=0.3)plt.tight_layout()plt.show()

七、数据可视化最佳实践

1. 选择合适的图表类型

数据类型
推荐图表
用途
时间序列
折线图
展示随时间变化的趋势
分类数据
柱状图、饼图
比较不同类别的数据
数值分布
直方图
展示数据的分布情况
相关性
散点图
展示变量之间的关系

2. 设计原则

  • 简洁明了:避免过多的装饰和不必要的元素
  • 重点突出:突出显示重要的数据和结论
  • 色彩搭配:使用和谐的色彩,避免过于刺眼的颜色
  • 标签清晰:确保图表有清晰的标题、坐标轴标签和图例
  • 比例适当:确保图表的比例适当,避免视觉误导

八、学习资源推荐

1. 官方文档

  • Matplotlib官网:https://matplotlib.org/
  • Matplotlib教程:https://matplotlib.org/stable/tutorials/index.html

2. 书籍

  • 《Python数据可视化》(Kelsey Innes)
  • 《Matplotlib数据分析与可视化》(嵩天)

九、总结

Matplotlib是Python数据可视化的基础库,掌握Matplotlib可以让你灵活地创建各种类型的图表。通过本文的学习,你已经掌握了:

  • Matplotlib的基本概念和环境搭建
  • 五种基本图表的绘制方法
  • 子图布局和自定义
  • 图表美化技巧
  • 实战案例应用

学习数据可视化的关键在于实践,多尝试不同的图表类型,多分析真实数据,才能真正掌握这项技能。

小贴士:数据可视化不仅仅是技术,更是一种艺术。好的可视化应该既美观又有效,能够清晰地传达数据背后的信息。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-03-27 18:37:53 HTTP/2.0 GET : https://f.mffb.com.cn/a/482175.html
  2. 运行时间 : 0.090200s [ 吞吐率:11.09req/s ] 内存消耗:4,835.13kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=f945c9c68ffaa3e5cac42159e34d1186
  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.000594s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000634s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000325s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000277s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000473s ]
  6. SELECT * FROM `set` [ RunTime:0.000188s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000539s ]
  8. SELECT * FROM `article` WHERE `id` = 482175 LIMIT 1 [ RunTime:0.000534s ]
  9. UPDATE `article` SET `lasttime` = 1774607873 WHERE `id` = 482175 [ RunTime:0.003561s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000245s ]
  11. SELECT * FROM `article` WHERE `id` < 482175 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000429s ]
  12. SELECT * FROM `article` WHERE `id` > 482175 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000345s ]
  13. SELECT * FROM `article` WHERE `id` < 482175 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.004954s ]
  14. SELECT * FROM `article` WHERE `id` < 482175 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.002981s ]
  15. SELECT * FROM `article` WHERE `id` < 482175 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.004979s ]
0.091879s