fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. return 0;
  6. }
  7.  
Success #stdin #stdout 0s 5320KB
stdin
import matplotlib.pyplot as plt
 import numpy as np
 from matplotlib.patches import FancyBboxPatch
 import matplotlib.patches as mpatches
 # 设置中文字体
 plt.rcParams['font.sans-serif'] = ['SimHei', 'DejaVu Sans']
 plt.rcParams['axes.unicode_minus'] = False
 # 创建图形
 fig, ax = plt.subplots(figsize=(12, 6))
 # 时间轴数据
 stages = ['初期探索阶段', '能力进阶阶段', '长期深耕阶段']
 time_ranges = ['1-2年', '3-5年', '5年以上']
 start_times = [1, 3, 5]
 end_times = [2, 5, 10]
 colors = ['#4CAF50', '#2196F3', '#FF9800']
 tasks = [
     '• 掌握机械核心原理\n• 基础设备运维实操\n• 行业基础技能认证',
     '• 深耕细分领域技术\n• 主导中小型项目\n• 专项技能进阶认证',
     '• 统筹大型研发项目\n• 团队管理与技术创新\n• 成为技术管理复合型人才'
 ]
 # 绘制时间轴主线
 ax.plot([0, 11], [0, 0], color='#333333', linewidth=3, zorder=1)
 # 绘制各阶段
 for i, (stage, time_range, start, end, color, task) in enumerate(zip(stages, time_ranges, start_times, end_times, colors, tasks)):
     # 阶段矩形框
     bbox = FancyBboxPatch((start, -0.8), end - start, 1.2, 
                          boxstyle="round,pad=0.1", 
                          facecolor=color, alpha=0.3, 
                          edgecolor=color, linewidth=2,
                          zorder=2)
     ax.add_patch(bbox)
     
     # 阶段标题
     ax.text((start + end) / 2, 0.1, stage, ha='center', va='center', 
             fontsize=12, fontweight='bold', color=color)
     
     # 时间范围
     ax.text((start + end) / 2, -0.6, time_range, ha='center', va='center', 
             fontsize=10, color='#333333')
     
     # 核心任务
     ax.text((start + end) / 2, 0.8, task, ha='center', va='bottom', 
             fontsize=9, color='#333333', linespacing=1.2)
     
     # 阶段节点
     ax.scatter([start, end], [0, 0], color=color, s=80, zorder=3)
 # 设置坐标轴
 ax.set_xlim(0, 11)
 ax.set_ylim(-1.5, 2.0)
 ax.set_xticks(np.arange(1, 11))
 ax.set_xticklabels([f'{i}年' for i in range(1, 11)], fontsize=9)
 ax.set_yticks([])
 ax.spines['top'].set_visible(False)
 ax.spines['right'].set_visible(False)
 ax.spines['bottom'].set_visible(False)
 ax.spines['left'].set_visible(False)
 # 添加网格
 ax.grid(True, axis='x', alpha=0.3, linestyle='--')
 # 标题
 plt.title('机械设备行业职业发展阶段时间轴', fontsize=16, fontweight='bold', pad=20)
 # 调整布局
 plt.tight_layout()
 # 保存图片
 plt.savefig('机械设备行业职业发展阶段时间轴图.png', dpi=300, bbox_inches='tight')
 plt.close()
 print("机械设备行业职业发展阶段时间轴图已生成完成")
stdout
Standard output is empty