fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. // your code goes here
  13. }
  14. }
Success #stdin #stdout 0.08s 54660KB
stdin
import matplotlib.pyplot as plt

# 设置中文字体
plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['axes.unicode_minus'] = False

# 创建数据
semesters = ['2019春季', '2019秋季', '2020春季', '2020秋季', '2021春季', '2021秋季']
homework_count = [150, 170, 190, 210, 230, 250]

# 创建图表
plt.figure(figsize=(10, 6))
plt.plot(semesters, homework_count, marker='o', linestyle='-', color='b', linewidth=2)

# 添加数据标签
for x, y in zip(semesters, homework_count):
    plt.text(x, y, f'{y}', ha='center', va='bottom')

# 添加网格线
plt.grid(True, linestyle='--', alpha=0.6)

# 添加标题和标签
plt.title('教师作业批改量变化趋势 (2019 - 2021)', fontsize=16)
plt.xlabel('学期', fontsize=12)
plt.ylabel('每周批改作业量 (份)', fontsize=12)

# 显示图表
plt.show()
stdout
Standard output is empty