academic_colors_palette = ['#E3120B', '#2C3E50', '#008080', '#F0A700', '#8E9EAA'] # 学术配色
fig, axes = plt.subplots(1, 3, figsize=(16, 5)) # 创建1行3列子图
axes[0].scatter(plotting_data['log_revenue'], plotting_data['log_profit'], alpha=0.4, s=25, c='#2C3E50') # 左图散点
poly_coeff = np.polyfit(plotting_data['log_revenue'], plotting_data['log_profit'], 1) # 线性拟合
axes[0].plot(plotting_data['log_revenue'], np.polyval(poly_coeff, plotting_data['log_revenue']), color='#E3120B', lw=2.5) # 趋势线
axes[0].set_xlabel('Log10 营业收入', fontsize=11) # x轴标签
axes[0].set_ylabel('Log10 净利润', fontsize=11) # y轴标签
axes[0].set_title('净利润与营收呈强线性关系', fontweight='bold') # 标题
axes[1].scatter(plotting_data['log_assets'], plotting_data['log_profit'], alpha=0.4, s=25, c='#008080') # 中图散点
poly_coeff_assets = np.polyfit(plotting_data['log_assets'], plotting_data['log_profit'], 1) # 线性拟合
axes[1].plot(plotting_data['log_assets'], np.polyval(poly_coeff_assets, plotting_data['log_assets']), color='#E3120B', lw=2.5) # 趋势线
axes[1].set_xlabel('Log10 总资产', fontsize=11) # x轴标签
axes[1].set_title('盈利随资产规模同步增长', fontweight='bold') # 标题
sns.boxplot(x='industry_name', y='log_profit', data=plotting_data, ax=axes[2], palette=academic_colors_palette) # 右图箱线图
axes[2].set_xlabel('细分行业', fontsize=11) # x轴标签
axes[2].set_title('行业间利润分布差异显著', fontweight='bold') # 标题
plt.xticks(rotation=30) # 旋转标签
for ax in axes: # 添加网格
ax.grid(True, linestyle='--', alpha=0.5)
plt.tight_layout() # 自动调整间距
plt.show() # 显示图形