old_contents: import os
  import matplotlib.pyplot as plt
  
  
  import pymagicc
  from pymagicc import scenarios
  
  
  plt.style.use("ggplot")
  plt.rcParams["figure.figsize"] = 10, 5
  plt.rcParams["font.family"] = "serif"
  plt.rcParams["font.size"] = 12
  
  
  output_path = os.path.join(
      os.path.dirname(__file__),
      './example-plot.png'
  )
  
  for name, scen in scenarios.items():
      results = pymagicc.run(scen)
      results_df = results.df
      results_df.set_index("time", inplace=True)
  
      global_temp_time_rows = (
          (results_df.variable == "Surface Temperature")
          & (results_df.region == "World")
      )
  
      temp = (
          results_df.value[global_temp_time_rows].loc[1850:]
          - results_df.value[global_temp_time_rows].loc[1850:1900].mean()
      )
      temp.plot(label=name)
  
  plt.legend()
  plt.title("Global Mean Temperature Projection")
  plt.ylabel("°C over pre-industrial (1850-1900 mean)");
  plt.legend(loc="best")
  
  plt.savefig(output_path, dpi=96)
  
new_contents: import os
  
  import matplotlib.pyplot as plt
  import pymagicc
  import scmdata
  from pymagicc import rcps
  
  
  plt.style.use("ggplot")
  plt.rcParams["figure.figsize"] = 10, 5
  plt.rcParams["font.family"] = "serif"
  plt.rcParams["font.size"] = 12
  
  
  output_path = os.path.join(
      os.path.dirname(__file__),
      './example-plot.png'
  )
  
  results = []
  for scen in rcps.groupby("scenario"):
      results_scen = pymagicc.run(scen)
      results.append(results_scen)
  
  results = scmdata.run_append(results)
  
  temperature_rel_to_1850_1900 = (
      results
      .filter(variable="Surface Temperature")
      .relative_to_ref_period_mean(year=range(1850, 1900 + 1))
  )
  
  temperature_rel_to_1850_1900.lineplot()
  plt.title("Global Mean Temperature Projection")
  plt.ylabel("°C over pre-industrial (1850-1900 mean)")
  
  plt.savefig(output_path, dpi=96)
  
subject: Update plot example script