import matplotlib.pyplot as plt def generate_timeline(cv_type, education_level, score): stages = [] durations = [] if score < 60: stages.append("Skill Development") durations.append(3) elif score < 80: stages.append("Skill Polishing") durations.append(2) if education_level.lower() in ["high school", "bachelor"]: stages.append("Certifications") durations.append(2) if education_level.lower() in ["high school", "bachelor"]: stages.append("Higher Education") durations.append(3) stages.append("Job Applications") durations.append(1) if cv_type.lower() in ["technical", "engineering", "it"]: stages.append("Interview Prep") durations.append(1) stages.append("Visa Process") durations.append(1) fig, ax = plt.subplots(figsize=(10, 2)) ax.barh(["Roadmap"], [sum(durations)], color="lightgray") left = 0 for stage, duration in zip(stages, durations): ax.barh(["Roadmap"], [duration], left=left, label=stage) left += duration ax.legend(bbox_to_anchor=(1.05, 1), loc='upper left') ax.set_title("Career Roadmap Timeline") ax.axis('off') return fig